/* ============================================================================
   Geodia — Design System (ds.css)
   Marca: Geodia (ADR 0011). Tema CLARO "blueprint": navy + ciano, fonte Inter.
   Tokens de marca --purple/--blue/--grad mantêm o NOME (retrocompat com todas as
   telas) mas agora carregam o navy/ciano do blueprint. Re-skin = trocar aqui.
   Servido como estático: <link rel="stylesheet" href="/static/ds.css">
   ========================================================================== */

/* ---- 1. Tokens ----------------------------------------------------------- */
:root {
  /* Marca (blueprint navy→ciano). Nomes legados p/ retrocompat. */
  --grad: linear-gradient(135deg, #123a63 0%, #1f9cf0 100%);
  --purple: #1682c9;   /* acento/links — ciano-azul com contraste AA sobre branco */
  --blue: #1f9cf0;     /* ciano vivo — realces/gradiente */
  --navy: #0e2a47;     /* azul-marinho de planta técnica */
  --cyan: #1f9cf0;

  /* Superfícies (claro/blueprint — papel frio) */
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #eef2f6;
  --surface-warm: #f4f6f9;
  --dark: #0e2a47;
  --dark-2: #081d33;

  /* Texto */
  --ink: #0e2a47;     /* títulos / principal (navy) */
  --body: #33475b;    /* corpo */
  --mut: #5a6b7e;     /* secundário */
  --faint: #93a4b6;   /* muted / placeholder */
  --on-dark: #ffffff;

  /* Bordas */
  --line: #dbe3ec;
  --line-strong: #c3cfdb;

  /* Semânticas (AA em texto/ícone sobre claro) */
  --ok: #16a34a;       /* sucesso (verde 600, contraste AA p/ texto) */
  --ok-bg: #f0fdf4;
  --warn: #b45309;     /* aviso (âmbar 700, AA p/ texto) */
  --warn-bg: #fffbeb;
  --err: #dc2626;      /* erro (vermelho 600, >4.5:1) */
  --err-bg: #fef2f2;
  --info: #2563eb;
  --info-bg: #eff6ff;

  /* Escala de espaçamento (4/8/12/16/24/32) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s6: 24px; --s8: 32px;

  /* Raio */
  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-pill: 999px;

  /* Escala tipográfica */
  --fs-xs: .72rem; --fs-sm: .82rem; --fs-base: .92rem; --fs-md: 1.02rem;
  --fs-lg: 1.2rem; --fs-xl: 1.45rem; --fs-2xl: 1.85rem;

  /* Sombra */
  --shadow: 0 1px 3px rgba(15,23,42,.08), 0 1px 2px rgba(15,23,42,.04);
  --shadow-md: 0 4px 14px rgba(15,23,42,.10);
  --shadow-lg: 0 12px 34px rgba(15,23,42,.14);

  /* Foco visível (WCAG AA) */
  --focus-ring: 0 0 0 3px rgba(31,156,240,.42);

  --header-h: 58px;

  /* Tokens PRIVADOS do shell (header/footer): fixos no tema claro, NUNCA
     redefinidos pelas páginas dark (que sobrescrevem --mut/--ink/--line no
     :root delas). Garantem contraste AA do shell sobre o header branco,
     independentemente do tema do corpo da página. Ver ux-02. */
  --sh-ink: #0e2a47;
  --sh-mut: #475569;   /* slate 600 — AA sobre branco */
  --sh-line: #e2e8f0;
}

/* ---- 2. Reset / base ----------------------------------------------------- */
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { color: var(--ink); font-weight: 700; line-height: 1.2; margin: 0 0 var(--s2); }
h1 { font-size: var(--fs-xl); }
h2 { font-size: var(--fs-lg); }
h3 { font-size: var(--fs-md); }
p { margin: 0 0 var(--s3); }
a { color: var(--purple); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { color: var(--ink); font-weight: 600; }
small { font-size: var(--fs-sm); }
img { max-width: 100%; }

/* Foco visível consistente p/ teclado (AA) — só quando navega por teclado. */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--r-sm);
}

/* ---- 3. Layout ----------------------------------------------------------- */
.container { max-width: 1080px; margin: 0 auto; padding: var(--s8) var(--s4) calc(var(--s8) * 1.5); }
.container--narrow { max-width: 760px; }
.eyebrow { /* rótulo de seção: uppercase, roxo, tracking */
  display: inline-block; font-size: var(--fs-xs); font-weight: 700;
  text-transform: uppercase; letter-spacing: .09em; color: var(--purple); margin: 0 0 var(--s2);
}
.lead { color: var(--mut); font-size: var(--fs-base); max-width: 720px; margin: 0 0 var(--s3); }
.help { font-size: var(--fs-sm); color: var(--mut); }
.fineprint { font-size: var(--fs-xs); color: var(--faint); line-height: 1.5; }

