/* ==========================================================================
   TeMostra - tokens do Design System (arquivo único, pronto para produção)

   Linkado em index.php, painel.php e p.php (dentro do <head>, antes do
   <style> de cada um). apresentacao.html usa o caminho relativo
   aplicativo/assets/temostra-tokens.css.

   Fases 1-3 do APLICAR.md já aplicadas nesses 4 arquivos, incluindo a
   migração final dos nomes antigos (--primary-orange, --verde, --borda, ...)
   para os tokens --tm-*: o bloco COMPATIBILIDADE que existia aqui não é mais
   necessário e foi removido. admin.php, entrar.php e clientes.php têm seu
   próprio :root local (fora do escopo deste arquivo) e não são afetados.
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap");

/* ============ tokens/colors.css ============ */
/* ---------- TeMostra colors ----------
   Two brand colors and nothing else: blue for structure and text, orange for
   action. Everything neutral is one of those two at low alpha - the product
   never declares a gray. Muted text is the blue at reduced opacity, never a
   lighter blue. */
:root {
  /* Base - brand */
  --tm-blue: #223977;
  --tm-blue-light: #3a5a9e;
  --tm-blue-deep: #16264f;        /* only in the investor-deck cover gradient */
  --tm-orange: #f56720;
  --tm-orange-light: #ff8547;

  /* Base - neutrals */
  --tm-white: #ffffff;
  --tm-off-white: #fafafa;
  --tm-field-readonly: #f0f2f8;
  --tm-code-bg: #f0f2f8;
  --tm-quote-bg: #f5f6fb;
  --tm-ink: #24292f;              /* long-form document body text */
  --tm-ink-soft: #57606a;

  /* Base - semantic hues */
  /* ONE green. #1a7f37 is the only green in the system: it is the single value
     that works as a fill (toggle on, status dot), as a 12%-alpha wash, AND as
     text on white (4.9:1 - passes AA). The older #10b981 and #0b7d5c are
     retired; do not reintroduce them. */
  --tm-green: #1a7f37;
  --tm-red: #b3261e;
  --tm-red-bright: #ef4444;
  --tm-amber-text: #9a6700;
  --tm-whatsapp: #25d366;

  /* Base - gamification (coins, PRO/upgrade outline) */
  --tm-gold: #d4af37;
  --tm-gold-pale: #fff3c4;
  --tm-coin-from: #fff3d6;
  --tm-coin-to: #ffe3ad;
  --tm-coin-border: #f0c96b;
  --tm-coin-text: #8a6110;

  /* Alpha washes - the whole neutral system */
  --tm-borda: rgba(34, 57, 119, 0.10);
  --tm-borda-campo: rgba(34, 57, 119, 0.18);
  --tm-borda-forte: rgba(34, 57, 119, 0.30);
  --tm-borda-botao: rgba(34, 57, 119, 0.16);
  --tm-fundo-suave: rgba(34, 57, 119, 0.06);
  --tm-fundo-th: rgba(34, 57, 119, 0.05);
  --tm-laranja-suave: rgba(245, 103, 32, 0.08);
  --tm-laranja-selecionado: rgba(245, 103, 32, 0.10);
  --tm-laranja-borda: rgba(245, 103, 32, 0.35);
  --tm-verde-suave: rgba(26, 127, 55, 0.10);
  --tm-verde-borda: rgba(26, 127, 55, 0.30);
  --tm-vermelho-suave: rgba(179, 38, 30, 0.07);
  --tm-vermelho-borda: rgba(179, 38, 30, 0.35);

  /* ---------- Semantic aliases ---------- */
  --text-body: var(--tm-blue);
  --text-invert: var(--tm-white);
  --text-accent: var(--tm-orange);
  --text-doc: var(--tm-ink);
  --text-help: var(--tm-ink-soft);

  --surface-page: var(--tm-off-white);
  --surface-card: var(--tm-white);
  --surface-sunken: var(--tm-off-white);
  --surface-hero: var(--tm-blue);
  --surface-field: var(--tm-white);
  --surface-field-disabled: var(--tm-field-readonly);

  --border-hairline: var(--tm-borda);
  --border-field: var(--tm-borda-campo);
  --border-strong: var(--tm-borda-forte);

  --accent: var(--tm-orange);
  --accent-hover: var(--tm-blue);   /* primary buttons darken TO blue on hover */
  --accent-soft: var(--tm-laranja-suave);

  --success: var(--tm-green);
  --success-text: var(--tm-green);
  --success-soft: var(--tm-verde-suave);

  /* SWOT / diagnóstico - deliberately reuses colours the brand already owns.
     No new hues: green = strength, amber = weakness, red = risk,
     orange = opportunity (orange is the brand's "act here" colour),
     blue = gap (structural, needs filling). */
  --swot-forcas: var(--tm-green);
  --swot-fraquezas: var(--tm-amber-text);
  --swot-riscos: var(--tm-red);
  --swot-oportunidades: var(--tm-orange);
  --swot-lacunas: var(--tm-blue);
  --warning-text: var(--tm-amber-text);
  --danger: var(--tm-red);
  --danger-soft: var(--tm-vermelho-suave);

  --focus-ring: rgba(245, 103, 32, 0.35);
  --focus-glow: rgba(245, 103, 32, 0.10);

  --hero-overlay: linear-gradient(90deg, rgba(34,57,119,0.94) 0%, rgba(34,57,119,0.82) 48%, rgba(34,57,119,0.25) 100%);
  /* Hero em uma coluna (até 960px): o texto ocupa a largura toda e a parte direita da foto é clara, então o gradiente horizontal não dá contraste. */
  --hero-overlay-mobile: linear-gradient(180deg, rgba(34,57,119,0.94) 0%, rgba(34,57,119,0.88) 100%);
  --capa-overlay: linear-gradient(rgba(0,0,0,0.45), rgba(0,0,0,0.45));
}

