/* ==========================================================================
   ADMINSEG — Design System
   Tokens, reset, base e utilitários. Mobile-first.
   ========================================================================== */

:root {
  /* --- Cores institucionais --- */
  --c-yellow: #F8E934;
  --c-yellow-deep: #E6D617;     /* hover/contraste do amarelo */
  --c-blue: #3E3F84;            /* azul institucional */
  --c-blue-deep: #2A2B5C;       /* seções escuras / gradiente */
  --c-blue-darker: #1E1F45;     /* fundo mais profundo */
  --c-white: #FFFFFF;
  --c-offwhite: #F6F6FB;        /* seções alternadas */
  --c-gray-text: #5B5C72;       /* parágrafos */
  --c-gray-soft: #8A8B9C;       /* textos de apoio leves */
  --c-border: #E6E6F0;

  /* --- Gradientes de marca --- */
  --grad-hero: linear-gradient(135deg, var(--c-blue-deep) 0%, var(--c-blue) 100%);
  --grad-brand: linear-gradient(135deg, var(--c-yellow) 0%, var(--c-blue) 140%);

  /* --- Tipografia --- */
  --font-title: 'Sora', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  /* Escala fluida de títulos (clamp = mobile→desktop sem media query) */
  --fs-hero: clamp(2.2rem, 6vw, 4rem);
  --fs-h1: clamp(2rem, 5vw, 3.25rem);
  --fs-h2: clamp(1.6rem, 4vw, 2.5rem);
  --fs-h3: clamp(1.25rem, 2.5vw, 1.6rem);
  --fs-body: clamp(1rem, 1.2vw, 1.0625rem);
  --fs-small: 0.875rem;

  /* --- Espaçamento --- */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;
  --sp-9: 6rem;

  /* Padding vertical de seção (fluido) */
  --section-y: clamp(3.5rem, 8vw, 7rem);

  /* --- Layout --- */
  --container: 1200px;
  --container-narrow: 820px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);

  /* --- Bordas e raios --- */
  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  /* --- Sombras --- */
  --shadow-sm: 0 2px 8px rgba(42, 43, 92, 0.06);
  --shadow: 0 8px 30px rgba(42, 43, 92, 0.10);
  --shadow-lg: 0 20px 50px rgba(42, 43, 92, 0.16);

  /* --- Header --- */
  --header-h: 76px;

  /* --- Transições --- */
  --t-fast: 0.18s ease;
  --t: 0.28s ease;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* --- Z-index --- */
  --z-header: 1000;
  --z-drawer: 1100;
  --z-float: 900;
}

/* ==========================================================================
   Reset
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--c-gray-text);
  background: var(--c-white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; height: auto; }

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

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }

ul, ol { list-style: none; }

/* elementos com o atributo hidden somem mesmo quando o componente define display */
[hidden] { display: none !important; }

h1, h2, h3, h4 {
  font-family: var(--font-title);
  color: var(--c-blue);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.02em;
  /* evita palavra orfa sozinha na ultima linha */
  text-wrap: balance;
}

:focus-visible { outline: 3px solid var(--c-blue); outline-offset: 2px; border-radius: 4px; }

/* Respeita usuários que reduzem movimento */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    /* sem isto, animacoes infinitas (carrossel) rodam 1000x/segundo
       no iPhone com "Reduzir Movimento" ativo */
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Layout utilitários
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--section-y); }
.section--dark { background: var(--grad-hero); color: rgba(255,255,255,0.86); }
.section--dark h1, .section--dark h2, .section--dark h3 { color: var(--c-white); }
.section--alt { background: var(--c-offwhite); }

/* Título de seção padrão */
.section-head { max-width: 640px; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.section-head--center { margin-inline: auto; text-align: center; }
.eyebrow {
  display: inline-block;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: var(--fs-small);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-blue);
  margin-bottom: var(--sp-3);
}
.section--dark .eyebrow { color: var(--c-yellow); }
.eyebrow::before { content: ""; display: inline-block; width: 22px; height: 2px; background: var(--c-yellow); vertical-align: middle; margin-right: 10px; }

.section-title { font-size: var(--fs-h2); margin-bottom: var(--sp-4); text-wrap: balance; }
.section-title .hl { color: var(--c-yellow); -webkit-text-fill-color: var(--c-yellow); }
.section--dark .section-title .hl { color: var(--c-yellow); }
.section-lead { font-size: var(--fs-body); color: var(--c-gray-text); text-wrap: balance; }
p, li { text-wrap: pretty; }
.section--dark .section-lead { color: rgba(255,255,255,0.8); }

/* Grid helper */
.grid { display: grid; gap: clamp(1rem, 2.5vw, 1.75rem); }
@media (min-width: 640px)  { .grid--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px)  { .grid--3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px)  { .grid--4 { grid-template-columns: repeat(4, 1fr); } }

/* Visualmente escondido mas acessível (screen readers) */
.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;
}

/* Reveal on scroll (controlado por main.js) */
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out); }
[data-reveal].is-visible { opacity: 1; transform: none; }
