/* Layout: una columna de lectura en celular; en pantallas grandes el hero se abre en dos columnas
   (propuesta | póliza marcada con resaltador) y el formulario queda centrado y angosto. */
@font-face { font-family: 'Archivo RB'; src: url('/fonts/archivo-800.woff') format('woff'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'Archivo RB'; src: url('/fonts/archivo-650.woff') format('woff'); font-weight: 650; font-display: swap; }
@font-face { font-family: 'Archivo Text RB'; src: url('/fonts/archivo-text-400.woff') format('woff'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Archivo Text RB'; src: url('/fonts/archivo-text-700.woff') format('woff'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Caveat RB'; src: url('/fonts/caveat-600.woff') format('woff'); font-weight: 600; font-display: swap; }

:root {
  --paper: #F2F5F9;
  --surface: #FFFFFF;
  --ink: #0E2240;
  --ink-2: #4B5C74;
  --line: #D5DDE8;
  --chip: #E7EDF5;
  --marker: #FFE14A;
  --marker-soft: #FFF0A3;
  --marker-ink: #0E2240;
  --band: #0E2240;
  --band-ink: #F2F5F9;
  --focus: #2F6BFF;
  --ok: #157A4E;
  --err: #B42318;
  --err-bg: #FDECEA;
  --wa: #128C4A;

  --f-display: 'Archivo RB', 'Arial Black', 'Helvetica Neue', Arial, sans-serif;
  --f-body: 'Archivo Text RB', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --f-hand: 'Caveat RB', 'Segoe Print', 'Bradley Hand', cursive;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 22px;
  --step: clamp(16px, 4vw, 28px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0A1322; --surface: #111E35; --ink: #ECF1F8; --ink-2: #A6B3C7; --line: #253859; --chip: #1A2A46;
    --marker: #FFE14A; --marker-soft: #5E5524; --marker-ink: #0E2240; --band: #16284A; --band-ink: #ECF1F8;
    --focus: #86A9FF; --ok: #4CC38A; --err: #FF8E85; --err-bg: #3A1A1D; --wa: #1FA85D;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0A1322; --surface: #111E35; --ink: #ECF1F8; --ink-2: #A6B3C7; --line: #253859; --chip: #1A2A46;
  --marker: #FFE14A; --marker-soft: #5E5524; --marker-ink: #0E2240; --band: #16284A; --band-ink: #ECF1F8;
  --focus: #86A9FF; --ok: #4CC38A; --err: #FF8E85; --err-bg: #3A1A1D; --wa: #1FA85D;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.5 var(--f-body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.wrap {
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.wrap--narrow { max-width: 600px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: var(--r-sm); z-index: 20; }
.skip:focus { top: 12px; }

/* ---------- Encabezado ---------- */
.top { padding-block: 14px; }
.top__inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; text-decoration: none; min-width: 0; }
.brand__logo { height: 40px; width: auto; display: block; }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__text b { font: 800 1.05rem/1.05 var(--f-display); letter-spacing: -0.01em; }
.brand__text span { font-size: 0.8rem; color: var(--ink-2); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  font: 700 0.9rem var(--f-body); color: var(--ink);
  background: transparent; border: 1.5px solid var(--line); border-radius: 999px;
  padding: 8px 14px; cursor: pointer; min-height: 40px;
}
.btn-ghost:hover { border-color: var(--ink); }

.demo-banner { background: var(--marker); color: var(--marker-ink); font-size: 0.9rem; font-weight: 700; }
.demo-banner .wrap { padding-block: 10px; }

/* ---------- Hero ---------- */
.hero { padding-block: 12px 36px; }
.hero__grid { display: grid; gap: 34px; align-items: center; }
.hero__copy { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.hero__title {
  font: 800 clamp(2.15rem, 9.2vw, 3.9rem)/0.98 var(--f-display);
  letter-spacing: -0.025em;
}
.hero__lead { font-size: clamp(1.05rem, 3.6vw, 1.25rem); color: var(--ink-2); max-width: 34ch; }
.hero__micro { font-size: 0.9rem; color: var(--ink-2); }

.cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 58px; padding: 14px 26px;
  background: var(--marker); color: var(--marker-ink);
  font: 800 1.02rem/1.1 var(--f-display); letter-spacing: 0.02em;
  border: 2px solid var(--marker-ink); border-radius: var(--r-md);
  text-decoration: none; cursor: pointer; align-self: flex-start;
  box-shadow: 0 3px 0 var(--marker-ink);
  transition: transform .08s ease, box-shadow .08s ease;
}
.cta:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--marker-ink); }
.cta:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--marker-ink); }
.cta[disabled] { opacity: .55; cursor: progress; transform: none; }
.cta--block { width: 100%; }
.hero .cta { width: 100%; max-width: 420px; }

