/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #f5f7f6;
  --surface: #ffffff;
  --surface-alt: #eef3f0;
  --ink: #10151f;
  --ink-soft: #525b6b;
  --ink-faint: #8791a1;
  --border: #dfe6e2;
  --border-strong: #c3d0c9;

  --navy: #0e1a1f;
  --navy-soft: #17272c;
  --accent: #0e9f6e;
  --accent-dark: #0b7d57;
  --accent-soft: #e3f9f0;
  --danger: #b3261e;
  --danger-soft: #fbeae9;
  --warn: #9a6700;
  --warn-soft: #fff3d6;
  --ok: #0d7d3f;
  --ok-soft: #e6f6ec;

  --radius-s: 6px;
  --radius-m: 12px;
  --radius-l: 20px;

  --shadow-s: 0 1px 2px rgba(14, 26, 31, 0.07), 0 1px 1px rgba(14, 26, 31, 0.04);
  --shadow-m: 0 4px 16px rgba(14, 26, 31, 0.09), 0 2px 6px rgba(14, 26, 31, 0.05);
  --shadow-l: 0 16px 48px rgba(14, 26, 31, 0.16), 0 4px 12px rgba(14, 26, 31, 0.08);

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --header-h: 72px;
  --container: 1180px;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; overflow-x: clip; scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  font-family: var(--sans); font-size: 16px; line-height: 1.6; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip; overscroll-behavior-y: none;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
ul, ol { list-style: none; padding: 0; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.08; letter-spacing: -0.02em; font-family: var(--serif); font-weight: 600; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* =============================================================
   3. Utilidades
   ============================================================= */
.skip-link { position: fixed; top: -100px; left: 1rem; z-index: 9999; padding: .6rem 1rem; background: var(--navy); color: #fff; border-radius: 8px; font-weight: 600; transition: top .25s var(--ease-out); }
.skip-link:focus { top: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 1.25rem; }
.container-narrow { width: 100%; max-width: 780px; margin-inline: auto; padding-inline: 1.25rem; }
.section { padding-block: clamp(3.5rem, 7vw, 6.5rem); }
.eyebrow { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--mono); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-dark); font-weight: 600; }
.eyebrow::before { content: ""; width: 8px; height: 8px; background: var(--accent); border-radius: 2px; display: inline-block; }
.section-head { max-width: 640px; margin-bottom: clamp(2rem, 4vw, 3.25rem); }
.section-head p { color: var(--ink-soft); font-size: 1.08rem; margin-top: .85rem; }
.center { text-align: center; margin-inline: auto; }
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-split] { opacity: 1; transform: none; }

/* =============================================================
   4. Tipografía
   ============================================================= */
h1 { font-size: clamp(2.3rem, 4.6vw, 3.6rem); }
h2 { font-size: clamp(1.75rem, 3.2vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 1.6vw, 1.4rem); }
.lede { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--ink-soft); }

/* =============================================================
   5. Componentes
   ============================================================= */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .85rem 1.5rem; border-radius: var(--radius-s); font-weight: 600; font-size: .96rem; transition: transform .2s var(--ease-out), background .2s var(--ease-out), box-shadow .2s var(--ease-out), border-color .2s var(--ease-out); white-space: nowrap; }
