/* ═══════════════════════════════════════════════════════════════════════════
   LITTLE LEARNERS PLANNER — tokens + acessibilidade compartilhados

   Paleta "sala de papel": areia bem clara, papel, argila só na ação.
   Contraste WCAG 2.1 AA (texto relativo ao fundo indicado):
     --accent       #B24F36  5.17:1  botões/links (texto branco)
     --accent-deep  #8F3E2A  7.27:1  hover
     --accent-bright #E07A5A        pêssego só em marca/brilho (não é texto)
     --success      #3B7A54  5.12:1  sálvia
     --amber        #9A641C  4.98:1  mel
     --info         #3F6570  6.35:1  ardósia quente (sem azul gelado)
     --ink          #1A1816  14.1:1  sobre a areia #F8F1E8
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --bg: #F8F1E8;
  --surface: #FFFCF8;
  --surface-2: #F6EEE5;
  --surface-3: #EEE4D8;
  --surface-4: #E5D8C8;
  --field: #FBF6EF;
  --chrome: #F3EBE1;

  --ink: #1A1816;
  --ink-soft: #4A4540;
  --ink-mute: #5E5852;
  --on-accent: #FFFFFF;

  --border: #E5D6C4;
  --border-strong: #D4C2AE;

  --accent: #B24F36;
  --accent-bright: #E07A5A;
  --accent-soft: #F8EFE8;
  --accent-mid: #EDD4C6;
  --accent-deep: #8F3E2A;
  --coral: #B24F36;
  --coral-soft: #F8EFE8;
  --coral-mid: #EDD4C6;
  --amber: #9A641C;
  --amber-soft: #F7F0E4;
  --green: #3B7A54;
  --green-soft: #EAF1E8;
  --blue: #3F6570;
  --blue-soft: #EAEFEE;
  --violet: #7A4E4A;

  --success: #3B7A54;
  --success-soft: #EAF1E8;
  --error: #B42318;
  --error-soft: #F7E8E4;
  --info: #3F6570;
  --info-soft: #EAEFEE;

  --paper-wash:
    radial-gradient(ellipse 90% 55% at 0% -5%, rgba(178, 79, 54, 0.04), transparent 54%),
    radial-gradient(ellipse 75% 48% at 100% 0%, rgba(154, 100, 28, 0.045), transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(59, 122, 84, 0.03), transparent 52%);

  --r-xs: 8px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-full: 9999px;

  --sh-xs: 0 1px 2px rgba(26, 24, 22, 0.05);
  --sh-sm: 0 1px 3px rgba(26, 24, 22, 0.06), 0 1px 2px rgba(26, 24, 22, 0.04);
  --sh: 0 2px 8px rgba(26, 24, 22, 0.06), 0 1px 3px rgba(26, 24, 22, 0.04);
  --sh-md: 0 6px 20px rgba(26, 24, 22, 0.08), 0 2px 6px rgba(26, 24, 22, 0.04);
  --sh-lg: 0 16px 40px rgba(26, 24, 22, 0.10), 0 4px 12px rgba(26, 24, 22, 0.05);
  --sh-xl: 0 40px 80px -24px rgba(26, 24, 22, 0.18), 0 12px 28px -12px rgba(26, 24, 22, 0.10);

  --font-heading: "Manrope", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 0.22s;
  --header-h: 64px;
  --focus-ring: 0 0 0 3px var(--bg), 0 0 0 6px var(--accent);
  --touch: 44px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --chrome-h: calc(var(--header-h) + var(--safe-top));
  --bottomnav-h: 0px;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--chrome-h) + 12px);
  color-scheme: light;
  min-height: 100%;
  min-height: 100dvh;
  background-color: var(--bg);
  background-image: var(--paper-wash);
  background-attachment: fixed;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: transparent;
}

::selection {
  background: var(--accent-mid);
  color: var(--ink);
}

.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;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -72px;
  z-index: 10000;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  text-decoration: none;
  box-shadow: var(--sh-lg);
}
.skip-link:focus,
.skip-link:focus-visible {
  top: 12px;
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

:focus {
  outline: none;
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --border: #8A8278;
    --border-strong: #5E5852;
    --ink-mute: #3D3935;
    --accent: #8C3528;
  }
  .card, .feat-card, .step-card, input, select, textarea {
    border-width: 2px;
  }
}

@media (forced-colors: active) {
  .skip-link,
  .btn-primary,
  .nav-btn,
  .cta-btn {
    forced-color-adjust: none;
    background: ButtonFace;
    color: ButtonText;
    border: 2px solid ButtonText;
  }
  :focus-visible {
    outline: 3px solid Highlight;
  }
}

.brand-mark,
.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  flex-shrink: 0;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.brand-mark svg,
.logo-mark svg {
  width: 18px;
  height: 18px;
  display: block;
}

.site-footer {
  background: var(--chrome);
  padding: 36px 24px 28px;
  color: var(--ink);
  border-top: 1px solid var(--border);
}
.site-footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  gap: 22px;
}
.site-footer-brand {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.02em;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.site-footer-tagline {
  font-size: 14px;
  color: var(--ink-soft);
  margin-top: 8px;
  max-width: 42ch;
  line-height: 1.6;
}
.site-footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}
.site-footer-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.site-footer-nav a:hover {
  color: var(--accent);
}
.site-footer-copy {
  font-size: 13px;
  color: var(--ink-mute);
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

@media (min-width: 720px) {
  .site-footer-inner {
    grid-template-columns: 1.4fr auto;
    align-items: start;
  }
  .site-footer-copy {
    grid-column: 1 / -1;
  }
}

.legal-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--chrome-h);
  padding: var(--safe-top) max(24px, var(--safe-right)) 0 max(24px, var(--safe-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: color-mix(in srgb, var(--chrome) 92%, var(--accent-soft) 8%);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
}
.legal-nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
  min-height: var(--touch);
}
.legal-nav-brand-text {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.legal-nav-back {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-soft);
  text-decoration: none;
  min-height: var(--touch);
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--r-sm);
}
.legal-nav-back:hover {
  color: var(--ink);
  background: var(--surface-2);
}
.legal,
.legal-doc {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 24px 90px;
}
.legal h1,
.legal-doc h1 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 8px;
  line-height: 1.18;
}
.legal .updated,
.legal-doc .updated {
  font-size: 14px;
  color: var(--ink-mute);
  font-weight: 500;
  margin-bottom: 36px;
}
.legal h2,
.legal-doc h2 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink);
  margin: 32px 0 12px;
}
.legal p,
.legal-doc p {
  font-size: 15px;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.legal ul,
.legal-doc ul {
  margin: 0 0 14px 1.3rem;
  color: var(--ink-soft);
  font-size: 15px;
}
.legal li,
.legal-doc li {
  margin-bottom: 6px;
}
.legal a,
.legal-doc a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.legal a:hover,
.legal-doc a:hover {
  color: var(--accent-deep);
}
@media (max-width: 640px) {
  .legal-nav { padding: var(--safe-top) max(16px, var(--safe-right)) 0 max(16px, var(--safe-left)); }
  .legal,
  .legal-doc { padding: 40px 16px calc(70px + var(--safe-bottom)); }
}

/* ═══ TOQUE / PWA — compartilhado por home, login, app e páginas legais ═══ */
button, a, input, select, textarea, summary, [role="button"], [role="tab"], [role="dialog"] {
  touch-action: manipulation;
}
a, button {
  -webkit-tap-highlight-color: color-mix(in srgb, var(--accent) 16%, transparent);
}

/* iOS Safari dá zoom no foco se o campo tiver menos de 16px. */
input, select, textarea {
  font-size: 16px;
  scroll-margin-bottom: 24px;
}

@media (hover: none) {
  html { background-attachment: scroll; }
  .feat-card:hover,
  .browser-frame:hover,
  .fc-card:hover,
  .btn:hover,
  .btn-primary:hover,
  .nav-btn:hover,
  .cta-btn:hover {
    transform: none;
  }
}

@media (max-width: 900px) {
  html { background-attachment: scroll; }
}

@media (display-mode: standalone) {
  html { background-attachment: scroll; }
}