.grid { display: grid; gap: var(--s4); }
.grid.cols-1 { grid-template-columns: 1fr; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 820px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
}

.form-row { display: flex; gap: var(--s3); flex-wrap: wrap; }
.form-row > * { flex: 1; min-width: 200px; }

/* Utilitários enxutos (evitam estilo inline) */
.mt-0 { margin-top: 0; } .mt-2 { margin-top: var(--s2); } .mt-3 { margin-top: var(--s3); }
.mt-1 { margin-top: var(--s1); } .mt-4 { margin-top: var(--s4); }
.mt-6 { margin-top: var(--s6); } .mt-8 { margin-top: var(--s8); }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: var(--s2); } .mb-3 { margin-bottom: var(--s3); }
.grow { flex: 1 1 auto; }
.flex-fixed { flex: 0 0 220px; }
.text-center { text-align: center; }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- 4. Header / nav / footer (shell comum — ux-02) ---------------------- */
/* Injetado por /static/shell.js em todas as páginas (fonte única). Usa tokens
   --sh-* (privados, sempre claros) p/ ficar legível mesmo sobre páginas dark. */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: var(--s3);
  height: var(--header-h); padding: 0 var(--s4);
  background: rgba(255,255,255,.94); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--sh-line);
  /* fixa a fonte do shell mesmo sobre páginas dark ainda em system-ui */
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.site-header .brand { display: inline-flex; align-items: center; gap: var(--s2); text-decoration: none; }
.site-header .brand .brand-mark {
  width: 32px; height: 32px; border-radius: 8px; background: var(--grad);
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  box-shadow: 0 4px 12px rgba(31,156,240,.30);
}
.site-header .brand .brand-name {
  font-weight: 800; font-size: 1.12rem; letter-spacing: -.02em; color: var(--sh-ink);
}
.site-header .brand .brand-name b { font-weight: 900; }
.site-nav { display: flex; align-items: center; gap: var(--s4); }
.site-nav a { color: var(--sh-mut); font-size: var(--fs-sm); font-weight: 500; }
.site-nav a:hover { color: var(--sh-ink); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--purple); font-weight: 700; }
/* o CTA "Entrar" é um <a> DENTRO de .site-nav, então `.site-nav a{color:--sh-mut}` (0,1,1)
   vencia o `.btn-primary{color:#fff}` (0,1,0) → texto slate sobre o gradiente roxo (contraste
   horrível). Restaura o texto claro no botão primário do header (e mantém contraste nos demais). */
.site-nav a.btn-primary { color: var(--on-dark); }
.site-nav a.btn-primary[aria-current="page"] { color: var(--on-dark); }

/* Hambúrguer (mobile). Escondido no desktop; vira X quando aberto. */
.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 4px;
  width: 42px; height: 38px; padding: 0 9px;
  background: var(--surface); border: 1px solid var(--sh-line); border-radius: var(--r-sm);
  cursor: pointer;
}
.nav-toggle-bar { display: block; width: 100%; height: 2px; border-radius: 2px;
  background: var(--sh-ink); transition: transform .18s, opacity .18s; }
.site-header.nav-open .nav-toggle-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.site-header.nav-open .nav-toggle-bar:nth-child(2) { opacity: 0; }
.site-header.nav-open .nav-toggle-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none; position: absolute; top: var(--header-h); right: 0; left: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--sh-line);
    box-shadow: var(--shadow-md); padding: var(--s2) var(--s4) var(--s4);
  }
  .site-header.nav-open .site-nav { display: flex; }
  .site-nav a { padding: 13px 4px; font-size: var(--fs-base); border-bottom: 1px solid var(--sh-line); }
  .site-nav a:last-child { border-bottom: none; }
  .site-nav .btn { margin-top: var(--s3); justify-content: center; }
}

.site-footer {
  border-top: 1px solid var(--sh-line); background: var(--surface);
  color: var(--sh-mut); font-size: var(--fs-sm);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.site-footer .inner { max-width: 1080px; margin: 0 auto; padding: var(--s6) var(--s4); display: flex; flex-wrap: wrap; gap: var(--s6); }
.site-footer a { color: var(--sh-mut); }
.site-footer a:hover { color: var(--sh-ink); }

/* ---- 5. Botões ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  border: 1px solid transparent; border-radius: var(--r-sm);
  padding: 11px 18px; font-size: var(--fs-base); font-weight: 600; font-family: inherit;
  cursor: pointer; text-decoration: none; line-height: 1; transition: filter .15s, box-shadow .15s, background .15s;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }   /* feedback tátil coerente em todos os botões */
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: default; pointer-events: none; transform: none; }
.btn-primary { background: var(--grad); color: var(--on-dark); box-shadow: var(--shadow); }
.btn-primary:hover { filter: brightness(1.07); box-shadow: var(--shadow-md); }
.btn-primary:active { filter: brightness(.97); }
.btn-alt { background: var(--surface); color: var(--purple); border-color: var(--line-strong); }
.btn-alt:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--mut); border-color: var(--line); }
.btn-ghost:hover { color: var(--ink); background: var(--surface-2); }
.btn-sm { padding: 7px 12px; font-size: var(--fs-sm); }
.btn-block { display: flex; width: 100%; }

