/* ===========================================================
   ADVIZE · Design System
   Sem build: CSS puro, tokens em custom properties.

   Esta é a ÚNICA fonte de cor da plataforma. assets/styles.css
   é o layout da aplicação e consome os tokens daqui; nenhuma
   tela define paleta própria.

   Proporção de cor perseguida: ~80% branco/neutro, ~15% navy,
   ~5% azul da marca. A cor cria hierarquia; não decora.
   =========================================================== */

:root{
  /* --- marca ADVIZE (amostrada dos arquivos oficiais) --- */
  --brand-primary:   #151A2E;   /* navy — fundo escuro e texto sobre claro */
  --brand-primary-2: #1E2542;   /* hover de superfícies navy */
  --brand-accent:    #2B3FD4;   /* azul da marca, sobre fundo claro */
  --brand-accent-2:  #5B6BF2;   /* azul claro, sobre fundo escuro */
  /* Recorte das formas internas do símbolo. Muda só quando a marca é posta
     sobre uma superfície que não é branca nem navy. */
  --brand-knockout:  #ffffff;

  /* --- superfícies --- */
  --background:       #ffffff;
  --surface:          #fafafc;
  --surface-elevated: #ffffff;
  --surface-sunken:   #f8f9fc;

  /* --- texto --- */
  --foreground:  #151743;
  --muted:       #667085;
  --muted-soft:  #98a2b3;
  --on-brand:    #ffffff;
  /* O accent deixou de ser um ciano claro e virou o azul da ADVIZE: texto
     sobre ele passou a ser branco. Escuro sobre #2B3FD4 ficaria em 2.3:1. */
  --on-accent:   #ffffff;

  /* --- traços --- */
  --border:        rgba(21, 23, 67, .08);
  --border-strong: rgba(21, 23, 67, .14);

  /* --- semânticas --- */
  --success: #16a34a;
  --warning: #f59e0b;
  --danger:  #dc2626;

  /* --- raio --- */
  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-xl:   24px;
  --r-pill: 9999px;

  /* --- elevação. Nunca preto: navy diluído mantém a sombra
         dentro da paleta e evita o cinza sujo. --- */
  --shadow-sm:  0 2px 8px   rgba(21, 23, 67, .04);
  --shadow-md:  0 10px 40px rgba(21, 23, 67, .08);
  --shadow-lg:  0 20px 60px rgba(21, 23, 67, .10);
  --shadow-hov: 0 24px 70px rgba(21, 23, 67, .14);
  --glow:       0 0 0 1px rgba(57, 197, 243, .18), 0 8px 32px rgba(57, 197, 243, .12);

  /* --- tipografia ---
     Estes dois nomes também existem em styles.css, com valores
     idênticos. A sobreposição é deliberada: são as fontes da marca,
     e manter o mesmo nome faz a migração progressiva do tema escuro
     acontecer sem renomear nada. Se um dia divergirem, este arquivo
     vence em app.html (carrega depois) — mantenha-os em sincronia. */
  --font-ui:   'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-head: 'Sora', var(--font-ui);

  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ===================== superfície clara ===================== */
.ds{
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* Rede de segurança contra rolagem horizontal: elemento decorativo
     que escape da largura é aparado, não vira barra de rolagem. `clip`
     em vez de `hidden` porque não cria contêiner de rolagem — o
     position:sticky do cabeçalho continua funcionando. */
  overflow-x: clip;
}

/* Os dois gradientes do brief. Quase imperceptíveis: dão
   profundidade sem virar "fundo colorido". */
.ds-canvas{
  position: relative;
  isolation: isolate;
}
.ds-canvas::before{
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 88% -6%,  rgba(57, 197, 243, .10), transparent 38%),
    radial-gradient(circle at -6% 92%,  rgba(21, 23, 67, .055), transparent 42%);
}

/* ===================== tipografia ===================== */
.ds h1, .ds h2, .ds h3{
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--foreground);
  letter-spacing: -.02em;
  margin: 0;
  text-wrap: balance;
}
.ds h1{ font-size: clamp(2.25rem, 1.2rem + 4.2vw, 4rem);   line-height: 1.06; }
.ds h2{ font-size: clamp(1.75rem, 1.1rem + 2.4vw, 2.5rem); line-height: 1.14; }
.ds h3{ font-size: clamp(1.25rem, 1rem + .9vw, 1.75rem);   line-height: 1.24; }
.ds p{ margin: 0; color: var(--muted); }

