/* Dias Vividos — design system. Mobile-first; breakpoints em 640px (tablet) e 1024px (desktop). */

:root {
  --bg: #14122b;
  --bg-2: #1e1b4b;
  --bg-card: #262247;
  --bg-card-2: #2d2860;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f3fb;
  --text-muted: #b7b3d9;
  --text-faint: #8d88b8;
  --violet: #7c3aed;
  --violet-light: #a78bfa;
  --gold: #f59e0b;
  --gold-light: #fcd34d;
  --pink: #f472b6;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.35);
  --container-w: 720px;
  --container-w-wide: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: radial-gradient(120% 90% at 85% -10%, #3a2e7a 0%, var(--bg) 45%), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--gold-light); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  width: 100%;
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 18px;
}

.container--wide { max-width: var(--container-w-wide); }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--gold);
  color: #1a1330;
  padding: 10px 16px;
  z-index: 1000;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
}

.logo:hover { text-decoration: none; }

.logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--violet), var(--bg-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex: none;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
}

.site-nav {
  display: none;
  position: absolute;
  top: 62px;
  left: 0;
  right: 0;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  z-index: 40;
}

.site-nav.is-open { display: block; }

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 8px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.site-nav a {
  display: block;
  padding: 10px 6px;
  color: var(--text-muted);
  border-radius: 8px;
  font-size: 0.95rem;
}

.site-nav a:hover, .site-nav a:focus { background: rgba(255,255,255,0.06); color: var(--text); text-decoration: none; }

@media (min-width: 860px) {
  .nav-toggle { display: none; }
  .site-nav {
    display: block;
    position: static;
    background: none;
    border: none;
  }
  .site-nav ul { flex-direction: row; padding: 0; gap: 4px; }
  .site-nav a { padding: 8px 12px; font-size: 0.92rem; }
}

/* ---------- Hero / formulário ---------- */
.hero {
  padding: 36px 0 28px;
  text-align: center;
}

.hero h1 {
  font-size: 1.9rem;
  line-height: 1.2;
  margin: 0 0 10px;
  font-weight: 800;
}

.hero h1 .accent { color: var(--gold-light); }

.hero p.lead {
  color: var(--text-muted);
  font-size: 1.02rem;
  max-width: 46ch;
  margin: 0 auto 26px;
}

.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 18px;
  box-shadow: var(--shadow);
  max-width: 420px;
  margin: 0 auto;
}

.form-field { text-align: left; margin-bottom: 14px; }

.form-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-field input {
  width: 100%;
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-2);
  color: var(--text);
  font-size: 1.15rem;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  text-align: center;
}

.form-field input::placeholder {
  color: var(--text-faint);
  letter-spacing: 0.04em;
}

.form-field input:focus,
.btn:focus-visible,
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}

.form-error {
  color: #fca5a5;
  font-size: 0.85rem;
  margin-top: 8px;
  min-height: 1.1em;
}

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, var(--gold), #f97316);
  color: #23160a;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.28);
}
.btn-primary:hover { box-shadow: 0 8px 22px rgba(245, 158, 11, 0.4); }

.btn-secondary {
  background: var(--bg-card-2);
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover { background: var(--bg-card); }

.btn-ghost {
  background: transparent;
  color: var(--gold-light);
  border: 1px solid var(--border-strong);
}

@media (min-width: 640px) {
  .btn { width: auto; }
}

/* ---------- Resultado ---------- */
#resultado { display: none; }
#resultado.is-visible { display: block; }

.resultado-hero {
  background: linear-gradient(160deg, var(--bg-card-2), var(--bg-card));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 26px 20px;
  text-align: center;
  margin: 28px 0 22px;
  box-shadow: var(--shadow-lg);
}

.resultado-hero .rotulo {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  color: var(--text-faint);
  font-weight: 700;
  margin-bottom: 8px;
}

.resultado-hero .idade-humana {
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.3;
  margin: 0 0 18px;
}

.resultado-hero .idade-humana strong { color: var(--gold-light); }

.marco-progresso { text-align: left; }

.marco-progresso .marco-texto {
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 10px;
  font-weight: 600;
}

.marco-texto strong { color: var(--gold-light); }

.progress-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--violet-light), var(--gold));
  transition: width 0.6s ease;
  width: 0%;
}

/* ---------- Cards empilhados ---------- */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 22px 0;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  position: relative;
}

