:root {
  --primary: #D92353;
  --primary-dark: #b61e45;
  --secondary: #404373;
  --deep-blue: #2B3A8C;
  --soft-blue: #8890BF;
  --surface: #F2F2F2;
  --white: #ffffff;
  --text: #222439;
  --muted: #5d607f;
  --success: #1b7a43;
  --error: #b52835;
  --shadow: 0 10px 30px rgba(43, 58, 140, 0.15);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(140deg, #f8f9ff 10%, var(--surface) 100%);
  color: var(--text);
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
}

.container {
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 0 20px;
}

.topbar {
  background: linear-gradient(100deg, var(--deep-blue), var(--secondary));
  box-shadow: var(--shadow);
}

.topbar-content {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  color: var(--white);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
}

.brand-logo {
  background: var(--white);
  border-radius: 10px;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
}

.brand-logo img {
  display: block;
  height: 64px;
  width: auto;
  max-width: 260px;
}

.brand-fallback {
  display: none;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  color: var(--primary);
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.topbar nav a {
  color: var(--surface);
  text-decoration: none;
  font-weight: 600;
}

.topbar nav a:hover {
  color: var(--white);
}

.page-content {
  padding-top: 38px;
  padding-bottom: 52px;
}

.panel {
  background: var(--white);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 30px;
  margin-bottom: 24px;
}

h1, h2, h3 {
  margin-top: 0;
  color: var(--secondary);
}

p {
  line-height: 1.5;
  color: var(--muted);
}

form p {
  margin-bottom: 14px;
}

input, select, textarea {
  width: 100%;
  margin-top: 6px;
  border: 1px solid #d7daf0;
  background: #fcfcff;
  border-radius: 11px;
  padding: 11px 12px;
  font-size: 0.96rem;
  color: var(--text);
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(217, 35, 83, 0.2);
  border-color: var(--primary);
}

label {
  font-weight: 600;
  color: var(--secondary);
}

input[type="checkbox"] {
  width: auto;
  transform: scale(1.1);
  margin-right: 8px;
}

.helptext {
  display: block;
  margin-top: 4px;
  color: #7176a6;
  font-size: 0.85rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 11px;
  padding: 12px 20px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
}

.button-primary {
  background: var(--primary);
  color: var(--white);
}

.button-primary:hover {
  background: var(--primary-dark);
}

.button-secondary {
  background: #e9edff;
  color: var(--deep-blue);
}

.button-secondary:hover {
  background: #d7deff;
}

.button-link {
  color: var(--deep-blue);
  font-weight: 700;
  text-decoration: none;
}

.hero {
  display: grid;
  gap: 24px;
  grid-template-columns: 1.1fr 0.9fr;
}

.hero-card {
  border-radius: 18px;
  padding: 34px 30px;
  background: linear-gradient(130deg, var(--deep-blue), var(--secondary));
  color: var(--white);
  box-shadow: var(--shadow);
}

.hero-card h1,
.hero-card p {
  color: var(--white);
}

.hero-card p {
  opacity: 0.9;
}

.hero-card .actions {
  margin-top: 26px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  padding: 8px 12px;
  background: #ffe9f0;
  color: var(--primary);
  border-radius: 999px;
  font-weight: 700;
  margin-bottom: 12px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.feature-card {
  background: var(--white);
  border: 1px solid #eceffd;
  border-radius: 14px;
  padding: 16px;
}

.feature-card h3 {
  margin-bottom: 8px;
}

.feature-card p {
  margin: 0;
  font-size: 0.93rem;
}

.meta-list {
  margin: 0;
  padding-left: 20px;
}

.meta-list li {
  margin-bottom: 8px;
}

.credentials {
  background: #f7f8ff;
  border: 1px solid #d8def8;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}

.credentials strong {
  display: block;
  color: var(--secondary);
  margin-bottom: 4px;
}

.credentials code {
  display: inline-block;
  word-break: break-word;
  color: var(--deep-blue);
  font-weight: 700;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  border: 1px solid #e3e6fa;
  border-left: 6px solid var(--soft-blue);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fcfcff;
}

.status-chip {
  display: inline-block;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 6px 10px;
  background: #e7e9f8;
  color: var(--deep-blue);
}

.status-recebida { background: #ffeaf0; color: var(--primary); }
.status-analise { background: #fff0d9; color: #985900; }
.status-encaminhada { background: #e8eeff; color: #1b4790; }
.status-concluida { background: #e6f6ef; color: var(--success); }
.status-arquivada { background: #ececec; color: #595959; }

.alert {
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
}

.alert p { margin: 0; }

.alert-error {
  border: 1px solid #f3c4ca;
  background: #fff0f2;
}

.attachments-list {
  margin: 0;
  padding-left: 18px;
}

.attachments-list li {
  margin-bottom: 8px;
}

.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 900px) {
  .hero,
  .feature-grid,
  .two-cols {
    grid-template-columns: 1fr;
  }

  .topbar-content {
    flex-direction: column;
    justify-content: center;
    padding: 14px 0;
  }
}

@media (max-width: 600px) {
  .brand-logo img {
    height: 48px;
  }
}

.page-content { flex: 1 0 auto; width: 100%; }

.site-footer {
  margin-top: 32px;
  padding: 20px 0;
  background: var(--secondary, #404373);
  color: #fff;
  text-align: center;
  font-size: .9rem;
  border-top: 4px solid #D92353;
}
.site-footer, .site-footer p, .site-footer strong { color: #fff; }
.site-footer p { margin: 4px 0; opacity: 1; }
.site-footer strong { color: #fff; }