/* La póliza marcada: el elemento memorable de la página */
.poliza { position: relative; margin: 0 auto; width: min(100%, 420px); padding: 4px 0 48px; }
.poliza__sheet {
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  padding: 18px 18px 8px; transform: rotate(-1.6deg);
  box-shadow: 0 1px 0 var(--line), 0 18px 40px -24px rgba(14, 34, 64, .45);
}
.poliza__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 10px; border-bottom: 2px solid var(--ink); }
.poliza__kind { font: 800 1.05rem var(--f-display); }
.poliza__doc { font-size: 0.78rem; color: var(--ink-2); }
.poliza__rows { margin: 0; }
.poliza__rows > div {
  display: flex; align-items: center; gap: 8px; padding: 11px 0;
  border-bottom: 1px dashed var(--line); font-size: 0.98rem;
}
.poliza__rows > div:last-child { border-bottom: 0; }
.poliza__rows dt { color: var(--ink-2); flex: 0 0 auto; }
.poliza__rows dd { margin: 0 0 0 auto; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.poliza__rows .is-mark dd, .poliza__rows .is-mark dt { position: relative; z-index: 1; }
.poliza__rows .is-mark {
  margin-inline: -8px; padding-inline: 8px; border-radius: 3px;
  background-image: linear-gradient(100deg, transparent 0 2%, var(--marker) 3% 97%, transparent 98%);
  background-repeat: no-repeat; background-size: 100% 76%; background-position: 0 60%;
  color: var(--marker-ink);
}
.poliza__rows .is-mark dt { color: var(--marker-ink); }
.poliza__rows .is-mark--soft { background-image: linear-gradient(100deg, transparent 0 2%, var(--marker-soft) 3% 97%, transparent 98%); color: var(--ink); }
.poliza__rows .is-mark--soft dt { color: var(--ink-2); }
.poliza__note {
  position: absolute; right: -2px; bottom: 0;
  font: 600 1.7rem/1 var(--f-hand); color: var(--ink);
  display: flex; align-items: flex-end; gap: 2px; transform: rotate(-3deg);
}
.poliza__arrow { position: absolute; right: 150px; bottom: 14px; transform: scaleX(-1) rotate(-8deg); color: var(--ink); }

@media (prefers-reduced-motion: no-preference) {
  .js .poliza__rows .is-mark { animation: mark 0.7s cubic-bezier(.3,.7,.2,1) 0.45s both; }
  .js .poliza__rows .is-mark--soft { animation-delay: 0.15s; }
  .js .poliza__note { animation: write 0.5s ease-out 1.15s both; }
  @keyframes mark { from { background-size: 0% 76%; } to { background-size: 100% 76%; } }
  @keyframes write { from { opacity: 0; transform: rotate(-3deg) translateY(6px); } to { opacity: 1; transform: rotate(-3deg); } }
}

/* ---------- Beneficios ---------- */
.benefits { padding-block: 8px 40px; }
.benefits__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.benefits__list li { display: grid; grid-template-columns: 32px 1fr; gap: 14px; align-items: start; }
.benefits__list svg { color: var(--ink); margin-top: 2px; }
.benefits__list h3 { font: 650 1.12rem/1.25 var(--f-display); letter-spacing: -0.01em; }
.benefits__list p { color: var(--ink-2); margin-top: 4px; max-width: 46ch; }

/* ---------- Cómo funciona (es una secuencia real) ---------- */
.how { padding-block: 36px 44px; border-top: 1px solid var(--line); }
.section-title { font: 800 clamp(1.5rem, 5.6vw, 2.1rem)/1.05 var(--f-display); letter-spacing: -0.02em; }
.how__steps { list-style: none; counter-reset: s; margin: 22px 0 0; padding: 0; display: grid; gap: 18px; }
.how__steps li { counter-increment: s; display: grid; grid-template-columns: 44px 1fr; column-gap: 14px; }
.how__steps li::before {
  content: counter(s); grid-row: span 2;
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--ink); font: 800 1.1rem var(--f-display);
}
.how__steps b { font: 650 1.12rem/1.3 var(--f-display); padding-top: 7px; }
.how__steps span { color: var(--ink-2); max-width: 48ch; }

