/* ─────────────────────────────────────────────────────────────────────
 * Previanest · Design Tokens
 * Espelhamento direto de DesignSystem.swift (AppSpacing/AppFont/AppRadius)
 * + paleta navy/gold do site institucional.
 *
 * 🚨 REGRA ZERO — ANTI-BORDA (PRIORITÁRIA E INEGOCIÁVEL):
 * Nenhum texto pode encostar nas bordas laterais de um container.
 * Mínimo 18–24px de padding horizontal SEMPRE.
 * ───────────────────────────────────────────────────────────────────── */

:root {
    /* ── Spacing tokens (iOS pt = web px na escala 1×) ─────────────── */
    --sp-1: 4px;    /* xxs · micro respiro entre ícone e texto */
    --sp-2: 8px;    /* xs  · elementos relacionados */
    --sp-3: 12px;   /* sm  · linha (hstack) */
    --sp-4: 16px;   /* md  · seções vizinhas */
    --sp-5: 20px;   /* lg  · padding lista */
    --sp-6: 22px;   /* xl  · padding card */
    --sp-7: 24px;   /* xxl · REGRA ZERO — header/gradiente full-bleed */
    --sp-8: 28px;   /* xxxl · disclaimers */
    --sp-9: 32px;   /* huge · vertical de header proeminente */

    /* ── Border radius ────────────────────────────────────────────── */
    --r-pill: 999px;
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 14px;
    --r-xl: 20px;

    /* ── Tipografia ───────────────────────────────────────────────── */
    --fs-xs: 12px;
    --fs-sm: 13px;
    --fs-body: 14px;
    --fs-body-md: 15px;
    --fs-title-sm: 17px;
    --fs-title-md: 18px;
    --fs-title-lg: 24px;
    --fs-display: 26px;

    --lh-tight: 1.25;
    --lh-base: 1.5;
    --lh-relaxed: 1.7;

    /* ── Famílias tipográficas ────────────────────────────────────── */
    --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
    --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

    /* ── Paleta clínica (espelha Color.appPrimary etc. no iOS) ────── */
    --c-primary: #2167a1;          /* appPrimary  — azul clínico */
    --c-primary-soft: #f2f8ff;     /* appSecondary */
    --c-accent: #339ad8;           /* appAccent — gradiente */
    --c-alert: #d93333;            /* appAlert */
    --c-success: #33b373;          /* appSuccess */

    /* Tipos de anestesia (do mapAnestesia em Models.swift) */
    --c-geral: #1e5fa0;
    --c-neuroeixo: #1a7a6e;
    --c-locorregional: #2a6e8a;
    --c-sedacao: #5b3fa0;

    /* ── Paleta institucional (site/landing) ──────────────────────── */
    --navy-900: #0a1f3d;
    --navy-800: #0e2a52;
    --navy-700: #14365e;
    --navy-600: #1e456e;
    --gold: #c9a961;
    --gold-light: #dec287;
    --gold-dark: #a88a47;
    --steel: #2C5A8C;
    --steel-soft: #E3ECF6;
    --mist: #DCE7F4;
    --ivory: #E9EFF8;
    --paper: #ffffff;
    --ink: #14233a;
    --ink-soft: #3d4757;
    --line: rgba(30, 69, 110, 0.16);
    --warning: #b5594b;

    /* ── Gradientes reutilizáveis ─────────────────────────────────── */
    --grad-primary: linear-gradient(135deg, var(--c-primary) 0%, var(--c-accent) 100%);
    --grad-navy: linear-gradient(160deg, #0d1f3c 0%, var(--navy-700) 45%, #1a4a6e 100%);
    --grad-hero: linear-gradient(135deg, var(--c-primary), var(--c-accent));

    /* ── Sombras ──────────────────────────────────────────────────── */
    --shadow-sm: 0 2px 8px rgba(20, 35, 58, 0.06);
    --shadow-md: 0 6px 20px rgba(20, 35, 58, 0.10);
    --shadow-lg: 0 16px 48px rgba(20, 35, 58, 0.16);
    --shadow-hero: 0 8px 26px rgba(33, 103, 161, 0.40);

    /* ── Easing ───────────────────────────────────────────────────── */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

    /* ── Largura de leitura ───────────────────────────────────────── */
    --max-content: 1180px;
    --max-text: 720px;

    /* ── Z-index ──────────────────────────────────────────────────── */
    --z-nav: 50;
    --z-overlay: 80;
    --z-modal: 100;
    --z-toast: 120;
}

/* ── Reset minimalista ─────────────────────────────────────────────── */
*,
*::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: var(--lh-relaxed);
    color: var(--ink);
    background: var(--ivory);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

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

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

a {
    color: var(--navy-700);
    text-decoration: none;
    transition: color 0.2s var(--ease-out);
}

a:hover {
    color: var(--gold-dark);
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: var(--lh-tight);
}

/* Acessibilidade — respeita usuários que pedem menos animação. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
