/* Landing de gastos.me. Paleta tomada de la app (ui/theme/Color.kt). */
:root {
  --emerald: #1b5e3a;
  --emerald-light: #4c8c68;
  --emerald-dark: #0d3b24;
  --gold: #d4a94d;
  --gold-light: #e8c784;
  --bg: #fbfaf6;
  --surface: #ffffff;
  --surface-2: #f1efe6;
  --text: #1a1c18;
  --muted: #5c6158;
  --border: #e3e0d4;
  --shadow: 0 30px 60px -20px rgba(13, 59, 36, 0.35), 0 12px 24px -12px rgba(13, 59, 36, 0.25);
  --radius: 20px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --emerald: #4c8c68;
    --emerald-light: #7fb796;
    --bg: #12140f;
    --surface: #1d211a;
    --surface-2: #181b15;
    --text: #e3e4dd;
    --muted: #a2a89d;
    --border: #2c3128;
    --shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7), 0 12px 24px -12px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: var(--emerald); }

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

h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; line-height: 1.1; margin: 0; }
h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); }
h1 em { font-style: italic; color: var(--emerald); }
h2 { font-size: clamp(2rem, 4vw, 2.9rem); }
h3 { font-size: 1.3rem; }

.eyebrow {
  margin: 0 0 14px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--emerald);
}
.eyebrow.light { color: var(--gold-light); }
.muted { color: var(--muted); margin: 0; font-size: 0.9rem; }

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: #1b5e3a; color: #fff; box-shadow: 0 10px 24px -10px rgba(27, 94, 58, 0.7); }
.btn-primary:hover { background: #0d3b24; }
.btn-ghost { color: var(--text); border: 1px solid var(--border); background: var(--surface); }
.btn-gold { background: var(--gold); color: #0d3b24; }
.btn-gold:hover { background: var(--gold-light); }
.btn-small { padding: 10px 18px; font-size: 0.9rem; background: #1b5e3a; color: #fff; }
.btn.is-soon { cursor: default; opacity: 0.9; }
.btn.is-soon:hover { transform: none; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}
.site-header.scrolled { border-bottom-color: var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-family: var(--serif); font-weight: 600; font-size: 1.25rem; }
.main-nav { display: flex; gap: 28px; }
.main-nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; font-weight: 500; }
.main-nav a:hover { color: var(--text); }

/* Hero */
.hero { position: relative; padding: clamp(40px, 7vw, 90px) 0 clamp(60px, 8vw, 110px); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 34em; margin: 24px 0 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-actions.center { justify-content: center; }
.trust { display: flex; flex-wrap: wrap; gap: 8px 22px; list-style: none; padding: 0; margin: 28px 0 0; color: var(--muted); font-size: 0.92rem; }
.trust li::before { content: "✓"; color: var(--emerald); font-weight: 700; margin-right: 8px; }

.hero-visual { position: relative; height: 620px; }
.glow {
  position: absolute;
  inset: 8% 0 0 8%;
  background: radial-gradient(closest-side, rgba(212, 169, 77, 0.35), transparent 70%),
              radial-gradient(closest-side at 70% 60%, rgba(27, 94, 58, 0.3), transparent 70%);
  filter: blur(20px);
}

.phone {
  position: relative;
  border-radius: 38px;
  padding: 9px;
  background: #0f120e;
  box-shadow: var(--shadow), inset 0 0 0 1.5px #2b3029;
}
.phone img { border-radius: 30px; width: 100%; height: auto; aspect-ratio: 9 / 20; object-fit: cover; }

.phone-front, .phone-back { position: absolute; width: 270px; }
.phone-front { left: 50%; top: 10px; transform: translateX(-30%); animation: float 7s ease-in-out infinite; z-index: 2; }
.phone-back { left: 50%; top: 60px; transform: translateX(-95%) rotate(-7deg); opacity: 0.95; animation: float-back 8s ease-in-out infinite; }

.chip {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 18px 40px -18px rgba(13, 59, 36, 0.45);
  font-size: 0.85rem;
}
.chip strong { display: block; font-size: 0.98rem; }
.chip small { color: var(--muted); }
.chip-income { right: -4px; top: 120px; animation: float 6s ease-in-out infinite 0.8s; }
.chip-dot { width: 10px; height: 10px; border-radius: 50%; }
.chip-dot.income { background: #2e8b57; box-shadow: 0 0 0 5px rgba(46, 139, 87, 0.18); }
.chip-budget { left: 0; bottom: 70px; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 200px; animation: float 6.5s ease-in-out infinite 1.6s; }
.chip-label { font-weight: 600; }
.meter { width: 100%; height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, #1b5e3a, #4c8c68); border-radius: 6px; }

@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -12px; } }
@keyframes float-back { 0%, 100% { translate: 0 0; } 50% { translate: 0 8px; } }

/* Cifras */
.stats { border-block: 1px solid var(--border); background: var(--surface); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 34px 20px; text-align: center; }
.stat + .stat { border-left: 1px solid var(--border); }
.stat strong { display: block; font-family: var(--serif); font-size: 2.6rem; font-weight: 600; color: var(--emerald); line-height: 1; }
.stat span { display: block; margin-top: 8px; color: var(--muted); font-size: 0.92rem; }

/* Secciones */
.section { padding: clamp(70px, 10vw, 120px) 0; }
.section-tint { background: var(--surface-2); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 56px; }
.section-head.left { text-align: left; margin: 0; }
.section-head p:not(.eyebrow) { color: var(--muted); font-size: 1.1rem; margin: 18px 0 0; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature {
  padding: 30px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.feature:hover { transform: translateY(-4px); box-shadow: 0 24px 40px -28px rgba(13, 59, 36, 0.45); }
.feature p { color: var(--muted); margin: 10px 0 0; font-size: 0.98rem; }
.icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  margin-bottom: 20px;
  background: linear-gradient(140deg, #1f6b42, #0d3b24);
}
.icon svg { width: 24px; height: 24px; fill: none; stroke: #e8c784; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Recorrido */
.tour { display: grid; grid-template-columns: 1fr 340px; gap: 56px; align-items: center; max-width: 960px; margin: 0 auto; }
.tour-tabs { display: grid; gap: 8px; }
.tour-tabs button {
  display: block;
  text-align: left;
  padding: 18px 22px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.tour-tabs button strong { display: block; font-size: 1.05rem; }
.tour-tabs button span { display: block; color: var(--muted); font-size: 0.93rem; margin-top: 2px; }
.tour-tabs button:hover { background: color-mix(in srgb, var(--surface) 60%, transparent); }
.tour-tabs button[aria-selected="true"] { background: var(--surface); border-color: var(--border); box-shadow: 0 14px 30px -24px rgba(13, 59, 36, 0.6); }
.tour-tabs button[aria-selected="true"] strong { color: var(--emerald); }
.tour-tabs button:focus-visible { outline: 2px solid var(--emerald); outline-offset: 2px; }

.tour-visual { position: relative; }
.phone-tour img { transition: opacity 0.35s ease; }
.phone-tour img.fading { opacity: 0; }
.tour-progress { height: 3px; margin: 22px auto 0; width: 60%; background: var(--border); border-radius: 3px; overflow: hidden; }
.tour-progress span { display: block; height: 100%; width: 0; background: var(--gold); }
.tour-progress span.run { animation: progress var(--tour-ms, 5000ms) linear forwards; }
@keyframes progress { to { width: 100%; } }

/* Claro / oscuro */
.theme-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: center; }
.theme-phones { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; max-width: 520px; justify-self: center; }
.theme-phones .phone:last-child { transform: translateY(40px); }

/* Privacidad */
.privacy {
  padding: clamp(70px, 10vw, 120px) 0;
  color: #f4f1e6;
  background: radial-gradient(1200px 500px at 85% -10%, rgba(212, 169, 77, 0.22), transparent 60%),
              linear-gradient(160deg, #1b5e3a, #0d3b24 70%);
}
.privacy h2 { color: #fff; }
.privacy p { color: #cfe0d4; font-size: 1.1rem; }
.privacy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.privacy-links { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-top: 30px; }
.link-light { color: #e8c784; font-weight: 600; }
.privacy-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.privacy-list li {
  padding: 18px 22px 18px 56px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cfe0d4;
  position: relative;
}
.privacy-list li::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 21px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%230d3b24' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.privacy-list strong { color: #fff; }

/* FAQ */
.faq { display: grid; gap: 12px; }
.faq details { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); padding: 0 22px; }
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 20px 30px 20px 0;
  font-weight: 600;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  translate: 0 -50%;
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--emerald);
  transition: rotate 0.2s ease;
}
.faq details[open] summary::after { rotate: 45deg; }
.faq details p { margin: 0 0 20px; color: var(--muted); }

/* CTA */
.cta { padding: 0 0 clamp(70px, 10vw, 120px); }
.cta-inner {
  text-align: center;
  padding: clamp(48px, 7vw, 80px) 24px;
  border-radius: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.cta-inner img { margin: 0 auto 24px; }
.cta-inner p { color: var(--muted); font-size: 1.1rem; margin: 16px auto 30px; max-width: 32em; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 32px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px 32px; }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer-inner nav a { color: var(--muted); text-decoration: none; font-size: 0.92rem; }
.footer-inner nav a:hover { color: var(--text); }

/* Aparición al hacer scroll (solo si el JS está activo) */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.js .reveal.visible { opacity: 1; transform: none; }

/* Responsive */
@media (max-width: 960px) {
  .hero-grid, .theme-grid, .privacy-grid { grid-template-columns: 1fr; }
  .hero-copy { text-align: center; }
  .lead { margin-inline: auto; }
  .hero-actions, .trust { justify-content: center; }
  .hero-visual { height: 560px; max-width: 520px; width: 100%; margin: 0 auto; }
  .features { grid-template-columns: 1fr 1fr; }
  .tour { grid-template-columns: 1fr; gap: 32px; }
  .tour-visual { order: -1; width: 280px; margin: 0 auto; }
  .tour-tabs { grid-template-columns: 1fr 1fr; }
  .section-head.left { text-align: center; margin: 0 auto; }
  .theme-phones .phone:last-child { transform: translateY(24px); }
}

@media (max-width: 720px) {
  .main-nav { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--border); }
  .features { grid-template-columns: 1fr; }
  .tour-tabs { grid-template-columns: 1fr; }
  .tour-tabs button span { display: none; }
  .tour-tabs { display: flex; overflow-x: auto; gap: 8px; padding-bottom: 4px; scrollbar-width: none; }
  .tour-tabs button { flex: 0 0 auto; padding: 10px 16px; border-radius: 999px; border-color: var(--border); }
  .hero-visual { height: 470px; }
  .phone-front, .phone-back { width: 210px; }
  .phone { border-radius: 30px; padding: 7px; }
  .phone img { border-radius: 24px; }
  .chip-income { top: 70px; right: 0; }
  .chip-budget { bottom: 30px; min-width: 170px; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-inner nav { justify-content: center; }
}

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