.btn-primary { background: var(--navy); color: #fff; box-shadow: var(--shadow-s); }
.btn-primary:hover { background: var(--navy-soft); transform: translateY(-1px); box-shadow: var(--shadow-m); }
.btn-accent { background: var(--accent); color: #fff; box-shadow: var(--shadow-s); }
.btn-accent:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: var(--shadow-m); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--border-strong); }
.btn-ghost:hover { border-color: var(--ink); background: var(--surface-alt); }
.btn-block { width: 100%; }
.btn-sm { padding: .55rem 1rem; font-size: .86rem; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.badge { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .7rem; border-radius: 999px; font-size: .78rem; font-weight: 600; font-family: var(--mono); }
.badge-accent { background: var(--accent-soft); color: var(--accent-dark); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-demo { background: repeating-linear-gradient(135deg, #fff3d6, #fff3d6 6px, #ffe9b3 6px, #ffe9b3 12px); color: #7a5300; border: 1px solid #f0c869; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-m); box-shadow: var(--shadow-s); }
.card-pad { padding: clamp(1.5rem, 3vw, 2.25rem); }

.field { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1.1rem; }
.field label { font-size: .88rem; font-weight: 600; color: var(--ink); }
.field .hint { font-size: .8rem; color: var(--ink-faint); }
.field input, .field select { padding: .8rem .9rem; border: 1px solid var(--border-strong); border-radius: var(--radius-s); background: var(--surface); transition: border-color .2s var(--ease-out), box-shadow .2s var(--ease-out); width: 100%; }
.field input:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.form-error-box { background: var(--danger-soft); color: var(--danger); border-radius: var(--radius-s); padding: .8rem 1rem; font-size: .9rem; margin-bottom: 1rem; display: none; }
.form-error-box.is-visible { display: block; }
.checkbox-row { display: flex; align-items: flex-start; gap: .6rem; font-size: .88rem; color: var(--ink-soft); }
.checkbox-row input { margin-top: .2rem; }

.site-header { position: sticky; top: 0; z-index: 200; height: var(--header-h); display: flex; align-items: center; background: rgba(245, 247, 246, 0.86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
@supports not (backdrop-filter: blur(10px)) { .site-header { background: var(--bg); } }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .55rem; font-family: var(--serif); font-weight: 700; font-size: 1.2rem; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--navy); position: relative; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--accent); font-family: var(--mono); font-weight: 700; font-size: .85rem; }
.nav-links { display: none; align-items: center; gap: 1.9rem; font-weight: 500; font-size: .95rem; color: var(--ink-soft); }
.nav-links a:hover { color: var(--ink); }
.nav-cta { display: flex; align-items: center; gap: .7rem; }
.nav-toggle { display: inline-flex; }
@media (min-width: 960px) { .nav-links { display: flex; } .nav-toggle { display: none; } }
.mobile-menu { position: fixed; inset: var(--header-h) 0 0 0; background: var(--bg); z-index: 190; padding: 2rem 1.25rem; display: none; overflow-y: auto; }
.mobile-menu.is-open { display: block; }
.mobile-menu a { display: block; padding: .9rem 0; border-bottom: 1px solid var(--border); font-size: 1.1rem; font-weight: 600; }
.mobile-menu .nav-cta { flex-direction: column; margin-top: 1.5rem; }

.app-shell { display: flex; min-height: 100svh; }
.app-side { width: 240px; flex-shrink: 0; background: var(--navy); color: #fff; padding: 1.5rem 1.1rem; display: none; flex-direction: column; gap: 1.75rem; }
.app-side .brand { color: #fff; }
.app-side-nav { display: flex; flex-direction: column; gap: .2rem; flex: 1; }
.app-side-nav a { padding: .7rem .8rem; border-radius: var(--radius-s); color: rgba(255,255,255,.72); font-weight: 500; font-size: .94rem; display: flex; align-items: center; gap: .6rem; }
.app-side-nav a:hover, .app-side-nav a.is-active { background: rgba(255,255,255,.08); color: #fff; }
.app-usage-box { background: rgba(255,255,255,.06); border-radius: var(--radius-m); padding: 1rem; }
.app-usage-box .num { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; }
.app-usage-box .label { font-size: .78rem; color: rgba(255,255,255,.6); text-transform: uppercase; letter-spacing: .06em; }
@media (min-width: 960px) { .app-side { display: flex; } }
.app-main { flex: 1; min-width: 0; }
.app-topbar { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; padding-inline: 1.25rem; border-bottom: 1px solid var(--border); background: var(--surface); gap: 1rem; }
.app-topbar-mobile-usage { font-size: .85rem; font-weight: 600; color: var(--ink-soft); }
@media (min-width: 960px) { .app-topbar-mobile-usage { display: none; } }
.app-content { padding: clamp(1.25rem, 3vw, 2.5rem); max-width: 1080px; margin-inline: auto; }

.alert { display: flex; gap: .8rem; align-items: flex-start; padding: 1rem 1.1rem; border-radius: var(--radius-m); font-size: .92rem; }
.alert-warn { background: var(--warn-soft); color: #6b4d00; }
.alert-danger { background: var(--danger-soft); color: var(--danger); }
.alert-info { background: var(--accent-soft); color: var(--accent-dark); }
.alert strong { display: block; margin-bottom: .15rem; }

.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--radius-l); background: var(--surface); padding: clamp(2.5rem, 6vw, 4rem) 1.5rem; text-align: center; transition: border-color .2s var(--ease-out), background .2s var(--ease-out); }
.dropzone.is-drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone-icon { width: 64px; height: 64px; margin-inline: auto; margin-bottom: 1.25rem; border-radius: var(--radius-m); background: var(--surface-alt); display: flex; align-items: center; justify-content: center; font-size: 1.8rem; }

/* Resultados */
.stat-hero { display: grid; gap: 1.25rem; grid-template-columns: 1fr; margin-bottom: 1.5rem; }
@media (min-width: 720px) { .stat-hero { grid-template-columns: repeat(3, 1fr); } }
.stat-card { padding: 1.4rem; }
.stat-card .stat-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); font-weight: 700; margin-bottom: .4rem; }
.stat-card .stat-num { font-family: var(--serif); font-size: 2rem; font-weight: 700; }
.subscription-item { display: flex; align-items: center; gap: 1rem; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius-m); background: var(--surface); }
.subscription-item .meta { flex: 1; min-width: 0; }
.subscription-item .name { font-weight: 700; }
.subscription-item .sub { font-size: .84rem; color: var(--ink-faint); }
.subscription-item .amount { text-align: right; font-family: var(--mono); font-weight: 700; white-space: nowrap; }
.subscription-item .amount .per { display: block; font-size: .74rem; color: var(--ink-faint); font-weight: 500; }
.unknown-tag { font-size: .68rem; background: var(--surface-alt); color: var(--ink-faint); padding: .15rem .5rem; border-radius: 999px; margin-left: .4rem; }
.mapping-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .mapping-grid { grid-template-columns: repeat(3, 1fr); } }
.csv-preview { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-s); font-size: .78rem; }
.csv-preview table { width: 100%; border-collapse: collapse; }
.csv-preview th, .csv-preview td { padding: .4rem .6rem; border-bottom: 1px solid var(--border); white-space: nowrap; }

