/* ===================== TOKENS ===================== */
:root {
  --bg: #0b1020;
  --bg-soft: #0f152b;
  --surface: #ffffff;
  --surface-2: #f6f8fc;
  --ink: #0b1020;
  --ink-soft: #475069;
  --line: #e6eaf2;
  --brand: #0ea5a3;
  --brand-2: #38bdf8;
  --brand-ink: #0c7d7b;
  --warn: #d97706;
  --ok: #16a34a;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 12px 40px rgba(15, 23, 42, .12);
  --shadow-sm: 0 4px 16px rgba(15, 23, 42, .08);
  --container: 1120px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--surface);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.15; margin: 0; letter-spacing: -.02em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

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

.grad {
  background: linear-gradient(100deg, var(--brand-2), var(--brand));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ===================== BUTTONS ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-weight: 600; font-size: 15px;
  border-radius: 999px; padding: 12px 22px; border: 1px solid transparent;
  cursor: pointer; transition: transform .12s ease, box-shadow .2s ease, background .2s ease, opacity .2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: linear-gradient(120deg, var(--brand-2), var(--brand));
  color: #fff; box-shadow: 0 8px 22px rgba(14, 165, 163, .35);
}
.btn--primary:hover { box-shadow: 0 10px 28px rgba(14, 165, 163, .45); }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--lg { padding: 15px 28px; font-size: 16px; }
.btn--sm { padding: 9px 16px; font-size: 14px; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

/* ===================== NAV ===================== */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .8);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 18px; letter-spacing: -.02em; }
.brand strong { color: var(--brand); font-weight: 800; }
.brand__mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--bg); }
.nav__links { display: flex; gap: 26px; }
.nav__links a { font-size: 15px; color: var(--ink-soft); font-weight: 500; transition: color .15s ease; }
.nav__links a:hover { color: var(--ink); }