.card-icon {
  font-size: 1.6rem;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(124, 58, 237, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.card-corpo { min-width: 0; }

.card-numero {
  font-size: clamp(1.15rem, 1.05rem + 1vw, 1.5rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  word-break: normal;
  overflow-wrap: normal;
  white-space: nowrap;
}

.card-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.card--destaque {
  border-color: rgba(245, 158, 11, 0.55);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), var(--bg-card));
}

.card-selo {
  position: absolute;
  top: -10px;
  right: 14px;
  background: var(--gold);
  color: #23160a;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}

.card--curiosidade .card-label small {
  display: block;
  margin-top: 3px;
  color: var(--text-faint);
  font-size: 0.75rem;
}

@media (min-width: 640px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Entrada animada (cards e fun facts) ---------- */
@keyframes entradaCard {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.is-animado > * {
  opacity: 0;
  animation: entradaCard 0.5s ease forwards;
}
.is-animado > *:nth-child(1) { animation-delay: 0.02s; }
.is-animado > *:nth-child(2) { animation-delay: 0.07s; }
.is-animado > *:nth-child(3) { animation-delay: 0.12s; }
.is-animado > *:nth-child(4) { animation-delay: 0.17s; }
.is-animado > *:nth-child(5) { animation-delay: 0.22s; }
.is-animado > *:nth-child(6) { animation-delay: 0.27s; }
.is-animado > *:nth-child(7) { animation-delay: 0.32s; }
.is-animado > *:nth-child(8) { animation-delay: 0.37s; }
.is-animado > *:nth-child(9) { animation-delay: 0.42s; }
.is-animado > *:nth-child(10) { animation-delay: 0.47s; }

@media (prefers-reduced-motion: reduce) {
  .is-animado > * { animation: none; opacity: 1; }
  .progress-fill { transition: none; }
}

/* ---------- Fun facts ---------- */
.fun-facts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 22px 0;
}

.fun-fact {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  text-align: center;
}

.fun-fact .fun-fact-emoji { font-size: 1.4rem; margin-bottom: 6px; }
.fun-fact .fun-fact-valor { font-weight: 800; font-size: 1.05rem; }
.fun-fact .fun-fact-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.fun-fact .fun-fact-link { display: inline-block; margin-top: 8px; font-size: 0.82rem; }

@media (min-width: 640px) {
  .fun-facts { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- CTA CustomPages ---------- */
.cta-custompages {
  position: relative;
  background: linear-gradient(135deg, #3a2470, #241a4d);
  border: 1px solid rgba(244, 114, 182, 0.35);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  margin: 24px 0;
  text-align: center;
  box-shadow: var(--shadow);
}

.cta-tag {
  position: absolute;
  top: 12px;
  left: 14px;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 700;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 2px 8px;
}

.cta-icon { font-size: 2rem; margin: 14px 0 8px; }

.cta-texto strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.cta-texto p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0 0 16px;
}

.cta-botao {
  display: inline-flex;
  padding: 12px 24px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--pink), #ec4899);
  color: #2a0f22;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(244, 114, 182, 0.3);
}
.cta-botao:hover { text-decoration: none; box-shadow: 0 8px 22px rgba(244, 114, 182, 0.42); }

/* ---------- Widget de afiliados ---------- */
.affiliate-widget {
  margin: 26px 0;
  padding: 20px 0;
  border-top: 1px solid var(--border);
}

.affiliate-widget h2 {
  font-size: 1.05rem;
  margin: 0 0 4px;
}

.affiliate-widget .affiliate-tag {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  font-weight: 700;
}

.affiliate-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.affiliate-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.affiliate-item img {
  border-radius: 10px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--bg-2);
}

.affiliate-item .titulo {
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.3;
  flex: 1;
}

.affiliate-item .preco {
  font-weight: 800;
  color: var(--gold-light);
  font-size: 0.95rem;
}

.affiliate-item a.affiliate-link {
  font-size: 0.78rem;
  text-align: center;
  padding: 8px;
  border-radius: 8px;
  background: var(--bg-card-2);
  color: var(--text);
  font-weight: 700;
}
.affiliate-item a.affiliate-link:hover { text-decoration: none; background: var(--violet); }

.affiliate-widget .affiliate-empty,
.affiliate-widget .affiliate-erro {
  color: var(--text-faint);
  font-size: 0.85rem;
  padding: 10px 0;
}

@media (min-width: 640px) {
  .affiliate-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Ações finais ---------- */
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 26px 0 10px;
}

@media (min-width: 640px) {
  .action-buttons { flex-direction: row; }
  .action-buttons .btn { flex: 1; }
}

/* ---------- Conteúdo (páginas internas) ---------- */
.page-hero {
  padding: 30px 0 8px;
  text-align: center;
}
.page-hero h1 { font-size: 1.7rem; margin: 0 0 10px; }
.page-hero p { color: var(--text-muted); max-width: 60ch; margin: 0 auto; }

.prose { padding: 18px 0 40px; }
.prose h2 { font-size: 1.25rem; margin: 30px 0 10px; }
.prose h3 { font-size: 1.05rem; margin: 22px 0 8px; }
.prose p { color: var(--text-muted); margin: 0 0 14px; }
.prose ul { color: var(--text-muted); padding-left: 20px; }
.prose li { margin-bottom: 6px; }
.prose strong { color: var(--text); }

.callout {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 18px 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.milestone-embed {
  margin: 26px 0;
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
}

/* ---------- FAQ ---------- */
.faq-list { margin: 20px 0 40px; }

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  padding: 16px 28px 16px 0;
  cursor: pointer;
  position: relative;
}

.faq-question::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 14px;
  font-size: 1.3rem;
  color: var(--gold-light);
  transition: transform 0.2s ease;
}

.faq-question[aria-expanded="true"]::after { transform: rotate(45deg); }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.92rem;
  transition: max-height 0.25s ease;
}

.faq-answer p { margin: 0 0 14px; }

.faq-item.is-open .faq-answer { max-height: 600px; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 30px 0 40px;
  margin-top: 20px;
  color: var(--text-faint);
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 16px;
}

.footer-links a { color: var(--text-muted); }

.footer-cta {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 18px;
  text-align: center;
}

.footer-legal p { margin: 4px 0; }

/* ---------- 404 ---------- */
.error-page {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 18px;
}
.error-page .codigo { font-size: 4rem; font-weight: 800; color: var(--gold-light); }

/* ---------- Utilitários ---------- */
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (min-width: 1024px) {
  .hero h1 { font-size: 2.4rem; }
  .resultado-hero .idade-humana { font-size: 1.9rem; }
  .page-hero h1 { font-size: 2.1rem; }
}