/* ---------- Formulario ---------- */
.apply { padding-block: 8px 48px; scroll-margin-top: 12px; }
.apply:focus { outline: none; }
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 24px var(--step) 26px;
}
.panel__title { font: 800 clamp(1.6rem, 6vw, 2.1rem)/1.05 var(--f-display); letter-spacing: -0.02em; }
.progress { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 16px; }
.progress__seg { height: 6px; border-radius: 3px; background: var(--chip); transition: background .25s; }
.progress__seg.is-on { background: var(--ink); }
.progress__label { margin-top: 8px; font-size: 0.9rem; color: var(--ink-2); }

.step { border: 0; margin: 20px 0 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; padding: 0; margin: 0; }
.label { font-weight: 700; font-size: 1rem; padding: 0; }
.opt { font-weight: 400; color: var(--ink-2); font-size: 0.88rem; margin-left: 4px; }
.help { font-size: 0.9rem; color: var(--ink-2); }
.help--group { margin-bottom: -10px; }
.mt { margin-top: 8px; }

input[type="text"], input[type="tel"], input[type="email"], select {
  width: 100%; min-height: 52px; padding: 12px 14px;
  font: 400 1.0625rem var(--f-body); color: var(--ink);
  background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--r-sm);
  appearance: none; -webkit-appearance: none;
}
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px;
}
input::placeholder { color: var(--ink-2); opacity: .7; }
input:focus, select:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 28%, transparent); }
[aria-invalid="true"] { border-color: var(--err) !important; }
.error { color: var(--err); font-size: 0.92rem; font-weight: 700; }
.error:empty { display: none; }

.drop {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px;
  padding: 22px 16px; border: 2px dashed var(--line); border-radius: var(--r-md); background: var(--paper);
  transition: border-color .15s, background .15s;
}
.drop svg { color: var(--ink-2); }
.drop.is-over { border-color: var(--ink); background: var(--chip); }
.drop__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.drop__hint, .drop__limits { font-size: 0.86rem; color: var(--ink-2); }
.btn-file {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 10px 18px; border-radius: var(--r-sm);
  background: var(--ink); color: var(--paper); font-weight: 700; cursor: pointer;
}
.btn-file--alt { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn-file input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; font-size: 0; }
.btn-file:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.only-touch { display: none; }
@media (pointer: coarse) { .only-touch { display: inline-flex; } .only-pointer { display: none; } }

.files { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.file {
  display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center;
  padding: 10px 12px; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--surface);
}
.file.is-ok { border-color: color-mix(in srgb, var(--ok) 55%, var(--line)); }
.file.is-bad { border-color: var(--err); background: var(--err-bg); }
.file__thumb {
  width: 44px; height: 44px; border-radius: 6px; background: var(--chip); display: grid; place-items: center;
  overflow: hidden; font: 800 0.72rem var(--f-display); color: var(--ink-2);
}
.file__thumb img { width: 100%; height: 100%; object-fit: cover; }
.file__body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.file__name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file__meta { font-size: 0.85rem; color: var(--ink-2); }
.file__meta.is-ok { color: var(--ok); font-weight: 700; }
.file__meta.is-bad { color: var(--err); font-weight: 700; }
.file__actions { grid-column: 2; display: flex; gap: 16px; }
.file__bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--chip); overflow: hidden; }
.file__bar span { display: block; height: 100%; width: 0; background: var(--ink); transition: width .2s; }
.btn-link {
  background: none; border: 0; padding: 6px 0; font: 700 0.92rem var(--f-body); color: var(--ink);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; align-self: flex-start; min-height: 36px;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 8px 14px;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--paper); font-weight: 700; font-size: 0.95rem;
}
.chip input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip input:checked + span::before { content: "✓"; }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.more { border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 0 14px; }
.more summary { cursor: pointer; font-weight: 700; padding: 14px 0; }
.more[open] { padding-bottom: 14px; }
.more .help { margin-bottom: 12px; }
.grid-3 { display: grid; gap: 14px; }
@media (min-width: 560px) { .grid-3 { grid-template-columns: 1fr 1.3fr 0.7fr; } }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.consent { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; }
.consent input { width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--ink); }
.consent label { font-size: 0.95rem; line-height: 1.45; }
.consent .error { grid-column: 2; }

