* { box-sizing: border-box; }

:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --line: #dbe2ea;
  --line-strong: #cbd5e1;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #1e3a8a;
  --primary-dark: #0f172a;
  --primary-blue: #2563eb;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
}

a { color: inherit; text-decoration: none; }

.hidden { display: none !important; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 18px 28px;
  box-shadow: var(--shadow);
}

.topbar-esquerda,
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-brand { gap: 14px; }

.topbar-logo {
  width: 54px;
  height: 54px;
  object-fit: contain;
  border-radius: 14px;
  background: var(--surface-soft);
  padding: 6px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  flex-shrink: 0;
}

.topbar-brand-texto {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar-subtitulo,
.tag-sistema,
.resumo-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.topbar h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  word-break: break-word;
}

.topbar-acoes {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn-topo {
  border: none;
  border-radius: 14px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
}

.btn-primario,
.primary {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
}

.btn-primario:hover,
.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.22);
}

.btn-secundario,
.ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line-strong);
}

.btn-secundario:hover,
.ghost:hover { background: var(--surface-soft); }

.btn-sair-topo {
  color: var(--danger);
  border-color: #fecaca;
  background: var(--surface);
}

.btn-sair-topo:hover { background: var(--danger-soft); }

.container-principal {
  width: min(1380px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 48px;
}

.cards-resumo {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.resumo-card,
.painel-box,
.result,
.notice,
.message {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-soft) 100%);
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

.resumo-card {
  min-height: 94px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.resumo-card strong {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
}

.layout-formulario {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.7fr);
  gap: 18px;
  align-items: start;
}

.painel-box { padding: 22px; }

.intro-box {
  position: sticky;
  top: 108px;
  display: grid;
  gap: 12px;
}

.intro-box h2,
.pagina-cabecalho h2,
.side-head h2,
.case-detail h1,
.case-detail h2 {
  margin: 0;
  color: var(--text);
  font-size: 26px;
  line-height: 1.15;
  font-weight: 800;
}

.intro-box p,
.pagina-cabecalho p,
.prose p {
  margin: 0;
  color: var(--muted);
  max-width: 72ch;
}

.intro-box .tag-sistema,
.formulario-header .tag-sistema,
.pagina-cabecalho .tag-sistema {
  display: block;
}

.aviso-discreto {
  margin: 2px 0 0;
  padding: 12px 0 0;
  border-top: 1px solid #e2e8f0;
  color: var(--muted);
}

.pagina-cabecalho {
  display: grid;
  gap: 10px;
}

.prose {
  display: grid;
  gap: 12px;
}

.privacy-page {
  width: min(1100px, 100%);
  margin: 0 auto;
  display: grid;
}

.privacy-overview {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.privacy-copy {
  position: sticky;
  top: 110px;
  display: grid;
  gap: 12px;
  padding: 24px;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-soft) 100%);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

.privacy-copy h2 {
  margin: 0;
  color: var(--text);
  font-size: 30px;
  line-height: 1.12;
  font-weight: 800;
}

.privacy-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.privacy-summary {
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-soft) 100%);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
  overflow: hidden;
}

.privacy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 20px 22px;
  border-bottom: 1px solid #e2e8f0;
}

.privacy-row:last-child {
  border-bottom: 0;
}

.privacy-row h3 {
  margin: 0 0 5px;
  color: var(--text);
  font-size: 17px;
  line-height: 1.2;
}

.privacy-row p {
  margin: 0;
  max-width: 66ch;
  color: var(--muted);
  line-height: 1.55;
}

.privacy-row > span {
  min-width: 118px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-soft);
  padding: 8px 12px;
  color: #334155;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}

.notice,
.result {
  padding: 14px 16px;
  color: var(--muted);
}

.form {
  display: grid;
  gap: 18px;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

label {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 11px 13px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 400;
}

textarea {
  resize: vertical;
  min-height: 184px;
}

input:focus,
select:focus,
textarea:focus,
button:focus,
a:focus {
  outline: 3px solid rgba(37, 99, 235, 0.18);
  outline-offset: 2px;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.check input {
  width: 18px;
  min-height: 18px;
}

.result {
  margin-top: 18px;
  color: var(--text);
}

.result strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
  color: var(--primary);
}

.narrow { max-width: 520px; }

.pagina-cabecalho { margin-bottom: 18px; }

.admin-layout {
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  gap: 18px;
  min-height: calc(100vh - 170px);
}

.case-list {
  padding: 0;
  overflow: hidden;
}

.side-head,
.painel-cabecalho {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid #e2e8f0;
}

.side-head h2 { font-size: 22px; margin-bottom: 0; }

.filters {
  padding: 14px 18px;
  border-bottom: 1px solid #e2e8f0;
}

.case-row {
  display: grid;
  gap: 7px;
  padding: 15px 18px;
  border-bottom: 1px solid #e2e8f0;
  cursor: pointer;
  transition: 0.2s ease;
}

.case-row:hover,
.case-row.active { background: var(--surface-soft); }

.case-row strong {
  color: var(--text);
  font-size: 14px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  padding: 3px 9px;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  width: fit-content;
}

.case-detail {
  min-height: 480px;
  padding: 0;
  overflow: hidden;
}

.case-detail.empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  padding: 24px;
}

.case-view {
  padding: 20px;
  display: grid;
  gap: 16px;
}

.message {
  padding: 14px 16px;
  background: var(--surface);
  white-space: pre-wrap;
  box-shadow: none;
}

.message h2 { margin-top: 8px; }

.danger { color: var(--danger); }

@media (max-width: 960px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 18px;
  }

  .topbar-acoes { justify-content: flex-start; }

  .layout-formulario,
  .admin-layout { grid-template-columns: 1fr; }

  .intro-box { position: static; }
}

@media (max-width: 680px) {
  .container-principal { width: min(100% - 22px, 1380px); }

  .topbar h1 { font-size: 23px; }

  .topbar-logo { width: 46px; height: 46px; }

  .topbar-acoes .btn-topo {
    width: 100%;
    justify-content: center;
  }

  .cards-resumo,
  .grid.two { grid-template-columns: 1fr; }

  .painel-box { padding: 18px; }

  .intro-box h2,
  .pagina-cabecalho h2 { font-size: 23px; }

  .privacy-overview {
    grid-template-columns: 1fr;
  }

  .privacy-copy {
    position: static;
  }

  .privacy-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .privacy-row > span {
    width: fit-content;
    min-width: 0;
  }
}

.formulario-header {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
}

.formulario-header h2 {
  margin: 8px 0 6px;
  color: var(--text);
  font-size: 24px;
  line-height: 1.15;
  font-weight: 800;
}

.formulario-header p {
  margin: 0;
  color: var(--muted);
}