/* ===================== HERO ===================== */
.hero {
  position: relative;
  background: radial-gradient(1200px 500px at 70% -10%, #103a4f 0%, var(--bg) 55%);
  color: #eaf0ff; overflow: hidden; padding: 84px 0 96px;
}
.hero__glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(600px 300px at 15% 10%, rgba(56, 189, 248, .18), transparent 60%),
    radial-gradient(500px 280px at 90% 80%, rgba(14, 165, 163, .22), transparent 60%);
  pointer-events: none;
}
.hero__inner { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.badge {
  display: inline-block; font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); color: #cdeefb; margin-bottom: 22px;
}
.hero h1 { font-size: clamp(34px, 5vw, 56px); font-weight: 900; margin-bottom: 18px; }
.hero__sub { font-size: clamp(16px, 2vw, 19px); color: #b9c2e0; max-width: 560px; margin-bottom: 30px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; }
.hero__cta .btn--ghost { color: #eaf0ff; border-color: rgba(255, 255, 255, .22); }
.hero__cta .btn--ghost:hover { background: rgba(255, 255, 255, .08); }
.hero__trust { display: flex; flex-wrap: wrap; gap: 20px; list-style: none; padding: 0; margin: 28px 0 0; font-size: 14px; color: #9fd4dc; }

/* Hero art: factura con datos tapados */
.hero__art { display: grid; place-items: center; }
.bill-card {
  position: relative; width: 100%; max-width: 360px; aspect-ratio: .72 / 1;
  background: linear-gradient(135deg, #fdfdff, #eef2fb); border-radius: 14px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .45); padding: 26px 24px; overflow: hidden;
  transform: rotate(-3deg); color: #1b2550;
}
.bill-card__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.bill-card__logo { font-size: 15px; font-weight: 900; letter-spacing: -.02em; color: var(--brand-ink); }
.bill-card__tag { font-size: 9px; font-weight: 800; letter-spacing: .1em; color: #7a86a8; }
.bill-card__lines { display: flex; flex-direction: column; gap: 11px; }
.bill-card__lines span { height: 9px; border-radius: 5px; background: #c2cbe4; }
.bill-card__lines .lbl { width: 38%; background: #9fb0dc; height: 7px; }
.bill-card__lines .red { background: #0b1020; }
.bill-card__lines .w70 { width: 70%; } .bill-card__lines .w55 { width: 55%; } .bill-card__lines .w85 { width: 85%; }
.bill-card hr { border: none; border-top: 1px dashed #c2cbe4; margin: 18px 0; }
.bill-card__ok {
  position: absolute; right: 16px; bottom: 16px; width: 64px; height: 64px; border-radius: 50%;
  border: 4px solid rgba(14,165,163,.85); display: grid; place-items: center; transform: rotate(-12deg);
}
.bill-card__ok::after {
  content: "✓"; color: var(--brand-ink); font-size: 30px; font-weight: 900;
}

/* ===================== STRIP ===================== */
.strip { background: var(--bg-soft); color: #8e9bbd; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.strip__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px; padding: 16px 24px; font-size: 14px; font-weight: 500; }
.strip .dot { opacity: .4; }

/* ===================== SECTIONS ===================== */
.section { padding: 84px 0; }
.section--alt { background: var(--surface-2); }
.section__head { max-width: 720px; margin: 0 auto 48px; text-align: center; }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--brand); margin-bottom: 12px; }
.section__head h2 { font-size: clamp(26px, 3.5vw, 38px); font-weight: 800; margin-bottom: 14px; }
.section__head p { color: var(--ink-soft); font-size: 17px; }
.privacy-note { display: inline-block; background: #d9f5f4; color: var(--brand-ink); font-weight: 600; font-size: 14px; padding: 8px 16px; border-radius: 999px; }

/* ===================== GRID & CARDS ===================== */
.grid { display: grid; gap: 22px; }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); }
.feature__icon { width: 50px; height: 50px; display: grid; place-items: center; font-size: 24px; border-radius: 12px; background: linear-gradient(135deg, #d9f5f4, #e2f3ff); margin-bottom: 16px; }
.feature h3 { font-size: 18px; margin-bottom: 8px; }
.feature p { color: var(--ink-soft); font-size: 15px; }

/* Tarjetas "qué se borra / qué se mantiene" */
.kept-removed { gap: 22px; }
.kr-card { border-radius: var(--radius); padding: 26px; border: 1px solid var(--line); }
.kr-card h3 { font-size: 18px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.kr-card ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.kr-card li { font-size: 15px; display: flex; gap: 9px; align-items: flex-start; }
.kr-card li::before { font-weight: 800; flex: none; }
.kr-card--removed { background: #fff4f4; border-color: #f6d2d2; }
.kr-card--removed li::before { content: "✕"; color: #dc2626; }
.kr-card--kept { background: #ecfdf3; border-color: #c7ecd2; }
.kr-card--kept li::before { content: "✓"; color: var(--ok); }

/* ===================== STEPS ===================== */
.steps .step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 26px; position: relative; }
.step__num { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--brand-2), var(--brand)); margin-bottom: 16px; }
.step h3 { font-size: 19px; margin-bottom: 8px; }
.step p { color: var(--ink-soft); font-size: 15px; }

/* ===================== APP / HERRAMIENTA ===================== */
.app { display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: stretch; }
.app__stage { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-height: 480px; display: grid; padding: 18px; box-shadow: var(--shadow-sm); }

.dropzone {
  border: 2px dashed #b7d8d7; border-radius: 14px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; gap: 6px; cursor: pointer;
  transition: border-color .15s ease, background .15s ease; padding: 40px;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--brand); background: #f1fbfa; outline: none; }
.dropzone.is-drag { border-color: var(--brand); background: #e6f7f6; }
.dropzone__icon { font-size: 46px; }
.dropzone__title { font-size: 18px; font-weight: 700; }
.dropzone__hint { color: var(--ink-soft); font-size: 14px; }

/* Lienzo */
.canvas-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.canvas-scroll { width: 100%; overflow: auto; display: flex; justify-content: center; }
#canvas { max-width: 100%; max-height: 60vh; border-radius: 10px; box-shadow: var(--shadow); touch-action: none; cursor: crosshair; background: #fff; }
.canvas-hint { font-size: 13px; color: var(--brand-ink); background: #d9f5f4; padding: 6px 14px; border-radius: 999px; font-weight: 600; text-align: center; }

/* Barra de herramientas sobre el lienzo */
.stage-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.pager { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 15px; color: var(--ink);
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }

/* Capa de progreso (OCR / render PDF) */
.busy { position: relative; }
.busy__overlay {
  position: absolute; inset: 0; background: rgba(11, 16, 32, .82); color: #eaf0ff; border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 30px; text-align: center; z-index: 5;
}
.busy__overlay h4 { font-size: 17px; font-weight: 700; }
.busy__overlay p { font-size: 14px; color: #b9c2e0; max-width: 320px; }
.bar { width: min(280px, 80%); height: 8px; border-radius: 999px; background: rgba(255,255,255,.15); overflow: hidden; }
.bar__fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--brand-2), var(--brand)); transition: width .25s ease; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,255,255,.2); border-top-color: var(--brand-2); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Panel */
.app__panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 18px; box-shadow: var(--shadow-sm); }
.panel__group { display: flex; flex-direction: column; gap: 14px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.panel__group:last-of-type { border-bottom: none; padding-bottom: 0; }
.panel__group h4 { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
.panel__row { display: flex; flex-direction: column; gap: 6px; }
.panel__row label { font-size: 13px; font-weight: 600; color: var(--ink-soft); display: flex; justify-content: space-between; align-items: center; }
.panel__row output { font-weight: 700; color: var(--brand-ink); }
.panel__row--inline { flex-direction: row; align-items: center; gap: 12px; flex-wrap: wrap; }
.panel__row--inline label { flex-direction: row; }
.panel__hint { font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; }

input[type="text"], input[type="email"], select { width: 100%; font-family: inherit; font-size: 14px; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
input[type="text"]:focus, input[type="email"]:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14, 165, 163, .15); }
input[type="range"] { width: 100%; accent-color: var(--brand); }

/* Checkboxes de categorías a detectar */
.checks { display: flex; flex-direction: column; gap: 9px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); }

.toggle { display: flex; align-items: center; gap: 10px; width: 100%; font-family: inherit; font-size: 14px; font-weight: 600; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink); }
.toggle__dot { width: 38px; height: 22px; border-radius: 999px; flex: none; background: #cdd5e6; position: relative; transition: background .15s ease; }
.toggle__dot::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s ease; }
.toggle[aria-pressed="true"] { border-color: var(--brand); color: var(--brand-ink); }
.toggle[aria-pressed="true"] .toggle__dot { background: var(--brand); }
.toggle[aria-pressed="true"] .toggle__dot::after { transform: translateX(16px); }

.muted { color: var(--ink-soft); font-size: 13px; }
.count-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--brand-ink); background: #d9f5f4; padding: 4px 12px; border-radius: 999px; align-self: flex-start; }
.count-pill--zero { color: var(--ink-soft); background: var(--surface-2); }

.panel__actions { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.format-row { justify-content: space-between; gap: 10px; }
.format-row label { flex: none; }
.format-row select { flex: 1; min-width: 0; }

.review-warn { font-size: 12.5px; color: var(--warn); background: #fff7ed; border: 1px solid #fde7c8; border-radius: var(--radius-sm); padding: 10px 12px; line-height: 1.5; }

/* ===================== GRATIS ===================== */
.free-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 40px 32px; text-align: center; max-width: 480px; margin: 0 auto; position: relative; overflow: hidden; }
.free-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: linear-gradient(100deg, var(--brand-2), var(--brand)); }
.free-card__price { font-size: 64px; font-weight: 900; letter-spacing: -.04em; line-height: 1; background: linear-gradient(120deg, var(--brand-2), var(--brand)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.free-card__tag { color: var(--ink-soft); font-size: 14px; margin: 8px 0 24px; }
.free-card__features { list-style: none; padding: 0; margin: 0 auto 28px; display: inline-flex; flex-direction: column; gap: 12px; text-align: left; }
.free-card__features li { font-size: 15px; }

/* ===================== FAQ ===================== */
.faq { display: flex; flex-direction: column; gap: 12px; }
.faq__item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px 20px; }
.faq__item summary { cursor: pointer; font-weight: 600; padding: 16px 0; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after { content: "+"; font-size: 22px; color: var(--brand); font-weight: 400; }
.faq__item[open] summary::after { content: "−"; }
.faq__item p { color: var(--ink-soft); padding-bottom: 18px; font-size: 15px; }

/* ===================== CTA FINAL ===================== */
.cta-final { background: radial-gradient(800px 300px at 50% 0%, #103a4f, var(--bg)); color: #eaf0ff; text-align: center; padding: 80px 0; }
.cta-final h2 { font-size: clamp(26px, 4vw, 40px); font-weight: 900; margin-bottom: 12px; }
.cta-final p { color: #b9c2e0; font-size: 18px; margin-bottom: 28px; }

/* ===================== FOOTER ===================== */
.footer { background: var(--bg); color: #9fb0dc; padding: 56px 0 28px; }
.footer__inner { display: grid; grid-template-columns: 1.4fr 2fr; gap: 40px; }
.footer__brand .brand { color: #eaf0ff; margin-bottom: 12px; }
.footer__brand .brand strong { color: var(--brand-2); }
.footer__brand p { font-size: 14px; max-width: 280px; }
.footer__cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.footer__cols h4 { color: #eaf0ff; font-size: 14px; margin-bottom: 12px; }
.footer__cols a { display: block; font-size: 14px; padding: 4px 0; transition: color .15s ease; }
.footer__cols a:hover { color: #eaf0ff; }
.footer__bottom { margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 13px; color: #6b7aa3; line-height: 1.7; }
.footer__bottom strong { color: #9fb0dc; font-weight: 700; }
.footer__bottom a { color: #9fb0dc; text-decoration: underline; text-underline-offset: 2px; }
.footer__bottom a:hover { color: #eaf0ff; }

/* ===================== PÁGINAS LEGALES ===================== */
.legal { padding: 48px 0 80px; }
.legal .breadcrumb { font-size: 13px; color: var(--ink-soft); margin-bottom: 18px; }
.legal .breadcrumb a { color: var(--brand-ink); text-decoration: underline; text-underline-offset: 2px; }
.legal h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 900; margin-bottom: 10px; }
.legal .legal__updated { color: var(--ink-soft); font-size: 14px; margin-bottom: 28px; }
.legal h2 { font-size: 21px; font-weight: 800; margin: 34px 0 10px; }
.legal h3 { font-size: 17px; font-weight: 700; margin: 22px 0 6px; }
.legal p, .legal li { color: #2b3550; font-size: 16px; line-height: 1.75; }
.legal p { margin: 12px 0; }
.legal ul { margin: 10px 0; padding-left: 22px; }
.legal li { margin: 6px 0; }
.legal a { color: var(--brand-ink); text-decoration: underline; text-underline-offset: 2px; }
.legal a:hover { color: var(--brand); }
.legal__card {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px; margin: 18px 0 6px;
}
.legal__card dl { display: grid; grid-template-columns: 180px 1fr; gap: 8px 16px; margin: 0; }
.legal__card dt { font-weight: 700; color: var(--ink); }
.legal__card dd { margin: 0; color: #2b3550; }
.legal__note { background: #ecfdf3; border: 1px solid #c7ecd2; border-radius: var(--radius-sm); padding: 14px 18px; margin: 18px 0; font-size: 15px; }
@media (max-width: 560px) { .legal__card dl { grid-template-columns: 1fr; gap: 2px 0; } .legal__card dt { margin-top: 8px; } }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 940px) {
  .nav__links { display: none; }
  .hero__inner { grid-template-columns: 1fr; gap: 40px; }
  .hero__art { order: -1; }
  .bill-card { max-width: 300px; }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .app { grid-template-columns: 1fr; }
  .app__panel { order: 2; }
}
@media (max-width: 720px) {
  .section { padding: 60px 0; }
  .grid--3, .grid--2, .kept-removed { grid-template-columns: 1fr; }
  .footer__inner { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 480px) {
  .grid--4 { grid-template-columns: 1fr; }
  .footer__cols { grid-template-columns: repeat(2, 1fr); }
}