/* Precios */
.pricing-grid { display: grid; gap: 1.5rem; grid-template-columns: 1fr; max-width: 720px; margin-inline: auto; }
@media (min-width: 720px) { .pricing-grid { grid-template-columns: repeat(2, 1fr); } }
.plan-card { display: flex; flex-direction: column; padding: clamp(1.6rem, 3vw, 2.1rem); position: relative; }
.plan-card.is-highlight { border-color: var(--navy); box-shadow: var(--shadow-m); transform: translateY(-6px); }
.plan-card .plan-tag { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; font-size: .72rem; font-weight: 700; padding: .3rem .8rem; border-radius: 999px; letter-spacing: .04em; }
.plan-name { font-size: 1.1rem; font-weight: 700; font-family: var(--sans); }
.plan-price { display: flex; align-items: baseline; gap: .35rem; margin-block: .6rem .3rem; }
.plan-price .amount { font-family: var(--serif); font-size: 2.6rem; font-weight: 700; }
.plan-price .period { color: var(--ink-faint); font-size: .9rem; }
.plan-desc { color: var(--ink-soft); font-size: .92rem; margin-bottom: 1.3rem; min-height: 2.6em; }
.plan-features { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1.6rem; flex: 1; }
.plan-features li { display: flex; gap: .55rem; font-size: .92rem; align-items: flex-start; }
.plan-features li::before { content: "✓"; color: var(--accent); font-weight: 700; flex-shrink: 0; }

.steps-grid { display: grid; gap: 1.5rem; grid-template-columns: 1fr; counter-reset: step; }
@media (min-width: 720px) { .steps-grid { grid-template-columns: repeat(3, 1fr); } }
.step-card { position: relative; padding-top: 2.6rem; }
.step-card .step-num { counter-increment: step; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--navy); color: #fff; font-family: var(--serif); font-weight: 700; margin-bottom: 1rem; }
.step-card h3 { margin-bottom: .5rem; }
.step-card p { color: var(--ink-soft); font-size: .94rem; }

.feature-grid { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1180px) { .feature-grid { grid-template-columns: repeat(3, 1fr); } }
.feature-card { padding: 1.6rem; }
.feature-icon { width: 44px; height: 44px; border-radius: var(--radius-s); background: var(--accent-soft); color: var(--accent-dark); display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; font-size: 1.3rem; }
.feature-card h3 { margin-bottom: .5rem; }
.feature-card p { color: var(--ink-soft); font-size: .93rem; }

.faq-list { display: flex; flex-direction: column; gap: .7rem; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-m); background: var(--surface); overflow: hidden; }
.faq-item summary { padding: 1.1rem 1.3rem; font-weight: 600; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 1rem; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.4rem; color: var(--ink-faint); flex-shrink: 0; transition: transform .2s var(--ease-out); }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .faq-a { padding: 0 1.3rem 1.2rem; color: var(--ink-soft); font-size: .94rem; max-width: 62ch; }