.captcha { min-height: 0; }
.captcha:not(:empty) { min-height: 66px; }
.captcha-demo {
  border: 1.5px dashed var(--line); border-radius: var(--r-sm); padding: 12px 14px; font-size: 0.88rem; color: var(--ink-2);
}
.form-error { background: var(--err-bg); color: var(--err); border-radius: var(--r-sm); padding: 12px 14px; font-weight: 700; font-size: 0.95rem; }
.unavailable { margin-top: 16px; background: var(--err-bg); color: var(--ink); border-radius: var(--r-sm); padding: 14px; display: flex; flex-direction: column; gap: 4px; }

.upload-progress { display: flex; flex-direction: column; gap: 8px; }
.upload-progress__bar { height: 8px; border-radius: 4px; background: var(--chip); overflow: hidden; }
.upload-progress__bar span { display: block; height: 100%; width: 0; background: var(--ink); transition: width .2s; }
.upload-progress p { font-size: 0.92rem; color: var(--ink-2); }
.privacy-note { font-size: 0.86rem; color: var(--ink-2); }

/* ---------- Confirmación ---------- */
.done { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.done:focus { outline: none; }
.done__badge { background: var(--marker); color: var(--marker-ink); font-weight: 700; padding: 8px 12px; border-radius: var(--r-sm); font-size: 0.9rem; }
.done__title { font: 800 clamp(1.7rem, 7vw, 2.4rem)/1.03 var(--f-display); letter-spacing: -0.02em; }
.done__text { color: var(--ink-2); font-size: 1.05rem; }
.tracking {
  width: 100%; display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 12px;
  padding: 14px 16px; border-radius: var(--r-md); background: var(--paper); border: 1.5px solid var(--line);
}
.tracking span { grid-column: 1 / -1; font-size: 0.86rem; color: var(--ink-2); }
.tracking strong { font: 800 1.6rem var(--f-display); letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.done__share { width: 100%; display: flex; flex-direction: column; gap: 10px; padding-top: 6px; }
.done__share p { font-weight: 700; }

/* ---------- Compartir ---------- */
.share-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-wa {
  display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 12px 18px;
  background: var(--wa); color: #fff; border-radius: var(--r-md); font-weight: 700; text-decoration: none;
}
.btn-outline {
  min-height: 52px; padding: 12px 18px; border-radius: var(--r-md);
  border: 1.5px solid var(--ink); background: transparent; color: var(--ink); font: 700 1rem var(--f-body); cursor: pointer;
}
.spread { background: var(--band); color: var(--band-ink); }
.spread__inner { padding-block: 40px; display: flex; flex-direction: column; gap: 18px; }
.spread h2 { font: 800 clamp(1.45rem, 5.4vw, 2.2rem)/1.08 var(--f-display); letter-spacing: -0.02em; max-width: 24ch; }
.btn-outline--inv { border-color: var(--band-ink); color: var(--band-ink); }
.spread__status { font-size: 0.92rem; min-height: 1.4em; }

/* ---------- Pie ---------- */
.foot { padding-block: 28px 36px; font-size: 0.86rem; color: var(--ink-2); }
.foot__inner { display: flex; flex-direction: column; gap: 10px; }
.foot b { color: var(--ink); }

/* ---------- Escritorio ---------- */
@media (min-width: 880px) {
  .top { padding-block: 22px; }
  .hero { padding-block: 32px 64px; }
  .hero__grid { grid-template-columns: 1.15fr 0.85fr; gap: 56px; }
  .hero__copy { gap: 22px; }
  .poliza { width: 100%; max-width: 400px; }
  .benefits__list { grid-template-columns: repeat(3, 1fr); gap: 32px; }
  .how__steps { grid-template-columns: repeat(3, 1fr); gap: 32px; }
  .spread__inner { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
  .spread__status { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