/* ---- 6. Cards ------------------------------------------------------------ */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: var(--s6); box-shadow: var(--shadow);
}
.card--flush { padding: 0; overflow: hidden; }
/* Card clicável (a.card-link): vira link de navegação com hover e título destacado (ux-06). */
a.card-link { display: block; text-decoration: none; color: inherit;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
a.card-link:hover { border-color: var(--purple); box-shadow: var(--shadow-md); transform: translateY(-2px); }
a.card-link h2, a.card-link h3 { margin: var(--s2) 0; color: var(--ink); }
@media (prefers-reduced-motion: reduce) { a.card-link:hover { transform: none; } }

/* ---- 7. Plano (cartões de preço) ----------------------------------------- */
.plan { display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s6); box-shadow: var(--shadow); }
.plan--featured { border-color: var(--purple); box-shadow: 0 0 0 1px var(--purple) inset, var(--shadow-md); }
.plan .plan-name { font-size: var(--fs-md); font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: var(--s2); }
.plan .plan-price { margin: var(--s3) 0 var(--s1); font-size: var(--fs-2xl); font-weight: 800; color: var(--ink); }
.plan .plan-price small { font-size: var(--fs-sm); color: var(--mut); font-weight: 400; }
.plan .plan-sub { color: var(--mut); font-size: var(--fs-sm); min-height: 2.4em; }
.plan ul { list-style: none; padding: 0; margin: var(--s4) 0 var(--s6); flex: 1; }
.plan li { font-size: var(--fs-sm); padding: 7px 0; border-bottom: 1px solid var(--line); display: flex; gap: var(--s2); line-height: 1.35; }
.plan li:last-child { border-bottom: none; }
.plan li .ic { color: var(--ok); flex: none; font-weight: 700; }
.plan li .ic.no { color: var(--faint); }

/* ---- 8. Formulários ------------------------------------------------------ */
.label { display: block; font-size: var(--fs-xs); color: var(--mut); text-transform: uppercase; letter-spacing: .05em; margin: 0 0 var(--s1); font-weight: 600; }
input, select, textarea {
  width: 100%; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  padding: 10px 12px; font-size: var(--fs-base); font-family: inherit;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--purple); box-shadow: var(--focus-ring); }
textarea { resize: vertical; min-height: 64px; }