.ds-lead{ font-size: clamp(1rem, .95rem + .35vw, 1.125rem); max-width: 62ch; }
.ds-small{ font-size: .875rem; }
.ds-eyebrow{
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.ds-accent{ color: var(--brand-accent); }
.ds-strong{ color: var(--foreground); font-weight: 600; }

/* ===================== estrutura ===================== */
.ds-container{
  width: min(1180px, 100% - 2.5rem);
  margin-inline: auto;
}
.ds-section{ padding: clamp(3.5rem, 8vw, 7rem) 0; }
.ds-section-head{
  max-width: 60ch;
  margin-bottom: clamp(2rem, 4vw, 3.25rem);
  display: grid;
  gap: .875rem;
}
.ds-grid{ display: grid; gap: 1.25rem; }
.ds-grid-2{ grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.ds-grid-3{ grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.ds-grid-4{ grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }

/* ===================== cartões ===================== */
.ds-card{
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .28s var(--ease), transform .28s var(--ease),
              border-color .28s var(--ease);
}
.ds-card-hover:hover{
  transform: translateY(-3px);
  box-shadow: var(--shadow-hov);
  border-color: var(--border-strong);
}

/* Glass é detalhe premium, não revestimento geral: usar só em
   componentes estratégicos (cartões flutuantes, card de login). */
.ds-glass{
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
}

/* ===================== botões ===================== */
.ds-btn{
  --btn-bg: var(--brand-primary);
  --btn-fg: var(--on-brand);
  --btn-bd: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 2.875rem;          /* área de toque confortável */
  padding: .75rem 1.5rem;
  border: 1px solid var(--btn-bd);
  border-radius: var(--r-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: 500 .9375rem/1 var(--font-ui);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s var(--ease), box-shadow .2s var(--ease),
              transform .12s var(--ease), border-color .2s var(--ease);
}
.ds-btn:hover{ --btn-bg: var(--brand-primary-2); box-shadow: var(--shadow-md); }
.ds-btn:active{ transform: scale(.98); }
.ds-btn:focus-visible{
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
}
.ds-btn[disabled], .ds-btn[aria-disabled="true"]{
  opacity: .55; cursor: not-allowed; transform: none; box-shadow: none;
}

.ds-btn-accent{ --btn-bg: var(--brand-accent); --btn-fg: var(--on-accent); }
.ds-btn-accent:hover{ --btn-bg: var(--brand-accent-2); box-shadow: var(--glow); }

.ds-btn-secondary{
  --btn-bg: var(--surface-elevated);
  --btn-fg: var(--foreground);
  --btn-bd: var(--border-strong);
}
.ds-btn-secondary:hover{ --btn-bg: var(--surface); }

.ds-btn-ghost{ --btn-bg: transparent; --btn-fg: var(--foreground); }
.ds-btn-ghost:hover{ --btn-bg: rgba(21, 23, 67, .05); box-shadow: none; }

.ds-btn-block{ width: 100%; }
.ds-btn-lg{ min-height: 3.25rem; padding: .9375rem 2rem; font-size: 1rem; }

/* ===================== formulário ===================== */
.ds-field{ display: grid; gap: .4375rem; }
.ds-label{
  font-size: .8125rem;
  font-weight: 500;
  color: var(--foreground);
}
.ds-input{
  width: 100%;
  min-height: 2.875rem;
  padding: .75rem .9375rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface-elevated);
  color: var(--foreground);
  font: 400 .9375rem/1.4 var(--font-ui);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.ds-input::placeholder{ color: var(--muted-soft); }
.ds-input:focus{
  outline: none;
  border-color: var(--brand-accent);
  /* anel ciano bem discreto: sinaliza foco sem gritar */
  box-shadow: 0 0 0 3px rgba(57, 197, 243, .2);
}
.ds-input[aria-invalid="true"]{ border-color: var(--danger); }

/* ===================== selos ===================== */
.ds-badge{
  display: inline-flex;
  align-items: center;
  gap: .4375rem;
  padding: .375rem .75rem;
  border-radius: var(--r-pill);
  background: rgba(21, 23, 67, .05);
  border: 1px solid var(--border);
  color: var(--foreground);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .01em;
}
.ds-badge-accent{
  background: rgba(57, 197, 243, .1);
  border-color: rgba(57, 197, 243, .28);
}
.ds-badge-success{ background: rgba(22, 163, 74, .1);  border-color: rgba(22, 163, 74, .25);  color: var(--success); }
.ds-badge-warning{ background: rgba(245, 158, 11, .12); border-color: rgba(245, 158, 11, .3); color: #b45309; }
.ds-badge-danger { background: rgba(220, 38, 38, .09);  border-color: rgba(220, 38, 38, .25);  color: var(--danger); }

/* ===================== ícones ===================== */
/* Lucide: mesmos traçados, inline, sem npm. Herdam currentColor. */
.ds-icon{
  width: 1.25rem; height: 1.25rem;
  flex: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
.ds-icon-lg{ width: 1.5rem; height: 1.5rem; }
.ds-icon-box{
  display: grid;
  place-items: center;
  width: 2.875rem; height: 2.875rem;
  border-radius: var(--r-md);
  background: rgba(21, 23, 67, .05);
  color: var(--brand-primary);
  flex: none;
}
.ds-icon-box-accent{
  background: rgba(57, 197, 243, .12);
  color: #0e7fa8;                 /* ciano escurecido: contraste AA sobre o box claro */
}

/* ===================== marca ADVIZE =====================
   Estilo do componente BrandLogo (assets/brand.js). A variante nasce de UMA
   classe — .brand-light ou .brand-dark — e nada mais na aplicação decide cor
   de marca. Foi o que resolveu a logo sumindo em fundo branco: a decisão
   passou a existir num lugar só.

   O símbolo herda currentColor; por isso o mesmo desenho serve às duas
   superfícies, sem um segundo arquivo. */
.brand{
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
  line-height: 1;
}
.brand .brand-mark{
  height: 1.5rem;
  width: auto;
  display: block;
  flex: none;
}
.brand-word{
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: -.01em;
}

/* --- sobre fundo claro: símbolo no azul da marca, palavra em navy --- */
.brand-light{ color: var(--brand-accent); --brand-knockout: #ffffff; }
.brand-light .brand-word{ color: var(--brand-primary); }

/* --- sobre fundo escuro: símbolo no azul claro, palavra quase branca --- */
.brand-dark{ color: var(--brand-accent-2); --brand-knockout: #ffffff; }
.brand-dark .brand-word{ color: #F4F6FF; }

.brand-sm .brand-mark{ height: 1.125rem; }
.brand-sm .brand-word{ font-size: .9375rem; }
.brand-lg .brand-mark{ height: 2.25rem; }
.brand-lg .brand-word{ font-size: 1.625rem; }
.brand-only{ gap: 0; }

/* ===================== separador ===================== */
.ds-separator{
  height: 1px;
  border: 0;
  background: var(--border);
  margin: 0;
}

/* ===================== movimento ===================== */
@keyframes fadeSlideIn{
  from{ opacity: 0; transform: translateY(20px); }
  to  { opacity: 1; transform: translateY(0); }
}
.animate-fade-slide-in-1,
.animate-fade-slide-in-2,
.animate-fade-slide-in-3,
.animate-fade-slide-in-4,
.animate-fade-slide-in-5{
  opacity: 0;
  animation: fadeSlideIn .7s var(--ease) forwards;
}
.animate-fade-slide-in-1{ animation-delay: .05s; }
.animate-fade-slide-in-2{ animation-delay: .16s; }
.animate-fade-slide-in-3{ animation-delay: .27s; }
.animate-fade-slide-in-4{ animation-delay: .38s; }
.animate-fade-slide-in-5{ animation-delay: .49s; }

/* Entrada por rolagem, ligada por IntersectionObserver. Sem JS,
   o conteúdo aparece normalmente — nunca fica invisível. */
.ds-reveal{ opacity: 0; transform: translateY(20px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.ds-reveal.is-in{ opacity: 1; transform: none; }

@keyframes dsPulse{
  0%, 100%{ opacity: .35; transform: scale(1); }
  50%     { opacity: .9;  transform: scale(1.12); }
}

/* Respeita quem pediu menos movimento no sistema operacional. */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .ds-reveal{ opacity: 1; transform: none; }
}

/* ===================== acessibilidade ===================== */
.ds-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;
}
.ds-skip{
  position: absolute; left: .75rem; top: -4rem;
  z-index: 100;
  background: var(--brand-primary); color: var(--on-brand);
  padding: .75rem 1.25rem; border-radius: var(--r-md);
  text-decoration: none;
  transition: top .2s var(--ease);
}
.ds-skip:focus{ top: .75rem; }
