/* ═══════════════════════════════════════════════════════════
   VITA 40+ — DESIGN SYSTEM
   Tokens, reset, tipografia base e utilitários compartilhados.
   Importado por todas as páginas antes de style.css.
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,500;0,600;0,700;1,500&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* ─── PALETA ─── */
  --primary: #4a6741;
  --primary-d: #3a5132;
  --primary-l: #e8ede5;
  --bege: #f5f1eb;
  --bege-d: #ede5d5;
  --branco: #ffffff;

  --texto: #2a2a2a;
  --texto-2: #5a5a5a;
  --texto-3: #888888;

  --border: #e8e0d0;
  --border-l: #f0ebe0;

  --erro: #c44536;
  --erro-bg: #fbe9e7;
  --sucesso: #4a8a3f;
  --sucesso-bg: #eaf3e7;

  /* ─── TIPOGRAFIA ─── */
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --fs-h1: 48px;
  --fs-h2: 36px;
  --fs-h3: 24px;
  --fs-body: 16px;
  --fs-small: 14px;
  --fs-eyebrow: 13px;

  /* ─── ESPAÇAMENTO (escala 4px) ─── */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-6: 24px;
  --s-8: 32px;
  --s-12: 48px;
  --s-16: 64px;
  --s-24: 96px;

  /* ─── CONTAINERS ─── */
  --max: 1120px;
  --max-narrow: 720px;
  --max-card: 480px;

  /* ─── SOMBRAS quentes ─── */
  --sh-sm: 0 1px 2px rgba(74, 60, 40, .06), 0 2px 4px rgba(74, 60, 40, .04);
  --sh-md: 0 4px 12px rgba(74, 60, 40, .08), 0 2px 6px rgba(74, 60, 40, .05);
  --sh-lg: 0 16px 40px rgba(74, 60, 40, .12), 0 6px 16px rgba(74, 60, 40, .06);
  --sh-focus: 0 0 0 3px rgba(74, 103, 65, .18);

  /* ─── RAIOS ─── */
  --r-sm: 6px;
  --r-md: 12px;
  --r-pill: 999px;

  /* ─── TRANSIÇÕES ─── */
  --t-fast: .15s ease;
  --t-base: .2s ease;
  --t-slow: .35s ease;
}

/* ─── RESET MÍNIMO ─── */
*, *::before, *::after { box-sizing: border-box; }
/* HTML5 [hidden] precisa de !important pra não ser sobrescrito por
   regras display:grid/flex/block em selectors específicos. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--texto);
  background: var(--branco);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

/* ─── TIPOGRAFIA BASE ─── */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 var(--s-4);
  color: var(--texto);
  letter-spacing: -.01em;
}
h1 { font-size: var(--fs-h1); font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
p { margin: 0 0 var(--s-4); }
a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--t-fast);
}
a:hover { color: var(--primary-d); text-decoration: underline; }
strong { font-weight: 600; }
em { font-style: italic; color: var(--primary-d); }

@media (max-width: 768px) {
  :root {
    --fs-h1: 32px;
    --fs-h2: 26px;
    --fs-h3: 20px;
  }
}

/* ─── UTILITÁRIOS ─── */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--s-6);
}
.container-narrow { max-width: var(--max-narrow); }
.container-card { max-width: var(--max-card); }

.eyebrow {
  font-family: var(--sans);
  text-transform: uppercase;
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: .14em;
  color: var(--primary);
  margin: 0 0 var(--s-3);
  display: inline-block;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ─── BOTÕES BASE ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  font-family: var(--sans);
  font-weight: 600;
  font-size: var(--fs-body);
  line-height: 1;
  padding: 14px 28px;
  border-radius: var(--r-pill);
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast),
              border-color var(--t-fast), box-shadow var(--t-fast),
              transform var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: none; box-shadow: var(--sh-focus); }

.btn-cta {
  background: var(--primary);
  color: var(--branco);
  box-shadow: 0 4px 14px rgba(74, 103, 65, .28);
  padding: 16px 32px;
}
.btn-cta:hover {
  background: var(--primary-d);
  color: var(--branco);
  box-shadow: 0 8px 22px rgba(74, 103, 65, .35);
}
.btn-cta-large { font-size: 17px; padding: 18px 36px; }
.btn-cta-xl {
  font-size: 17px;
  padding: 18px 36px;
  width: 100%;
  max-width: 480px;
}

.btn-ghost {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
  padding: 12px 22px;
  font-size: 14px;
}
.btn-ghost:hover { background: var(--primary-l); color: var(--primary-d); }

.btn-text {
  background: transparent;
  color: var(--texto-2);
  padding: 8px 12px;
  font-size: 14px;
  border-radius: var(--r-sm);
  font-weight: 500;
}
.btn-text:hover { color: var(--primary); background: var(--primary-l); }

.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ─── INPUTS BASE ─── */
.input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  font-family: var(--sans);
  font-size: var(--fs-body);
  background: var(--branco);
  color: var(--texto);
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input::placeholder { color: var(--texto-3); }
.input:focus {
  border-color: var(--primary);
  box-shadow: var(--sh-focus);
}
.input[aria-invalid="true"] { border-color: var(--erro); }

.field { display: grid; gap: 6px; }
.field-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--texto-2);
}

/* ─── ALERTAS ─── */
.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  font-size: 14px;
  line-height: 1.5;
}
.alert-error {
  background: var(--erro-bg);
  color: var(--erro);
  border-left: 3px solid var(--erro);
}
.alert-success {
  background: var(--sucesso-bg);
  color: var(--sucesso);
  border-left: 3px solid var(--sucesso);
}
.alert-info {
  background: var(--primary-l);
  color: var(--primary-d);
  border-left: 3px solid var(--primary);
}

/* Animação shake (usada em erro de login) */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
.shake { animation: shake .3s ease; }

/* ─── FADE IN no scroll ─── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ─── TOAST ─── */
.toast-region {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  display: grid;
  gap: 10px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--branco);
  color: var(--texto);
  padding: 14px 18px;
  border-radius: var(--r-sm);
  box-shadow: var(--sh-lg);
  border-left: 4px solid var(--primary);
  font-size: 14px;
  max-width: 360px;
  animation: toast-in .3s ease;
}
.toast-error { border-left-color: var(--erro); }
.toast-success { border-left-color: var(--sucesso); }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ─── ANIMAÇÃO PULSE pro CTA ─── */
@keyframes pulse-cta {
  0%, 100% { box-shadow: 0 4px 14px rgba(74, 103, 65, .28); }
  50% { box-shadow: 0 4px 22px rgba(74, 103, 65, .5); }
}
.pulse { animation: pulse-cta 2.5s ease-in-out infinite; }

/* Reduz movimento se preferência do usuário */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