/* ---- 9. Badges / chips --------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; padding: 3px 9px; border-radius: var(--r-pill); }
.badge--brand { background: var(--grad); color: var(--on-dark); }
.badge--ok { background: var(--ok-bg); color: var(--ok); }
.badge--info { background: var(--info-bg); color: var(--info); }
.badge--muted { background: var(--surface-2); color: var(--mut); }
.chip { display: inline-block; font-size: var(--fs-sm); padding: 4px 10px; border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--body); border: 1px solid var(--line); }

/* ---- 9b. Avatar (componente canônico — Fase 1 do design system) ---------- */
/* Uso: <span class="gd-avatar">MR</span> (inicial) ou com <img>. Modificadores de tamanho/cor. */
.gd-avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 40px; height: 40px; border-radius: var(--r); overflow: hidden;
  background: var(--grad); color: var(--on-dark); font-weight: 800; font-size: var(--fs-base);
  line-height: 1; letter-spacing: -.01em;
}
.gd-avatar img { width: 100%; height: 100%; object-fit: cover; }
/* logo real (favicon) sobre as iniciais — contain + fundo branco, cai p/ iniciais no onerror */
.gd-avatar--logo { background: #fff; border: 1px solid var(--line); color: #64748b; position: relative; }
.gd-avatar--logo img { position: absolute; inset: 0; object-fit: contain; padding: 6px; background: #fff; }
.gd-avatar--sm { width: 32px; height: 32px; font-size: var(--fs-sm); border-radius: var(--r-sm); }
.gd-avatar--lg { width: 48px; height: 48px; font-size: var(--fs-md); }
.gd-avatar--soft { background: var(--surface-2); color: var(--purple); }   /* feed/atividade */

/* ---- 9c. Medalha / conquista (gamificação — distinta do .badge uppercase) - */
.gd-medal {
  display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 700;
  padding: 5px 11px; border-radius: var(--r-pill); background: var(--info-bg); color: var(--info);
  border: 1px solid transparent; line-height: 1.1;
}
.gd-medal svg { width: 13px; height: 13px; flex: none; }
.gd-medal--gold { background: #fff7e6; color: #b45309; }   /* pioneiro / marcos raros */

/* ---- 9d. Selo de confiança (procedência do dado da empresa) -------------- */
.gd-selo {
  display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-xs); font-weight: 700;
  padding: 3px 10px; border-radius: var(--r-pill); white-space: nowrap;
}
.gd-selo svg { width: 12px; height: 12px; flex: none; }
.gd-selo--reivindicada { background: rgba(13,148,136,.12); color: #0d9488; }
.gd-selo--enriquecida  { background: var(--info-bg); color: var(--info); }
.gd-selo--basica       { background: var(--surface-2); color: var(--mut); }

/* ---- 9e. Chip de filtro/toggle canônico (padrão go-forward) --------------- */
.gd-chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-sm); font-weight: 600;
  padding: 7px 12px; border-radius: var(--r-pill); background: var(--surface); color: var(--body);
  border: 1px solid var(--line); cursor: pointer; line-height: 1.2; white-space: nowrap;
  font-family: inherit; transition: border-color .15s, color .15s, background .15s;
}
.gd-chip:hover { border-color: var(--purple); color: var(--purple); }
.gd-chip.is-active { background: var(--grad); color: var(--on-dark); border-color: transparent; }

/* ---- 10. Tabela (com modo responsivo → cards via data-label) ------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
table.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); background: var(--surface); }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table th { color: var(--mut); font-weight: 600; text-transform: uppercase; font-size: var(--fs-xs); letter-spacing: .04em; }
.table tbody tr:hover { background: var(--surface-2); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  /* Linhas viram cards; cada célula mostra o rótulo via data-label */
  .table.table--cards thead { position: absolute; left: -9999px; }
  .table.table--cards tr { display: block; border: 1px solid var(--line); border-radius: var(--r); margin-bottom: var(--s3); padding: var(--s2); }
  .table.table--cards td { display: flex; justify-content: space-between; gap: var(--s4); border: none; padding: 6px 8px; }
  .table.table--cards td::before { content: attr(data-label); color: var(--mut); font-weight: 600; font-size: var(--fs-xs); text-transform: uppercase; }
  .table.table--cards td.num { text-align: right; }
}

/* ---- 11. Banners / mensagens (aria-live) --------------------------------- */
.banner { border-radius: var(--r); padding: 12px 14px; font-size: var(--fs-sm); border: 1px solid; }
.banner--warn { background: var(--warn-bg); color: var(--warn); border-color: #fcd9a5; }
.banner--info { background: var(--info-bg); color: var(--info); border-color: #bfdbfe; }
.banner--err { background: var(--err-bg); color: var(--err); border-color: #fecaca; }
.msg { font-size: var(--fs-sm); min-height: 1.1em; }
.msg.ok { color: var(--ok); } .msg.err { color: var(--err); }

/* ---- 12. Estados: loading / empty / error -------------------------------- */
.spinner {
  display: inline-block; width: 18px; height: 18px; vertical-align: middle;
  border: 2px solid var(--line-strong); border-top-color: var(--purple);
  border-radius: 50%; animation: ds-spin .7s linear infinite;
}
@keyframes ds-spin { to { transform: rotate(360deg); } }
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, #e9eef5 37%, var(--surface-2) 63%);
  background-size: 400% 100%; animation: ds-shimmer 1.3s ease infinite; border-radius: var(--r-sm);
  min-height: 14px;
}
@keyframes ds-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.state {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s2);
  text-align: center; padding: var(--s8) var(--s4); color: var(--mut); font-size: var(--fs-sm);
}
.state .state-icon { font-size: 1.7rem; line-height: 1; }
.state--error { color: var(--err); }
@media (prefers-reduced-motion: reduce) {
  .spinner, .skeleton { animation: none; }
}

/* ---- 13. Drawer / modal (focus-trap aplicado em JS na ux-04) -------------- */
.overlay {
  position: fixed; inset: 0; z-index: 60; background: rgba(15,23,42,.45);
  display: flex; opacity: 0; pointer-events: none; transition: opacity .18s;
}
.overlay.open { opacity: 1; pointer-events: auto; }
.drawer {
  margin-left: auto; height: 100%; width: min(440px, 92vw);
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg);
  transform: translateX(100%); transition: transform .2s ease; overflow-y: auto; padding: var(--s6);
}
.overlay.open .drawer { transform: translateX(0); }
.modal {
  margin: auto; width: min(440px, 92vw); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  transform: scale(.96); transition: transform .18s ease; padding: var(--s6);
}
.overlay.open .modal { transform: scale(1); }
.drawer-close, .modal-close {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm);
  width: 32px; height: 32px; cursor: pointer; color: var(--mut); font-size: 1.1rem; line-height: 1;
}
.drawer-close:hover, .modal-close:hover { color: var(--ink); }