/* Client public pages (p.php) are themed per business: the client picks three
   hex values in the panel and they land on these three properties only. Any
   component used inside a client page must read these, not the brand blue. */
.tm-pagina-cliente {
  --pg-fundo: var(--tm-white);
  --pg-texto: var(--tm-blue);
  --pg-destaque: var(--tm-orange);
}

/* ============ tokens/typography.css ============ */
/* ---------- TeMostra typography ----------
   One family: Inter. Section headings pair weight 300 with a weight-700 orange
   <strong> inside the same line ("Por que isso **importa**") - that contrast is
   the brand's signature type move. Body copy runs 1.6; client pages 1.55. */
:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-serif-display: var(--font-sans); /* brand has no serif - alias kept for consumers */

  --fw-light: 300;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-black: 800;
  /* Fluid display sizes, exactly as declared in the product */
  --fs-hero: clamp(2.1rem, 4.4vw, 2.75rem);
  --fs-section: clamp(2.2rem, 4vw, 3rem);
  --fs-deck-cover: clamp(2.2rem, 6vw, 3.2rem);
  --fs-panel-h1: clamp(1.4rem, 4vw, 1.9rem);
  --fs-wizard-q: clamp(1.15rem, 3vw, 1.4rem);
  /* Fixed steps */
  --fs-lead: 1.2rem;      /* section subtitle */
  --fs-hero-sub: 1.03rem;
  --fs-card-title: 1.0625rem;
  --fs-body: 1rem;
  --fs-body-sm: 0.95rem;
  --fs-ui: 0.9rem;
  --fs-label: 0.93rem;
  --fs-nav: 0.875rem;
  --fs-subnav: 0.8125rem;
  --fs-caption: 0.85rem;
  --fs-help: 0.8rem;
  --fs-chip: 0.78rem;
  --fs-badge: 0.7rem;
  --fs-eyebrow: 0.78rem;
  --lh-tight: 1.08;       /* hero h1 */
  --lh-heading: 1.3;
  --lh-body: 1.6;
  --lh-body-pagina: 1.55;
  --lh-dense: 1.45;
  --ls-hero: -1.4px;
  --ls-section: -1px;
  --ls-heading: -0.5px;
  --ls-eyebrow: 1.4px;    /* uppercase kickers */
  --ls-button: 0.3px;
  /* Semantic aliases */
  --type-hero: var(--fw-bold) var(--fs-hero)/var(--lh-tight) var(--font-sans);
  --type-section: var(--fw-light) var(--fs-section)/1.15 var(--font-sans);
  --type-card-title: var(--fw-semibold) var(--fs-card-title)/1.35 var(--font-sans);
  --type-body: var(--fw-regular) var(--fs-body)/var(--lh-body) var(--font-sans);
  --type-button: var(--fw-semibold) var(--fs-body-sm)/1.2 var(--font-sans);
  --type-help: var(--fw-regular) var(--fs-help)/var(--lh-dense) var(--font-sans);
}

