/* =========================================================
   Página de pago — capa de composición sobre design/tokens.css
   Sin sombras, sin gradientes, líneas de 1 px.
   ========================================================= */

:root{
  --danger: #B42318;
  --danger-soft: #FDECEA;
  --bottom-bar-h: 72px;
  /* Sin archivo de Prelo Slab: todos los textos usan Prelo. */
  --font-display: var(--font-body);
}

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

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

body{
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img{ display: block; max-width: 100%; height: auto; }
a{ color: var(--link); }
button{ font: inherit; }
h1, h2, h3{ font-family: var(--font-display); font-weight: 600; }

.sr-only{
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip{
  position: absolute;
  left: -9999px; top: 8px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--paper);
  color: var(--navy);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-btn);
  font-weight: 700;
  text-decoration: none;
}
.skip:focus{ left: 8px; }

:focus-visible{
  outline: 2px solid var(--headline);
  outline-offset: 2px;
}

/* ---------- Cabecera ---------- */
.hdr{
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  min-height: 64px; padding: 10px 16px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.brand{ display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.brand__mark{ display: inline-flex; flex: none; }
.brand__name{
  color: var(--navy); font-weight: 800; font-size: 13px; line-height: 1.05;
  text-transform: uppercase; letter-spacing: .01em;
}
.hdr__spacer{ margin-left: auto; }
.hdr__help{
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--navy); font-size: 15px; font-weight: 600;
  text-decoration: none; white-space: nowrap;
}
.hdr__help:hover{ text-decoration: underline; text-underline-offset: 3px; }
.hdr__access{ min-height: 44px; padding: 0 14px; font-size: 13px; white-space: nowrap; }

@media (max-width: 520px){
  .hdr{ justify-content: flex-end; }
  .brand{
    position: absolute; left: 50%;
    transform: translateX(-50%);
  }
  .hdr__spacer{ display: none; }
}

/* ---------- Cuerpo ---------- */
.page{
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.crumbs{
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 0 0 18px;
  font-size: 12.5px;
  color: var(--muted);
}
.crumbs span[aria-hidden]{ color: var(--line-strong); }

/* ---------- Estado ---------- */
.status{
  position: relative;
  overflow: hidden;
  padding: 20px;
  margin-bottom: 26px;
}
.status__watermark{
  position: absolute;
  top: 4px; right: -14px;
  width: 190px; height: 190px;
  color: var(--headline);
  opacity: .06;
  pointer-events: none;
}
.status__head{
  position: relative;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.status__shield{ width: 46px; height: 46px; color: var(--headline); flex: none; }
.status .pill{
  border: 1px solid #F0D9A8;
  background: var(--amber-soft);
  color: #8A5200;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.status[data-state="pagado"] .pill{
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}
.status[data-state="vencido"] .pill{
  border-color: #F3B7B2;
  background: var(--danger-soft);
  color: var(--danger);
}
.status__flags{
  position: relative;
  display: flex; align-items: center; gap: 8px;
  margin-top: 16px;
}
.flag-ec{
  width: 24px; height: 16px; flex: none;
  border: 1px solid var(--line);
  border-radius: 2px;
}
.eyebrow{
  font-size: 11.5px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
}
.status__note{
  position: relative;
  display: flex; gap: 8px;
  margin: 12px 0 0;
  font-size: 14.5px;
  color: var(--ink-2);
}
.status__note svg{ width: 18px; height: 18px; flex: none; margin-top: 3px; color: var(--muted); }
.status__amount{
  position: relative;
  margin: 14px 0 0;
  font-size: 15px;
  color: var(--ink-2);
}
.status__amount strong{
  color: var(--navy);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- Identidad ---------- */
.identity{ margin: 0 0 26px; }
.identity__kicker{
  margin: 0 0 4px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
.identity h1{
  margin: 0 0 10px;
  font-size: clamp(32px, 7.5vw, 34px);
  line-height: 1.15;
  letter-spacing: -.01em;
  color: var(--headline);
  overflow-wrap: anywhere;
}
.identity__meta{
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.seals{
  display: flex; flex-wrap: wrap; gap: 8px 14px;
  margin: 0; padding: 0;
  list-style: none;
}
.seals li{ display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.seals svg{ width: 14px; height: 14px; flex: none; color: var(--green); }

/* ---------- Datos ---------- */
.data{ padding: 4px 18px 18px; margin-bottom: 26px; }
.data__head{
  display: flex; align-items: center; gap: 10px;
  padding: 16px 0 12px;
  border-bottom: 1px solid var(--line);
}
.data__head svg{ width: 22px; height: 22px; flex: none; color: var(--navy); }
.data h2{ margin: 0; font-size: 22px; line-height: 1.25; color: var(--headline); }

.row{
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.row:last-child{ border-bottom: 0; }
.row__body{ flex: 1; min-width: 0; }
.row__label{
  display: block;
  font-family: var(--font-body);
  font-size: 14px; font-weight: 400; letter-spacing: 0;
  color: var(--muted);
}
.row__value{
  display: block;
  font-family: var(--font-body);
  font-size: 16.5px; font-weight: 400;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.row__value--account{
  font-variant-numeric: tabular-nums;
  letter-spacing: .07em;
}
.row__note{ display: block; margin: 4px 0 0; font-size: 13px; color: var(--muted); line-height: 1.45; }

.copy{
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; min-width: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  background: var(--paper);
  color: var(--navy);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  flex: none;
}
.copy:hover{ background: var(--surface-soft); }
.copy:active{ background: var(--surface-sunk); }
.copy svg{ width: 16px; height: 16px; flex: none; }
.copy.is-done{ color: var(--green); border-color: var(--green); }

@media (max-width: 374px){
  .copy__text{ display: none; }
  .copy{ padding: 0 12px; }
}

.fine{ margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.dotted{ margin: 16px 0 0; border: 0; border-top: 1px dashed var(--line-strong); }

.receipt-note{
  display: flex; gap: 10px;
  margin: 14px 0 0;
  padding: 12px 14px;
  background: var(--danger-soft);
  border: 1px solid #F3B7B2;
  border-left: 3px solid var(--danger);
  border-radius: 8px;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--ink);
}
.receipt-note strong{ color: var(--danger); }
.receipt-note__icon{ width: 20px; height: 20px; flex: none; margin-top: 2px; color: var(--danger); }

/* ---------- Efectivo ---------- */
.cash{
  margin-bottom: 26px;
  padding: 18px;
  background: var(--surface-soft);
  border-radius: var(--r-card);
}
.cash h3{ margin: 0 0 8px; font-size: 22px; line-height: 1.25; color: var(--headline); }
.cash p{ margin: 0 0 8px; font-size: 15px; color: var(--ink-2); }
.cash .fine{ margin-bottom: 0; }
.code{
  display: inline-block;
  padding: 1px 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--navy);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: .06em;
}

/* ---------- Garantía ---------- */
.guarantee{ margin: 0 0 26px; padding: 8px 0; text-align: center; }
.stamps{ display: flex; justify-content: center; gap: 18px; margin-bottom: 14px; }
.stamp{ width: 104px; height: 104px; color: var(--navy); }
.guarantee__text{
  max-width: 46ch;
  margin: 0 auto;
  font-size: 15px;
  color: var(--ink-2);
}

/* ---------- COSEDE ---------- */
.cosede{
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 26px;
  padding: 12px 14px;
  background: var(--surface-soft);
  border-radius: var(--r-card);
  min-height: 64px;
}
.cosede__icon{ width: 34px; height: 34px; flex: none; color: var(--navy); }
.cosede__text{ flex: 1; min-width: 0; }
.cosede__text p:first-child{ margin: 0; font-size: 15px; font-weight: 700; line-height: 1.3; color: var(--ink); }
.cosede__text p:last-child{ margin: 2px 0 0; font-size: 13px; line-height: 1.35; color: var(--ink-2); }
.cosede .btn{ flex: none; min-height: 44px; padding: 0 12px; font-size: 13px; text-decoration: none; }
.btn--outline{ border: 1px solid var(--line-strong); box-shadow: none; }

/* ---------- Cierre ---------- */
.closing{
  margin-bottom: 26px;
  padding: 20px;
  border: 2px solid var(--headline);
  border-radius: var(--r-card);
}
.closing h2{
  margin: 0 0 16px;
  font-size: 23px;
  line-height: 1.25;
  color: var(--headline);
}
.closing__btn{
  width: 100%;
  gap: 8px;
  text-decoration: none;
}
.closing__btn svg{ width: 20px; height: 20px; flex: none; }
.closing__meta{ margin: 14px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.closing__meta strong{ color: var(--ink-2); }

/* ---------- Antifraude ---------- */
.fraud{ margin-bottom: 26px; padding: 18px; }
.fraud__head{ display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.fraud__head svg{ width: 24px; height: 24px; flex: none; margin-top: 2px; color: var(--danger); }
.fraud h2{ margin: 0; font-size: 22px; line-height: 1.25; color: var(--headline); }
.checks{ display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.checks li{ display: flex; gap: 9px; font-size: 14.5px; line-height: 1.45; color: var(--ink-2); }
.checks svg{ width: 16px; height: 16px; flex: none; margin-top: 3px; color: var(--navy); }

/* ---------- FAQ ---------- */
.faq{ margin-bottom: 30px; }
.faq h2{ margin: 0 0 6px; font-size: 24px; line-height: 1.2; color: var(--headline); }
.faq details{ border-top: 1px solid var(--line); }
.faq details:last-child{ border-bottom: 1px solid var(--line); }
.faq summary{
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 56px;
  padding: 10px 0;
  font-size: 15.5px; font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker{ display: none; }
.faq summary svg{ width: 18px; height: 18px; flex: none; color: var(--navy); transition: transform .2s ease; }
.faq details[open] summary svg{ transform: rotate(180deg); }
.faq p{ margin: 0 0 14px; font-size: 15px; line-height: 1.55; color: var(--ink-2); }

/* ---------- Pie ---------- */
.ftr{
  background: var(--paper);
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 13px;
}
.ftr__inner{ width: 100%; max-width: 760px; margin: 0 auto; padding: 24px 16px 40px; }
.ftr__phones{ display: grid; gap: 10px; margin-bottom: 20px; }
.ftr__phone{
  display: flex; align-items: center; gap: 10px;
  min-height: 44px;
  color: var(--navy);
  font-weight: 600;
  text-decoration: none;
}
.ftr__phone:hover .ftr__phone-num{ text-decoration: underline; text-underline-offset: 3px; }
.ftr__phone svg{ width: 20px; height: 20px; flex: none; }
.ftr__phone-label{ display: block; font-size: 12px; font-weight: 400; color: var(--muted); line-height: 1.3; }
.ftr__phone-num{ display: block; line-height: 1.3; }

.ftr__social{
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.ftr__social a{
  display: grid; place-items: center;
  width: 44px; height: 44px;
  color: var(--navy);
  border-radius: 8px;
}
.ftr__social a:hover{ background: var(--surface-soft); }
.ftr__social svg{ width: 21px; height: 21px; }

.ftr__links{ display: flex; flex-wrap: wrap; gap: 4px 24px; padding: 12px 0; }
.ftr__links a{
  display: inline-flex; align-items: center;
  min-height: 44px;
  color: var(--navy); font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px;
}

.ftr__apps{ padding: 10px 0 4px; text-align: center; }
.ftr__apps-title{ margin: 0 0 4px; font-size: 16px; font-weight: 700; color: var(--ink); }
.ftr__apps-sub{ margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.badges{ display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; }
.store-link{ display: inline-flex; line-height: 0; border-radius: 7px; overflow: hidden; }
.store-link img{ display: block; height: 46px; width: auto; }
.store-link:hover img{ opacity: .88; }
.ftr__legal{ margin: 18px 0 0; font-size: 12px; line-height: 1.55; color: var(--muted); }

/* ---------- Barra inferior ---------- */
.bottom-bar{
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: none; align-items: center; gap: 12px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--paper);
  border-top: 1px solid var(--line);
}
.bottom-bar__amount{
  flex: 1; min-width: 0;
  margin: 0;
  font-size: 12px; line-height: 1.2; color: var(--muted);
}
.bottom-bar__amount strong{
  display: block;
  margin-top: 1px;
  font-size: 16px;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}
.bottom-bar .btn{ flex: 1; min-height: 44px; padding: 0 16px; font-size: 15px; }

@media (max-width: 719px){
  body{ padding-bottom: calc(var(--bottom-bar-h) + env(safe-area-inset-bottom)); }
  body.cookies-open{ padding-bottom: calc(var(--bottom-bar-h) + var(--cookie-h, 0px) + 12px + env(safe-area-inset-bottom)); }
  .bottom-bar{ display: flex; }
  body.cookies-open .bottom-bar{ bottom: calc(var(--cookie-h, 0px) + 12px); }
}

/* ---------- Cookies ---------- */
.cookies{
  position: fixed;
  left: 12px; right: 12px; bottom: 12px;
  z-index: 40;
  width: auto; max-width: 420px;
  margin: 0 auto;
  padding: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.cookies[hidden]{ display: none; }
.cookies h2{
  margin: 0 0 8px;
  font-family: var(--font-body);
  font-size: 17px; font-weight: 700; line-height: 1.3;
  color: var(--ink);
}
.cookies p{ margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.cookies a{ color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.cookies__actions{ display: grid; gap: 10px; margin-top: 14px; }
.cookies__actions .btn{ width: 100%; }

@media (min-width: 720px){
  .cookies{ left: auto; right: 24px; bottom: 24px; width: 420px; margin: 0; }
}

/* ---------- Toast ---------- */
.toast{
  position: fixed;
  left: 50%; bottom: calc(var(--bottom-bar-h) + 18px + env(safe-area-inset-bottom));
  z-index: 50;
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  background: var(--navy);
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.4;
  opacity: 0;
  transform: translateX(-50%) translateY(8px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.is-visible{ opacity: 1; transform: translateX(-50%) translateY(0); }

@media (min-width: 720px){
  .toast{ bottom: 24px; }
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .faq details[open] summary svg{ transform: none; }
}
