/* Gestor Financiero — sitio público.
   Colores tomados de la app (front-gestor-financiero/lib/core/theme/app_colors.dart). */

:root {
  --brand: #2e5eaa;
  --brand-strong: #244b8a;
  --brand-soft: #e8eef8;
  --income: #1b8a5a;
  --expense: #c0392b;
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-alt: #eef1f7;
  --text: #1a1d29;
  --text-muted: #5b6272;
  --border: #dde2ec;
  --shadow: 0 1px 2px rgb(16 24 40 / 6%), 0 8px 24px rgb(16 24 40 / 8%);
  --radius: 14px;
  --radius-sm: 10px;
  --max: 1120px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #6f9be0;
    --brand-strong: #8fb2ea;
    --brand-soft: #1c2940;
    --income: #3cc48a;
    --expense: #ef6b5d;
    --bg: #0f131b;
    --surface: #171c26;
    --surface-alt: #1d2330;
    --text: #e7eaf1;
    --text-muted: #a0a8b8;
    --border: #2a3242;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 35%);
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--brand);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--brand-strong);
}

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

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.1rem);
}

h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
}

h3 {
  font-size: 1.1rem;
}

p {
  margin: 0 0 1em;
}

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

@media (min-width: 720px) {
  .container {
    padding: 0 24px;
  }
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--surface);
  padding: 8px 12px;
  z-index: 100;
}

.skip-link:focus {
  left: 8px;
}

/* --- Encabezado --------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  color: var(--text);
}

.brand-mark {
  width: 32px;
  height: 32px;
  flex: none;
}

.nav-links {
  display: none;
  align-items: center;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.nav-cta {
  display: none;
}

@media (min-width: 880px) {
  .nav-links,
  .nav-cta {
    display: flex;
  }

  .nav-toggle {
    display: none;
  }
}

.mobile-menu {
  display: none;
  border-top: 1px solid var(--border);
  padding: 12px 0 16px;
}

.mobile-menu.open {
  display: block;
}

.mobile-menu ul {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}

.mobile-menu li a {
  display: block;
  padding: 10px 0;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

@media (min-width: 880px) {
  .mobile-menu,
  .mobile-menu.open {
    display: none;
  }
}

/* --- Botones ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-primary:hover {
  background: var(--brand-strong);
  color: #fff;
}

@media (prefers-color-scheme: dark) {
  .btn-primary,
  .btn-primary:hover {
    color: #0f131b;
  }
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.btn-block {
  width: 100%;
}

.btn[aria-disabled="true"] {
  opacity: 0.55;
  pointer-events: none;
}

/* --- Hero ----------------------------------------------------------------- */

.hero {
  padding: 56px 0 40px;
}

.hero-grid {
  display: grid;
  gap: 40px;
  align-items: center;
}

@media (min-width: 880px) {
  .hero {
    padding: 88px 0 64px;
  }

  .hero-grid {
    grid-template-columns: 1.05fr 0.95fr;
  }
}

.eyebrow {
  display: inline-block;
  margin-bottom: 16px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.85rem;
  font-weight: 600;
}

.lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 34em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.hero-note {
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Maqueta del dashboard (solo decorativa). */
.mock {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.mock-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}

.mock-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.mock-balance {
  font-size: 1.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.mock-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.mock-tile {
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.mock-tile strong {
  display: block;
  font-variant-numeric: tabular-nums;
}

.up {
  color: var(--income);
}

.down {
  color: var(--expense);
}

.mock-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 96px;
  padding: 8px 4px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.mock-bars span {
  flex: 1;
  border-radius: 6px 6px 0 0;
  background: var(--brand);
  opacity: 0.85;
}

.mock-bars span.alt {
  background: var(--income);
}

.mock-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mock-list li {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

.mock-list li:last-child {
  border-bottom: 0;
}

.mock-list .amount {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* --- Secciones ------------------------------------------------------------ */

.section {
  padding: 56px 0;
}

@media (min-width: 880px) {
  .section {
    padding: 80px 0;
  }
}

.section-alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  max-width: 40em;
  margin-bottom: 32px;
}

.section-head p {
  color: var(--text-muted);
}

.grid-3 {
  display: grid;
  gap: 16px;
}

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

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.section-alt .card {
  background: var(--bg);
}

.card p {
  color: var(--text-muted);
  margin: 0;
}

.card-icon {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  margin-bottom: 12px;
}

.card-icon svg {
  width: 22px;
  height: 22px;
}

.tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  vertical-align: middle;
  background: var(--brand-soft);
  color: var(--brand);
}

.tag-soon {
  background: var(--surface-alt);
  color: var(--text-muted);
}

/* --- Pasos ---------------------------------------------------------------- */

.steps {
  display: grid;
  gap: 16px;
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0;
}

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

.steps li {
  counter-increment: step;
  position: relative;
  padding: 20px 20px 20px 64px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 20px;
  top: 20px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
}

@media (prefers-color-scheme: dark) {
  .steps li::before {
    color: #0f131b;
  }
}

.steps p {
  margin: 0;
  color: var(--text-muted);
}

/* --- Planes --------------------------------------------------------------- */

.plans {
  display: grid;
  gap: 16px;
  margin-bottom: 40px;
}

@media (min-width: 760px) {
  .plans {
    grid-template-columns: 1fr 1fr;
  }
}

.plan {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.plan-featured {
  border: 2px solid var(--brand);
  box-shadow: var(--shadow);
}

.plan-price {
  font-size: 2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin: 4px 0 2px;
}

.plan-period {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.plan ul {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  flex: 1;
}

.plan li {
  position: relative;
  padding: 6px 0 6px 28px;
}

.plan li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 12px;
  width: 14px;
  height: 8px;
  border-left: 2.5px solid var(--income);
  border-bottom: 2.5px solid var(--income);
  transform: rotate(-45deg);
}

.price-options {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.price-option {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.price-option strong {
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
}

.price-option small {
  color: var(--text-muted);
}

.price-option-info {
  display: grid;
  gap: 2px;
}

.price-option-note {
  display: block;
  font-size: 0.85rem;
}

.price-option-promo {
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.price-badge {
  justify-self: start;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand);
  color: var(--surface);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.fine-print {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 12px 0 0;
}

/* Tabla comparativa */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.compare {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.compare caption {
  text-align: left;
  padding: 16px 16px 0;
  font-weight: 700;
}

.compare th,
.compare td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.compare thead th {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.compare tbody tr:last-child th,
.compare tbody tr:last-child td {
  border-bottom: 0;
}

.compare td {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.compare .yes {
  color: var(--income);
  font-weight: 600;
}

.compare .no {
  color: var(--text-muted);
}

.compare .group th {
  background: var(--surface-alt);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

/* --- FAQ -------------------------------------------------------------------- */

.faq {
  display: grid;
  gap: 12px;
  max-width: 820px;
}

.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 18px;
}

.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 28px 16px 0;
  font-weight: 600;
  position: relative;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 13px;
  font-size: 1.3rem;
  color: var(--text-muted);
}

.faq details[open] summary::after {
  content: "–";
}

.faq details p {
  color: var(--text-muted);
  padding-bottom: 8px;
}

/* --- CTA final -------------------------------------------------------------- */

.cta-band {
  text-align: center;
  background: var(--brand);
  color: #fff;
  border-radius: 22px;
  padding: 40px 20px;
}

.cta-band p {
  color: rgb(255 255 255 / 85%);
}

.cta-band .btn-primary {
  background: #fff;
  color: var(--brand);
}

@media (prefers-color-scheme: dark) {
  .cta-band {
    background: var(--brand-soft);
    color: var(--text);
  }

  .cta-band p {
    color: var(--text-muted);
  }

  .cta-band .btn-primary {
    background: var(--brand);
    color: #0f131b;
  }
}

/* --- Pie ---------------------------------------------------------------- */

.site-footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.92rem;
}

.footer-grid {
  display: grid;
  gap: 24px;
}

@media (min-width: 720px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li {
  padding: 4px 0;
}

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

.site-footer a:hover {
  color: var(--text);
}

.footer-title {
  color: var(--text);
  font-weight: 600;
  margin-bottom: 8px;
}

/* --- Páginas legales ---------------------------------------------------- */

.legal {
  max-width: 780px;
  padding: 48px 0 64px;
}

.legal h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
}

.legal h2 {
  font-size: 1.3rem;
  margin-top: 2em;
}

.legal .updated {
  color: var(--text-muted);
}

.legal li {
  margin-bottom: 0.4em;
}

.draft-note {
  border: 1px dashed var(--expense);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin: 16px 0 24px;
  font-size: 0.92rem;
}

.placeholder {
  background: color-mix(in srgb, var(--expense) 15%, transparent);
  border-radius: 4px;
  padding: 0 4px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}
