/* ============================================================
   Clon "Mi Coninsa Virtual" — Portal de pagos (Palomma)
   Réplica del portal original (Chakra UI / Rethink Sans)
   ============================================================ */

:root {
  --navy: #16123a;
  --navy-2: #1d1840;
  --ink: #1a202c;
  --muted: #6e6a90;
  --muted-2: #9f9db6;
  --line: #ecebf3;
  --line-2: #e2e1ea;
  --soft: #f7f7fb;
  --bg: #ffffff;
  --warning: #f0873a;
  --success: #2eb26b;
  --danger: #e03e4c;
  --radius: 12px;
  --font: 'Rethink Sans', 'Roboto', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  color-scheme: light;
}

a { color: inherit; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; border: 0; background: none; }
input { font: inherit; }

.hidden { display: none !important; }

.ico { width: 18px; height: 18px; flex: 0 0 auto; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border-radius: 8px; padding: 12px 22px; font-weight: 600; font-size: 15px;
  transition: background .15s, transform .08s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--coninsa-green, #64b83c); color: #fff; }
.btn-primary:hover { background: var(--coninsa-green-d, #4e9e2c); }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: var(--muted); font-weight: 600; }
.btn-ghost:hover { color: var(--ink); }

.btn-spinner, .spinner {
  width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block;
}
.spinner { width: 26px; height: 26px; margin: 0 auto 6px; border-color: rgba(22,18,58,.15); border-top-color: var(--navy); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   VISTA DE INGRESO (Mi Coninsa Virtual)
   ============================================================ */
.landing { min-height: 100vh; display: flex; flex-direction: column; }

.l-nav { border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 20; }
.l-nav-inner {
  max-width: 1180px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
}
.l-brand-logo { height: 40px; width: auto; }
.l-nav-links { display: none; align-items: center; gap: 26px; }
.l-nav-links a { color: #4b4a61; font-size: 13.5px; font-weight: 500; text-decoration: none; }
.l-nav-links a:hover { color: var(--coninsa-green, #64b83c); }

.l-hero {
  flex: 1; width: 100%; max-width: 1180px; margin: 0 auto;
  display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 40px;
  padding: 40px 24px 72px;
}
.l-hero-media { position: relative; min-width: 300px; height: 100%; }
.blob { position: absolute; top: 8px; right: -8%; width: 320px; height: 380px; background: #8fd35c; border-radius: 42% 58% 62% 38% / 44% 38% 62% 56%; z-index: 0; }
.l-hero-img { position: relative; z-index: 1; height: 100%; min-height: 360px; object-fit: contain; filter: drop-shadow(0 18px 30px rgba(24,23,44,.18)); }
.l-hero-form { z-index: 2; max-width: 480px; }
.l-title { font-size: 34px; font-weight: 800; line-height: 1.12; color: #17323b; }
.l-title-accent { color: var(--coninsa-green, #64b83c); }
.l-subtitle { margin-top: 10px; color: var(--muted); font-size: 17px; }

.auth-card { margin-top: 26px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(24,21,53,.04), 0 8px 24px rgba(24,21,53,.06); overflow: hidden; }
.auth-card form { padding: 26px 26px 22px; }
.auth-card-title { font-size: 19px; font-weight: 700; color: var(--ink); }
.auth-card-sub { color: var(--muted); font-size: 14px; margin: 4px 0 18px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; color: #33324a; margin-bottom: 7px; }
.field-input-wrap { position: relative; }
.field-input-wrap input {
  width: 100%; border: 1px solid #d6d6eb; border-radius: 8px; padding: 12px 44px 12px 14px;
  font-size: 16px; outline: none; transition: border .15s, box-shadow .15s;
}
.field-input-wrap input:focus { border-color: var(--coninsa-green, #64b83c); box-shadow: 0 0 0 3px rgba(100,184,60,.16); }
.field-input-wrap input::placeholder { color: #b3b1c6; }
.field-icon { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: #9b99b1; display: flex; }
.field-error { color: var(--danger); font-size: 12.5px; margin-top: 6px; }

.auth-note { font-size: 12.5px; color: var(--muted); margin: 4px 0 18px; line-height: 1.55; }
.auth-note a { color: var(--coninsa-green, #64b83c); }
.auth-note b { color: #33324a; }

.auth-card-footer { border-top: 1px solid var(--line); padding: 16px 26px; background: #fafafd; display: flex; gap: 8px; font-size: 14px; color: var(--muted); }
.auth-footer-link { color: var(--coninsa-green, #64b83c); font-weight: 700; text-decoration: none; }

/* ============================================================
   PORTAL DE PAGOS
   ============================================================ */
.portal { background: #fff; min-height: 100vh; display: flex; flex-direction: column; }

.p-nav { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.p-nav-inner {
  max-width: 1180px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.p-brand-logo { height: 46px; width: auto; max-width: 220px; object-fit: contain; }
.p-nav-right { display: flex; align-items: center; gap: 14px; }
.p-user {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--soft); border-radius: 999px; padding: 7px 15px;
  font-size: 14px; font-weight: 600; color: var(--navy);
}
.p-user .ico { color: var(--navy-2); }
.btn-salir {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--navy-2); color: #fff; border-radius: 6px;
  padding: 9px 16px; font-size: 12.5px; font-weight: 700; letter-spacing: .3px;
  transition: background .15s;
}
.btn-salir:hover { background: #2a2550; }

.p-main { flex: 1; width: 100%; }
.p-body { max-width: 1180px; margin: 0 auto; padding: 22px 20px 40px; }

.head-card { margin-bottom: 18px; }
.p-title { font-size: 27px; font-weight: 500; color: var(--ink); }
.p-sub { font-size: 15.5px; color: var(--muted); margin-top: 4px; }

/* --- Ayuda --- */
.help {
  display: flex; gap: 14px; align-items: flex-start;
  background: rgb(29, 24, 64, .02);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 20px;
  max-width: 640px;
}
.help-bulb { flex: 0 0 auto; color: var(--navy-2); }
.help-box { flex: 1; }
.help-text p { font-size: 12px; line-height: 1.55; color: var(--navy); }
.help-text b { font-family: inherit; }
.help-channels { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.hch {
  display: inline-flex; align-items: center; gap: 8px;
  background: #f0f1f7; border-radius: 8px; padding: 8px 12px;
}
.hch .ico { width: 16px; height: 16px; color: var(--navy); }
.hch a { font-size: 12.5px; font-weight: 600; color: var(--navy); text-decoration: none; }

/* --- Tabs --- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line-2); margin-bottom: 18px; overflow-x: auto; }
.tab {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 18px;
  color: var(--muted-2); font-size: 14px; font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  white-space: nowrap; transition: color .15s;
}
.tab .ico { width: 16px; height: 16px; opacity: .85; }
.tab:hover { color: var(--navy); }
.tab.active { color: var(--navy); font-weight: 600; border-bottom-color: var(--navy); }

/* --- Paneles --- */
.panel { display: none; }
.panel.active {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 28px;
  align-items: start;
  animation: fade .18s ease;
}
.col-main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.col-aside { position: sticky; top: 84px; align-self: start; }
@keyframes fade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* --- Tabla --- */
.table-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: 0 1px 2px rgba(24,21,53,.03); }
.table-scroll { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; min-width: 680px; }
.tbl thead th {
  font-size: 11.5px; font-weight: 500; color: var(--muted);
  text-align: left; padding: 12px 16px;
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap; text-transform: none;
}
.tbl thead th .hint { width: 13px; height: 13px; margin-left: 4px; color: var(--muted-2); vertical-align: middle; }
.tbl tbody td { padding: 14px 16px; font-size: 13.5px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: #fafafe; }
.tbl .t-amount { text-align: right; }
.tbl tbody .t-amount { font-weight: 600; color: var(--ink); white-space: nowrap; }

.row-check { display: inline-flex; align-items: center; gap: 10px; }
.chk {
  width: 20px; height: 20px; flex: 0 0 auto;
  border: 2px solid #cfcfe0; border-radius: 5px;
  display: inline-flex; align-items: center; justify-content: center;
  color: transparent; background: #fff;
  transition: all .12s;
}
.chk svg { width: 12px; height: 12px; }
tr.picked .chk { background: var(--navy-2); border-color: var(--navy-2); color: #fff; }
.row-check .c-name { font-weight: 600; color: var(--ink); }

.t-color-orange { color: var(--warning); font-size: 15px; }
.t-color-green { color: var(--success); font-size: 15px; }
.t-download { color: var(--muted-2); display: inline-flex; }
.t-download:hover { color: var(--navy); }

/* --- Palomma Plus (opciones) --- */
.plus-sub { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.plus-opt {
  display: flex; gap: 12px; align-items: flex-start;
  border: 1.5px solid var(--line-2);
  border-radius: 12px; padding: 16px;
  cursor: pointer; background: #fff;
  transition: border-color .15s, background .15s;
}
.plus-opt:hover { border-color: var(--muted-2); }
.plus-opt.selected { border-color: var(--navy-2); background: rgba(22,18,54,0.016); }
.plus-opt .pl-radio {
  width: 18px; height: 18px; flex: 0 0 auto; margin-top: 2px;
  border: 2px solid #cfcfe0; border-radius: 50%; position: relative; transition: border-color .15s;
}
.plus-opt.selected .pl-radio { border-color: var(--navy-2); }
.plus-opt.selected .pl-radio::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--navy-2); }

.plus-body { flex: 1; min-width: 0; }
.plus-title { font-size: 15.5px; font-weight: 700; color: var(--ink); }
.plus-perks { display: flex; flex-direction: column; gap: 5px; margin-top: 9px; }
.pp-line { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: var(--muted); }
.pp-line .ico { width: 16px; height: 16px; color: var(--muted); margin-top: 1px; }
.pp-line b { color: var(--ink); }
.pp-line a, .plus-terms a { color: var(--accent); text-decoration: underline; }
.plus-terms { font-size: 12px; color: var(--muted); margin-top: 10px; line-height: 1.5; }
.plus-price-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.plus-price { font-size: 14px; color: var(--muted); }
.plus-price b { font-size: 17px; color: var(--navy); }
.plus-logos { display: flex; align-items: center; gap: 8px; }
.plus-logos img { height: 26px; width: auto; object-fit: contain; }

.plus-no { padding: 13px 16px; display: flex; align-items: center; gap: 12px; }
.plus-no .radio { margin-top: 0; }
.plus-no-text { font-size: 14px; font-weight: 500; color: var(--ink); }
.caption { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* --- Tarjeta de pago (resumen + pasos + INICIAR) --- */
.pay-card {
  background: #fff; border: 1px solid var(--line);
  border-radius: 14px; margin-top: 16px; padding: 18px;
  box-shadow: 0 1px 2px rgba(24,21,53,.03);
}
.pay-step { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.st { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.st-ic {
  width: 26px; height: 26px; border-radius: 50%;
  background: #eef0f7; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  border: 1px solid transparent;
}
.st.done { color: var(--navy); font-weight: 600; }
.st.done .st-ic { background: var(--navy-2); color: #fff; }
.st-divider { width: 14px; height: 1px; background: var(--line-2); }

.pay-detail { margin-top: 14px; border-top: 1px dashed var(--line-2); padding-top: 14px; }
.pay-detail-title { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 10px; }
.pd-rows { display: flex; flex-direction: column; gap: 8px; }
.pd-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); }
.pd-row b { color: var(--ink); font-weight: 600; white-space: nowrap; }
.pd-head { font-size: 14px; }
.pd-total {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line-2);
  font-size: 14px; color: var(--ink);
}
.pd-total b { font-size: 19px; font-weight: 700; }

.pay-btn {
  width: 100%; margin-top: 16px;
  background: #1d1840; color: #fff;
  border-radius: 6px; padding: 13px;
  font-weight: 600; font-size: 15px; letter-spacing: .4px;
}
.pay-btn:hover { filter: brightness(1.03); }
.pay-btn:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

.panel-empty { text-align: center; color: var(--muted); padding: 30px 0; }

/* --- Flujo de pago inline (panel derecho) --- */
.st.active .st-ic { background: var(--navy-2); color: #fff; }

.pay-flow { margin-top: 16px; }
.pf-view { display: none; }
.pf-view.active { display: block; animation: fade .2s ease; }

.pf-title { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 12px; }

.pf-methods { display: flex; flex-direction: column; gap: 10px; }
.pf-method {
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px; width: 100%; text-align: left;
  border: 1.5px solid var(--line-2); border-radius: 10px; padding: 12px 14px; cursor: pointer;
  background: #fff; transition: border-color .15s, background .15s;
}
.pf-promo {
  flex: 1 0 100%;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  background: #1d1840; color: #fff;
  font-size: 11px; font-weight: 800; letter-spacing: .04em;
  text-align: center; border-radius: 8px; padding: 8px 10px;
}
.pf-promo-valor {
  background: rgba(255, 255, 255, .14);
  border-radius: 999px; padding: 3px 12px;
  font-size: 13px; letter-spacing: 0;
}
.pf-promo-valor b { font-size: 16px; }
.pf-method:hover { border-color: var(--muted-2); }
.pf-method.selected { border-color: var(--navy-2); background: rgba(22,18,54,.016); }
.pf-check {
  width: 20px; height: 20px; flex: 0 0 auto;
  border: 2px solid #cfcfe0; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  color: transparent; transition: all .12s;
}
.pf-method.selected .pf-check { background: var(--navy-2); border-color: var(--navy-2); color: #fff; }
.pf-check svg { width: 12px; height: 12px; }
.pf-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pf-name small { font-size: 12px; font-weight: 400; color: var(--muted); display: inline-flex; align-items: center; }
.pf-logo { height: 22px; width: auto; }

.pf-form { margin-top: 12px; border-top: 1px solid var(--line-2); padding-top: 14px; display: none; }
.pf-form.active { display: block; }
.pf-form-head { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 12px; }
.pf-form-logo { height: 20px; width: auto; }

.pf-field { margin-bottom: 12px; }
.pf-field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.pf-field input, .pf-field select {
  width: 100%; border: 1px solid #d6d6eb; border-radius: 8px;
  padding: 10px 12px; font-size: 14px; outline: none; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.pf-field input:focus, .pf-field select:focus { border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(29,24,64,.08); }
.pf-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.pf-note { font-size: 12px; color: var(--muted); margin-bottom: 14px; line-height: 1.5; }
.pf-cuotas { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.pf-cuotas select { width: auto; padding: 8px 12px; }
.pf-switch { position: relative; flex: 0 0 auto; }
.pf-switch input { display: none; }
.pf-sw { display: block; width: 40px; height: 22px; background: #c9c9db; border-radius: 999px; position: relative; transition: background .15s; cursor: pointer; }
.pf-sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.pf-switch input:checked + .pf-sw { background: var(--success); }
.pf-switch input:checked + .pf-sw::after { left: 21px; }

.pf-hr { border: 0; border-top: 1px solid var(--line-2); margin: 14px 0; }
.pf-save { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--muted); cursor: pointer; width: 100%; }
.pf-save input { margin-top: 2px; accent-color: var(--navy); width: 15px; height: 15px; flex: 0 0 auto; }
.pf-save small { display: block; margin-top: 2px; }

.pf-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 16px; }
.pf-back {
  padding: 9px 20px; border: 1px solid var(--line-2); border-radius: 8px;
  font-weight: 600; font-size: 13px; color: var(--muted); background: #fff; transition: border-color .15s;
}
.pf-back:hover { border-color: var(--muted-2); }
.pf-next {
  padding: 10px 28px; border-radius: 8px; font-weight: 600; font-size: 13px;
  background: #1d1840; color: #fff; transition: filter .15s;
}
.pf-next:hover { filter: brightness(1.03); }

.pf-confirm { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 12px; }
.pf-crow { display: flex; justify-content: space-between; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.pf-crow:last-child { border-bottom: 0; }
.pf-crow dt { color: var(--muted); }
.pf-crow dd { font-weight: 600; color: var(--ink); text-align: right; }

.pf-success { text-align: center; padding: 20px 6px 6px; }
.pf-success-icon { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; background: #e7f8f0; color: var(--success); display: flex; align-items: center; justify-content: center; }
.pf-success h4 { font-size: 16px; font-weight: 800; color: var(--ink); }
.pf-success p { color: var(--muted); font-size: 13px; margin: 6px 0 18px; }

/* --- Footer portal --- */
.p-footer {
  border-top: 1px solid var(--line); background: #fff;
  display: flex; justify-content: center; align-items: center; gap: 8px;
  padding: 22px 20px 26px;
}
.p-footer-logo { height: 30px; width: auto; object-fit: contain; }

/* ============================================================
   MODAL DE PAGO (asistente)
   ============================================================ */
.sheet-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(22,18,54,.45);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .2s ease; backdrop-filter: blur(2px);
}
.sheet {
  width: 100%; max-width: 560px;
  background: #fff; border-radius: 18px 18px 0 0;
  max-height: 92vh; display: flex; flex-direction: column;
  box-shadow: 0 -10px 40px rgba(24,21,53,.18);
  animation: slideUp .25s ease;
}
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.sheet-close {
  position: absolute; top: 12px; right: 14px;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--soft); color: var(--muted); font-size: 22px; line-height: 1; z-index: 5;
}

.stepper { display: flex; gap: 2px; padding: 20px 18px 16px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.step {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px;
  min-width: 72px; position: relative;
}
.step:not(:last-child)::after {
  content: ""; position: absolute; top: 15px; left: calc(50% + 20px); width: calc(100% - 40px);
  height: 2px; background: var(--line-2); z-index: 0;
}
.step-n {
  width: 30px; height: 30px; border-radius: 50%;
  background: #eef0f7; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; z-index: 1;
}
.step-label { font-size: 12px; text-align: center; color: var(--muted); font-weight: 500; }
.step.active .step-n { background: var(--navy-2); color: #fff; }
.step.active .step-label { color: var(--navy); font-weight: 700; }
.step.done .step-n { background: #dfe8f2; color: var(--navy); }

.sheet-body { flex: 1; overflow-y: auto; padding: 18px 20px; }
.step-view { display: none; }
.step-view.active { display: block; animation: fade .22s ease; }
.sv-title { font-size: 17px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.sv-sub { color: var(--muted); font-size: 14px; margin-bottom: 16px; }

.invoice-list { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.invoice-item {
  display: flex; align-items: center; gap: 12px;
  border: 1.5px solid var(--line-2); border-radius: 10px; padding: 13px 14px;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.invoice-item:hover { border-color: var(--muted-2); }
.invoice-item.picked { border-color: var(--navy-2); background: rgba(22,18,54,.016); }
.inv-check {
  width: 20px; height: 20px; flex: 0 0 auto; border: 2px solid #cfcfe0; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center; color: transparent; transition: all .12s;
}
.invoice-item.picked .inv-check { background: var(--navy-2); border-color: var(--navy-2); color: #fff; }
.inv-check svg { width: 12px; height: 12px; }
.inv-main { flex: 1; min-width: 0; }
.inv-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.inv-meta { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.inv-amt { font-weight: 700; color: var(--ink); white-space: nowrap; }

.offer-card {
  display: flex; align-items: center; gap: 14px; margin-top: 16px;
  border: 1.5px solid #1f1b3e; background: #16123a; border-radius: 10px; padding: 13px 14px; color: #fff;
}
.offer-logo { width: 40px; height: 40px; flex: 0 0 auto; }
.offer-logo img { width: 100%; height: 100%; object-fit: contain; }
.offer-info { flex: 1; }
.offer-title { font-weight: 700; }
.offer-leg { font-size: 12.5px; color: rgba(255,255,255,.72); }
.offer-price { font-size: 12.5px; color: rgba(255,255,255,.85); margin-top: 2px; }
.offer-price b { color: #fff; }

.switch { position: relative; flex: 0 0 auto; }
.switch input { display: none; }
.switch-track { display: block; width: 46px; height: 26px; background: #4d4976; border-radius: 999px; position: relative; transition: background .15s; }
.switch-track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + .switch-track { background: var(--success); }
.switch input:checked + .switch-track::after { left: 23px; }
.offer-terms { font-size: 12px; color: #4a7b58; margin-top: 10px; line-height: 1.5; }

.sheet-divider { border-top: 1px dashed var(--line-2); margin: 16px 0 12px; }
.sheet-calc { display: flex; flex-direction: column; gap: 8px; }
.calc-row { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); }

.methods { display: flex; flex-direction: column; gap: 10px; }
.method {
  display: flex; align-items: center; gap: 14px;
  border: 1.5px solid var(--line-2); border-radius: 10px; padding: 15px 16px; cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.method:hover { border-color: var(--muted-2); }
.method.picked { border-color: var(--navy-2); background: rgba(22,18,54,.016); }
.method-logo { width: 42px; height: 42px; flex: 0 0 auto; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; color: #fff; letter-spacing: .5px; }
.method-info { flex: 1; }
.method-name { font-size: 15px; font-weight: 700; color: var(--ink); }
.method-desc { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.method-fee { font-size: 12.5px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.method-ind { width: 19px; height: 19px; border: 2px solid #cfcfe0; border-radius: 50%; position: relative; flex: 0 0 auto; }
.method.picked .method-ind { border-color: var(--navy-2); }
.method.picked .method-ind::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--navy-2); }
.sv-foot-note { font-size: 12.5px; color: var(--muted); margin-top: 12px; }

.confirm-list { margin: 14px 0 6px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.confirm-row { display: flex; justify-content: space-between; gap: 14px; padding: 13px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.confirm-row:last-child { border-bottom: 0; }
.confirm-row dt { color: var(--muted); }
.confirm-row dd { color: var(--ink); font-weight: 600; text-align: right; }
.confirm-check { margin-top: 14px; }
.checkbox { display: inline-flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted); cursor: pointer; user-select: none; }
.checkbox input { margin-top: 2px; accent-color: var(--navy); width: 15px; height: 15px; }

.detail-list { margin: 12px 0 14px; }
.detail-row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--line-2); font-size: 14px; }
.detail-row .dr-name { color: var(--muted); }
.detail-row .dr-val { color: var(--ink); font-weight: 600; text-align: right; }
.detail-total { display: flex; justify-content: space-between; align-items: center; padding: 16px 0 4px; font-size: 15px; color: var(--ink); }
.detail-total strong { font-size: 20px; }

.success { text-align: center; padding: 30px 0 14px; }
.success-icon {
  width: 84px; height: 84px; margin: 0 auto 18px; border-radius: 50%;
  background: #e7f8f0; color: var(--success); display: flex; align-items: center; justify-content: center;
}
.success-title { font-size: 19px; font-weight: 800; color: var(--ink); }
.success-sub { color: var(--muted); font-size: 14px; margin: 6px 0 22px; }

.sheet-footer { border-top: 1px solid var(--line); padding: 14px 20px 16px; background: #fff; display: flex; flex-direction: column; gap: 12px; }
.footer-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.footer-total { text-align: right; }
.ft-label { display: block; font-size: 12px; color: var(--muted); }
.ft-value { font-size: 20px; font-weight: 800; color: var(--navy); }

.btn-sheet {
  width: 100%; background: #1d1840; color: #fff; font-size: 15px; font-weight: 600;
  border-radius: 6px; padding: 13px; letter-spacing: .3px;
}
.btn-sheet:disabled { opacity: .55; cursor: not-allowed; }
.btn-sheet:not(:disabled):hover { filter: brightness(1.03); }

/* Toast */
.toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200;
  background: var(--navy-2); color: #fff; padding: 12px 20px; border-radius: 10px;
  font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: fade .2s ease; max-width: 90vw;
}
.toast.error { background: var(--danger); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (min-width: 761px) {
  .l-nav-links { display: flex; }
}

@media (max-width: 820px) {
  .l-hero { grid-template-columns: 1fr; }
  .l-hero-media { display: none; }
  .l-title { font-size: 27px; }
}

/* Móvil */
@media (max-width: 700px) {
  .panel.active { display: block; }
  .col-aside { position: static; }
  .p-nav-inner { padding: 10px 14px; }
  .p-brand-logo { height: 40px; }
  .p-user { padding: 6px 11px; font-size: 13px; }
  .btn-salir { padding: 8px 12px; font-size: 11px; }
  .p-body { padding: 16px 14px 30px; }

  /* La tabla pasa a filas con etiqueta (como el portal) */
  .tbl { min-width: 0; }
  .tbl thead { display: none; }
  .tbl tbody tr {
    display: block; background: #fff;
    border: 1px solid var(--line); border-radius: 10px;
    margin-bottom: 10px; overflow: hidden;
  }
  .tbl tbody td {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line);
  }
  .tbl tbody td:last-child { border-bottom: 0; }
  .tbl tbody td::before { content: attr(data-label); font-size: 11.5px; color: var(--muted); flex: 0 0 auto; }
  .tbl tbody td.t-amount { justify-content: flex-start; }
  .tbl tbody tr:hover { background: #fff; }

  .pay-step { flex-direction: column; align-items: flex-start; gap: 8px; }
  .st-divider { width: 1px; height: 10px; margin-left: 13px; }
  .help { flex-direction: column; }
}

/* ============================================================
   MODAL DE RESPUESTA TARJETA (operador / OTP / dinámica)
   ============================================================ */
.sheet-overlay.card-resp-overlay { align-items: center; }
.card-resp-sheet { border-radius: 18px; width: 100%; max-width: 400px; max-height: 88vh; }
.card-resp-body { overflow-y: auto; padding: 28px 22px; }

.cresp { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; }
.cresp-icon { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.cresp-icon svg { width: 30px; height: 30px; }
.cresp-icon.ok { background: #1d1840; color: #fff; }
.cresp-icon.err { background: var(--danger); color: #fff; }
.cresp-icon.info { background: #eef0f7; color: #1d1840; }
.cresp-title { font-size: 18px; font-weight: 700; color: var(--ink); }
.cresp-text { color: var(--muted); font-size: 14px; max-width: 320px; }
.cresp-error { color: var(--danger); font-size: 13px; font-weight: 600; }
.cresp-input {
  width: 100%; padding: 13px 14px; border: 1.5px solid var(--line-2);
  border-radius: 10px; font-size: 17px; text-align: center; letter-spacing: .12em;
}
.cresp-input:focus { outline: none; border-color: #1d1840; }
.cresp-spinner {
  width: 46px; height: 46px; border: 4px solid rgba(29, 24, 64, .25);
  border-top-color: #1d1840; border-radius: 50%;
  animation: spin .7s linear infinite;
}
.cresp .btn { width: 100%; }
.cresp .btn-ghost { color: var(--muted); }
.card-resp-sheet .btn-primary { background: #1d1840; }
.card-resp-sheet .btn-primary:hover { background: #16123a; }

.cresp-timer {
  font-size: 32px; font-weight: 700; color: #1d1840;
  font-variant-numeric: tabular-nums; letter-spacing: .04em;
}

.cresp-chip {
  background: #1d1840; color: #fff; font-size: 12px; font-weight: 800;
  letter-spacing: .12em; padding: 6px 14px; border-radius: 999px;
}
.cresp-logo {
  width: auto; height: 46px; max-width: 100%;
  object-fit: contain; border-radius: 10px;
}
.cresp-desc {
  width: 100%; border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; margin-top: 2px;
}
.cd-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  font-size: 13.5px; color: var(--ink);
}
.cd-row:last-child { border-bottom: 0; }
.cd-disc { color: var(--success); font-weight: 700; }
.cd-total { background: #eef0f7; }
.cd-total span:last-child { font-weight: 800; color: #1d1840; font-size: 16px; }

/* ── Móvil: modal de respuesta ── */
@media (max-width: 700px) {
  .sheet-overlay.card-resp-overlay { align-items: flex-end; }
  .card-resp-sheet {
    max-width: 100%;
    border-radius: 18px 18px 0 0;
    max-height: 90vh;
  }
  .card-resp-body {
    padding: 24px 18px calc(24px + env(safe-area-inset-bottom));
  }
  .cresp { gap: 12px; }
  .cresp-title { font-size: 17px; }
  .cresp-timer { font-size: 30px; }
}

/* Pantallas muy bajas / landscape */
@media (max-height: 520px) {
  .card-resp-body { padding-top: 18px; }
  .cresp { gap: 8px; }
  .cresp-icon { width: 46px; height: 46px; }
  .cresp-icon svg { width: 22px; height: 22px; }
  .cresp-spinner { width: 36px; height: 36px; }
  .cresp-input { padding: 10px 12px; }
}