/* Aula Pronta — tokens e base compartilhados */
:root {
  --paper: #fbf7f0;
  --paper-2: #f3ece0;
  --card: #ffffff;
  --ink: #1e2a3a;
  --ink-2: #4b5768;
  --ink-3: #7a8494;
  --line: #e8e1d5;
  --brand: #0f766e;
  --brand-2: #115e59;
  --brand-soft: #e3f4f1;
  --accent: #c2410c;
  --accent-2: #9a3412;
  --accent-soft: #fff1e3;
  --mark: #fcc94a;
  --mark-soft: #fff4d1;
  --green: #15803d;
  --green-soft: #e3f5e8;
  --coral: #dc4a3d;
  --coral-soft: #fde8e3;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow: 0 1px 2px rgba(30, 42, 58, .05), 0 8px 24px rgba(30, 42, 58, .07);
  --shadow-lg: 0 2px 6px rgba(30, 42, 58, .06), 0 24px 60px rgba(30, 42, 58, .14);
  --font-display: "Fredoka", system-ui, sans-serif;
  --font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.12; letter-spacing: -0.01em; margin: 0; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }

.container { width: min(1160px, 100% - 32px); margin-inline: auto; }

.logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.35rem;
  text-decoration: none; letter-spacing: -0.01em; color: var(--brand-2);
}
.logo-mark {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  background: var(--brand) url("/favicon.svg") center / cover no-repeat;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.18), 0 4px 12px rgba(15, 118, 110, .25);
  rotate: -4deg;
}
.logo-mark svg { display: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; border: 1.5px solid transparent;
  font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease, border-color .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(194, 65, 12, .28); }
.btn-primary:hover { background: var(--accent-2); }
.btn-teal { background: var(--brand); color: #fff; box-shadow: 0 6px 18px rgba(15, 118, 110, .25); }
.btn-teal:hover { background: var(--brand-2); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink-3); background: var(--card); }
.btn-lg { padding: 16px 26px; font-size: 1.02rem; }
.btn svg { width: 18px; height: 18px; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }

.hl {
  background: linear-gradient(transparent 58%, var(--mark) 58%, var(--mark) 92%, transparent 92%);
  padding: 0 .08em;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--brand);
}

:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- Telas de carregamento ---------- */
.splash {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; align-content: center; gap: 22px;
  background: radial-gradient(circle at 30% 20%, #e3f4f1, transparent 55%), radial-gradient(circle at 80% 85%, #fdf1e3, transparent 50%), var(--paper);
  transition: opacity .35s ease, visibility .35s;
}
.splash.sai { opacity: 0; visibility: hidden; }
.splash-logo { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 700; font-size: 1.7rem; color: var(--brand-2); }
.splash-logo .logo-mark { width: 54px; height: 54px; border-radius: 15px; animation: splash-pulo 1.2s cubic-bezier(.3, .7, .3, 1) infinite; }
@keyframes splash-pulo { 0%, 100% { transform: translateY(0) rotate(-4deg); } 40% { transform: translateY(-14px) rotate(4deg); } 60% { transform: translateY(-14px) rotate(4deg); } }
.splash-bar { width: 180px; height: 6px; border-radius: 99px; background: var(--paper-2); overflow: hidden; }
.splash-bar i { display: block; width: 45%; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), var(--accent)); animation: splash-barra 1.2s ease-in-out infinite; }
@keyframes splash-barra { from { transform: translateX(-110%); } to { transform: translateX(240%); } }
.splash-dica { max-width: 34ch; text-align: center; color: var(--ink-3); font-size: .92rem; min-height: 3em; padding: 0 20px; }
.splash-dica b { color: var(--ink-2); font-weight: 600; }

/* botão esperando resposta */
.btn.carregando { position: relative; color: transparent !important; pointer-events: none; }
.btn.carregando::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px;
  border: 2.5px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; animation: gira-btn .7s linear infinite;
}
.btn-ghost.carregando::after { border-color: rgba(30, 42, 58, .15); border-top-color: var(--brand); }
@keyframes gira-btn { to { transform: rotate(360deg); } }

/* blocos "fantasma" enquanto os dados chegam */
.skeleton { border-radius: 10px; background: linear-gradient(90deg, var(--paper-2) 25%, #faf6ee 50%, var(--paper-2) 75%); background-size: 200% 100%; animation: skeleton 1.3s linear infinite; }
@keyframes skeleton { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  .splash-logo .logo-mark, .splash-bar i, .btn.carregando::after, .skeleton { animation-duration: 3s; }
}

/* ===================== ACABAMENTO GERAL (vale para todas as telas) ===================== */
:root {
  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --shadow-sm: 0 1px 2px rgba(30, 42, 58, .06), 0 2px 6px rgba(30, 42, 58, .04);
  --shadow-brand: 0 10px 30px -8px rgba(15, 118, 110, .35);
  --shadow-accent: 0 10px 28px -8px rgba(194, 65, 12, .5);
}
::selection { background: color-mix(in srgb, var(--mark) 70%, transparent); color: var(--ink); }
html { scrollbar-color: color-mix(in srgb, var(--ink-3) 45%, transparent) transparent; scrollbar-width: thin; }
body { text-rendering: optimizeLegibility; }

/* botões: levantam no hover, brilho passando no principal, seta anda */
.btn { transition: transform .2s var(--ease-out), background .2s, box-shadow .2s, border-color .2s, color .2s; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); transition-duration: .05s; }
.btn-primary, .btn-teal { position: relative; overflow: hidden; isolation: isolate; }
.btn-primary { background: linear-gradient(180deg, #d4541a, var(--accent)); box-shadow: var(--shadow-accent), inset 0 1px 0 rgba(255, 255, 255, .22); }
.btn-primary:hover { background: linear-gradient(180deg, #c2410c, var(--accent-2)); box-shadow: 0 14px 32px -8px rgba(194, 65, 12, .6), inset 0 1px 0 rgba(255, 255, 255, .22); }
.btn-teal { background: linear-gradient(180deg, #13877e, var(--brand)); box-shadow: var(--shadow-brand), inset 0 1px 0 rgba(255, 255, 255, .2); }
.btn-primary::before, .btn-teal::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%);
  translate: -120% 0; transition: translate .7s var(--ease-out);
}
.btn-primary:hover::before, .btn-teal:hover::before { translate: 120% 0; }
.btn svg { transition: transform .25s var(--ease-spring); }
.btn:hover svg:last-child:not(:first-child) { transform: translateX(3px); }
.btn-ghost { background: color-mix(in srgb, var(--card) 60%, transparent); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-2); background: var(--card); box-shadow: var(--shadow-sm); }
.btn.carregando:hover, .btn[disabled]:hover { transform: none; }

/* campos: transição suave no foco */
input, select, textarea { transition: border-color .15s, box-shadow .2s, background .2s; }

/* chuva de confete (conquistas) */
.confete { position: fixed; inset: 0; pointer-events: none; z-index: 2000; }

@media (prefers-reduced-motion: reduce) {
  .btn:hover { transform: none; }
  .btn-primary::before, .btn-teal::before { display: none; }
}