/* ============ tokens/spacing.css ============ */
/* ---------- TeMostra spacing & layout ----------
   The panel ships a named 4-step scale (--e1..--e4) and nothing more; marketing
   sections use fluid clamp() paddings. Mobile-first: every hit target is >= 44px. */
:root {
  --e1: 0.5rem;
  --e2: 0.75rem;
  --e3: 1.125rem;
  --e4: 1.625rem;

  --card-pad: clamp(1.2rem, 4vw, 2rem);
  --modal-pad: clamp(1.4rem, 4vw, 2.2rem);
  --section-pad-y: clamp(4rem, 8vw, 6rem);
  --section-pad-x: clamp(1.5rem, 4vw, 4rem);
  --hero-pad: 132px clamp(1.5rem, 4vw, 2.75rem) 64px;

  --touch-min: 44px;         /* never smaller, anywhere */
  --touch-sm: 40px;          /* icon-only buttons, sub-items */
  --touch-xs: 36px;

  --site-max: 1280px;        /* marketing header/hero content */
  --content-max: 1200px;     /* marketing grids, wide client page */
  --panel-max: 880px;        /* panel main column */
  --panel-max-canvas: 1360px;
  --pagina-max: 760px;       /* client public page, centered */
  --sidebar-w: 236px;
  --bottomnav-h: 78px;
  --tm-topo-sticky: 84px;    /* espaço do header fixo do painel - todo `position:sticky` de coluna lateral usa este valor em vez de chutar o próprio */

  --gap-grid: 2rem;
  --gap-cards: 1.4rem;
  --gap-inline: 0.5rem;
}

/* ============ tokens/radius-shadow.css ============ */
/* ---------- TeMostra radii, borders & shadows ----------
   Radii are deliberately un-rounded numbers (13/14px, not 12/16) - copy them
   literally. Shadows are always tinted with the brand blue, never neutral
   black, except the two overlay cases noted below. */
:root {
  --r-campo: 8px;        /* text inputs */
  --r-mini: 10px;        /* small notices, list rows */
  --r-bloco: 12px;       /* content blocks, marketing sub-cards */
  --r-controle: 13px;    /* buttons, pills, option labels */
  --r-cartao: 14px;      /* cards */
  --r-modal: 16px;       /* modals, hero sections of client pages */
  --r-card-hero: 18px;   /* the marketing hero wizard card */
  --r-pill: 50px;        /* chips, badges, progress tracks */
  --r-circle: 50%;

  --bw-hairline: 1px;
  --bw-field: 2px;       /* inputs and outline buttons are 2px, not 1px */
  --bw-accent: 4px;      /* left accent on .card-seguranca / .callout */

  --sombra: 0 4px 18px rgba(34, 57, 119, 0.05);          /* resting card */
  --sombra-hover: 0 10px 40px rgba(34, 57, 119, 0.12);   /* lifted card */
  --sombra-header: 0 6px 24px rgba(34, 57, 119, 0.12);   /* scrolled header */
  --sombra-menu: 0 10px 30px rgba(34, 57, 119, 0.15);    /* dropdown */
  --sombra-btn: 0 8px 25px rgba(34, 57, 119, 0.25);      /* marketing primary hover */
  --sombra-num: 0 4px 14px rgba(245, 103, 32, 0.35);     /* orange step bubbles */
  --sombra-hero-card: 0 20px 50px rgba(0, 0, 0, 0.22);   /* card on photo */
  --sombra-fab: 0 6px 20px rgba(0, 0, 0, 0.25);          /* WhatsApp FAB */

  --blur-header: blur(10px);   /* header/nav glass over rgba(255,255,255,.95) */
  --blur-modal: blur(4px);     /* modal scrim */
  --scrim-modal: rgba(34, 57, 119, 0.85);
  --scrim-modal-pagina: rgba(0, 0, 0, 0.6);
}