.cta-band { background: var(--navy); color: #fff; border-radius: var(--radius-l); padding: clamp(2.5rem, 6vw, 4rem); text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,.72); margin-top: .8rem; }
.cta-band .btn-primary { background: #fff; color: var(--navy); }
.cta-band .btn-primary:hover { background: #eef1f5; }

.hero { padding-block: clamp(3rem, 8vw, 6rem) clamp(2rem, 6vw, 4rem); }
.hero-grid { display: grid; gap: 2.5rem; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 1024px) { .hero-grid { grid-template-columns: 1.05fr 1fr; } }
.hero-copy .badge { margin-bottom: 1.3rem; }
.hero-copy h1 { margin-bottom: 1.1rem; }
.hero-copy .lede { margin-bottom: 1.7rem; max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .9rem; margin-bottom: 1.5rem; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 1.4rem; font-size: .84rem; color: var(--ink-faint); }
.hero-trust span { display: flex; align-items: center; gap: .4rem; }

.auth-shell { min-height: 100svh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 960px) { .auth-shell { grid-template-columns: 1fr 1fr; } }
.auth-visual { display: none; background: var(--navy); color: #fff; padding: 3rem; position: relative; }
@media (min-width: 960px) { .auth-visual { display: flex; flex-direction: column; justify-content: space-between; } }
.auth-form-side { display: flex; align-items: center; justify-content: center; padding: 2.5rem 1.25rem; }
.auth-box { width: 100%; max-width: 420px; }
.auth-box h1 { font-size: 1.7rem; margin-bottom: .4rem; }
.auth-box .lede { font-size: .96rem; margin-bottom: 1.8rem; }
.auth-switch { text-align: center; margin-top: 1.4rem; font-size: .92rem; color: var(--ink-soft); }
.auth-switch a { color: var(--accent-dark); font-weight: 600; }

dialog.modal { border: 0; border-radius: var(--radius-l); padding: 0; width: min(480px, 92vw); box-shadow: var(--shadow-l); }
dialog.modal::backdrop { background: rgba(14, 26, 31, .55); backdrop-filter: blur(2px); }
.modal-body { padding: clamp(1.5rem, 4vw, 2.2rem); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.2rem; }
.modal-close { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.modal-close:hover { background: var(--surface-alt); }
.demo-notice { display: flex; gap: .6rem; background: var(--warn-soft); color: #6b4d00; border-radius: var(--radius-s); padding: .8rem .9rem; font-size: .84rem; margin-bottom: 1.3rem; align-items: flex-start; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-m); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 480px; }
th, td { padding: .8rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
th { font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); font-weight: 700; }
tr:last-child td { border-bottom: 0; }

.site-footer { background: var(--navy); color: rgba(255,255,255,.72); padding-block: 3.5rem 2rem; }
.footer-grid { display: grid; gap: 2.5rem; grid-template-columns: 1fr; margin-bottom: 2.5rem; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.4fr repeat(3, 1fr); } }
.footer-grid .brand { color: #fff; margin-bottom: .8rem; }
.footer-grid p { font-size: .9rem; max-width: 30ch; }
.footer-col h4 { font-family: var(--sans); font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,.5); margin-bottom: .9rem; }
.footer-col a { display: block; font-size: .92rem; padding-block: .3rem; }
.footer-col a:hover { color: #fff; }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; padding-top: 1.75rem; border-top: 1px solid rgba(255,255,255,.12); font-size: .82rem; }

.legal-content h2 { margin-block: 2rem .8rem; font-size: 1.3rem; }
.legal-content p, .legal-content li { color: var(--ink-soft); margin-bottom: .8rem; }
.legal-content li { list-style: disc; margin-left: 1.4rem; }
.legal-content strong { color: var(--ink); }

.spinner { width: 22px; height: 22px; border: 3px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-row { display: flex; align-items: center; gap: .7rem; color: var(--ink-soft); font-size: .92rem; }

@media (prefers-reduced-motion: reduce) { .reveal { transition: none; opacity: 1; transform: none; } }

.hide-mobile { display: none; }
@media (min-width: 720px) { .hide-mobile { display: initial; } }
.only-mobile { display: initial; }
@media (min-width: 720px) { .only-mobile { display: none; } }