/* ============ tokens/motion.css ============ */
/* ---------- TeMostra motion ----------
   Restrained: fade-and-rise on entry, color/border transitions on hover,
   translateY(-2px..-5px) lifts. No bounce, no spring, no parallax. Everything
   is CSS-only and every animation is disabled under prefers-reduced-motion. */
:root {
  --dur-fast: 0.2s;
  --dur: 0.3s;
  --dur-slow: 0.4s;
  --dur-hero: 0.9s;
  --dur-bar: 1.8s;          /* the "como funciona" progress fill */

  --ease: ease;
  --ease-brand: cubic-bezier(0.4, 0, 0.2, 1);

  --lift-sm: translateY(-2px);
  --lift: translateY(-5px);

  --enter-from: translateY(14px);   /* panel tab enter */
  --enter-from-hero: translateY(20px);
}

@keyframes tm-entra { from { opacity: 0; transform: var(--enter-from); } to { opacity: 1; transform: none; } }
@keyframes tm-hero-in { to { opacity: 1; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 0.01s;
    --dur: 0.01s;
    --dur-slow: 0.01s;
    --dur-hero: 0.01s;
    --dur-bar: 0.01s;
  }
}

/* ---------- Tema escuro (automático, claro, escuro) ----------
   O <html data-tema="claro|escuro"> é posto por um script curto no <head> (antes do CSS, sem piscar) a partir de localStorage
   'temostra_tema_painel'; só o painel e a tela Entrar o aplicam (a página pública é do cliente e as cores dela são dele). O escuro SÓ redefine tokens. */
html[data-tema="escuro"] {
    color-scheme: dark;
    --tm-tinta-rgb: 228, 233, 246;
    --tm-off-white: #0d1328;
    --tm-white: #151d38;
    --tm-blue: #e4e9f6;
    --tm-blue-light: #a9b8e0;
    --tm-field-readonly: #1b2547;
    --tm-code-bg: #1b2547;
    --tm-quote-bg: #1b2547;
    --tm-ink: #dfe4f2;
    --tm-ink-soft: #aab4d0;
    --tm-borda: rgba(228, 233, 246, 0.10);
    --tm-borda-campo: rgba(228, 233, 246, 0.20);
    --tm-borda-forte: rgba(228, 233, 246, 0.32);
    --tm-borda-botao: rgba(228, 233, 246, 0.18);
    --tm-fundo-suave: rgba(228, 233, 246, 0.07);
    --tm-fundo-th: rgba(228, 233, 246, 0.05);
    --tm-green: #5cc97a;
    --tm-verde-suave: rgba(92, 201, 122, 0.14);
    --tm-verde-borda: rgba(92, 201, 122, 0.40);
    --tm-red: #ff8a80;
    --tm-red-bright: #ff8a80;
    --tm-vermelho-suave: rgba(255, 138, 128, 0.10);
    --tm-vermelho-borda: rgba(255, 138, 128, 0.40);
    --tm-amber-text: #f2c14e;
    --painel-header-bg: rgba(21, 29, 56, 0.95);
    --scrim-modal: rgba(5, 9, 22, 0.82);
    --sombra-menu: 0 12px 32px rgba(0, 0, 0, 0.45);
}
