/* =============================================================
   app-creditos-e · app.css
   Paleta: azul institucional, blanco, tinta casi negra.
   Firma visual: la cuenta individual se presenta como una
   libreta de aportes, con rayado contable y cifras tabulares.
   ============================================================= */

/* ---------- 1. Tokens ---------------------------------------- */
:root {
  /* color */
  --azul-noche: #071B3D;
  --azul-tinta: #0A2A5E;
  --azul: #1751D6;
  --azul-vivo: #2F7BFF;
  --azul-niebla: #EAF1FF;
  --azul-humo: #F4F7FD;

  --tinta: #0B1220;
  --tinta-70: #3D4759;
  --tinta-45: #6B7688;
  --tinta-25: #A3ACBB;

  --papel: #FFFFFF;
  --papel-2: #F4F7FB;
  --linea: #DFE5EE;
  --linea-suave: #EDF1F7;

  --ok: #0F7A52;
  --ok-suave: #E6F5EE;
  --espera: #A2660A;
  --espera-suave: #FBF1DF;
  --no: #C22B47;
  --no-suave: #FCEBEE;

  /* tipografía */
  --display: 'Archivo', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --texto: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --cifra: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* medidas */
  --r-xs: 8px;
  --r-s: 12px;
  --r-m: 16px;
  --r-l: 22px;
  --r-xl: 30px;

  --sombra-1: 0 1px 2px rgba(11, 18, 32, .05), 0 1px 1px rgba(11, 18, 32, .04);
  --sombra-2: 0 6px 20px rgba(10, 42, 94, .09), 0 1px 3px rgba(10, 42, 94, .06);
  --sombra-3: 0 24px 60px rgba(7, 27, 61, .18);

  --ancho-app: 428px;
  --alto-app: 900px;
  --tabbar: 68px;
}

/* ---------- 2. Base ------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--texto);
  font-size: 15px;
  line-height: 1.5;
  color: var(--tinta);
  background: var(--azul-noche);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -.022em;
  margin: 0;
  line-height: 1.18;
}

p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

.mono { font-family: var(--cifra); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

.ico { width: 22px; height: 22px; flex: none; }
.ico--s { width: 18px; height: 18px; }
.ico--l { width: 28px; height: 28px; }

:focus-visible {
  outline: 2.5px solid var(--azul-vivo);
  outline-offset: 2px;
  border-radius: 6px;
}

.oculto-visual {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- 3. Marco de escritorio ---------------------------- */
.marco {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) auto;
  gap: 56px;
  align-items: center;
  justify-content: center;
  padding: 40px clamp(24px, 5vw, 72px);
  background:
    radial-gradient(1100px 600px at 12% -10%, #123A78 0%, transparent 60%),
    radial-gradient(900px 700px at 105% 110%, #0E2E63 0%, transparent 55%),
    var(--azul-noche);
}

.lateral { max-width: 460px; color: #fff; }

.lateral__marca {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 30px;
}
.lateral__logo {
  width: 44px; height: 44px; border-radius: 12px;
  background: #fff; color: var(--azul-noche);
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 700; font-size: 19px;
  letter-spacing: -.04em;
}
.lateral__marca span { font-size: 13px; color: #A8C0E6; letter-spacing: .12em; text-transform: uppercase; }
.lateral__marca strong { display: block; font-family: var(--display); font-size: 16px; letter-spacing: -.01em; }

.lateral h1 {
  font-size: clamp(34px, 3.4vw, 46px);
  line-height: 1.05;
  letter-spacing: -.035em;
  margin-bottom: 18px;
}
.lateral h1 em { font-style: normal; color: #7FB0FF; }

.lateral p {
  color: #B9CBE8; font-size: 15.5px; line-height: 1.62; max-width: 42ch;
}

.fichas { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 30px; }
.ficha {
  font-size: 12.5px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .22); color: #D6E3F7;
  background: rgba(255, 255, 255, .05);
}

.panel {
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: var(--r-m);
  background: rgba(255, 255, 255, .05);
  padding: 18px 20px;
  backdrop-filter: blur(6px);
}
.panel h2 {
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: #8FB2E4; font-weight: 600; margin-bottom: 4px;
}
.panel > p { font-size: 13px; color: #A9C0E0; margin-bottom: 14px; }

.opciones { display: flex; gap: 6px; flex-wrap: wrap; }
.opciones button {
  flex: 1 1 auto; min-width: 76px;
  padding: 9px 10px; border-radius: 10px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .2);
  background: transparent; color: #D9E6F8; font-size: 13px;
  transition: background .15s, border-color .15s, color .15s;
}
.opciones button:hover { background: rgba(255, 255, 255, .1); }
.opciones button[aria-pressed="true"] {
  background: #fff; color: var(--azul-noche); border-color: #fff; font-weight: 600;
}

.panel__pie {
  display: flex; gap: 10px; align-items: center; justify-content: space-between;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .14);
}
.enlace-tenue {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: #9FBCE6; font-size: 13px; text-decoration: underline; text-underline-offset: 3px;
}
.enlace-tenue:hover { color: #fff; }

.lateral__nota { margin-top: 22px; font-size: 12.5px; color: #7E99C2; }

/* ---------- 4. Dispositivo ------------------------------------ */
.dispositivo {
  width: var(--ancho-app);
  height: min(var(--alto-app), calc(100dvh - 80px));
  border-radius: 46px;
  padding: 12px;
  background: linear-gradient(160deg, #24344F, #0B1729);
  box-shadow: var(--sombra-3), inset 0 0 0 1px rgba(255, 255, 255, .12);
  flex: none;
}

.pantalla {
  position: relative;
  height: 100%;
  border-radius: 36px;
  overflow: hidden;
  background: var(--papel-2);
  display: flex;
  flex-direction: column;
}

.estado-movil {
  height: 34px; flex: none;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px;
  font-size: 12.5px; font-weight: 600; letter-spacing: -.01em;
  color: var(--tinta);
  background: var(--papel);
}
.estado-movil__derecha { display: flex; align-items: center; gap: 5px; opacity: .75; }
.estado-movil__bateria {
  width: 22px; height: 11px; border: 1.4px solid currentColor; border-radius: 3px;
  position: relative; display: inline-block;
}
.estado-movil__bateria::after {
  content: ''; position: absolute; inset: 1.6px; right: 6px; background: currentColor; border-radius: 1px;
}
.estado-movil__bateria::before {
  content: ''; position: absolute; right: -3.4px; top: 3px; width: 2px; height: 5px;
  background: currentColor; border-radius: 0 2px 2px 0;
}

#app {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
  background: var(--papel-2);
}
#app.entrando > * { animation: entra .34s cubic-bezier(.22, .8, .3, 1) both; }
@keyframes entra {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 5. Estructura de pantalla -------------------------- */
.barra {
  flex: none;
  display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 8px;
  padding: 10px 12px;
  background: var(--papel);
  border-bottom: 1px solid var(--linea-suave);
}
.barra__titulo { font-size: 16.5px; text-align: center; letter-spacing: -.02em; }
.barra__hueco { display: block; }

.boton-icono {
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 0; background: transparent; border-radius: 12px; cursor: pointer;
  color: var(--tinta); transition: background .15s;
}
.boton-icono:hover { background: var(--azul-humo); }
.boton-icono--sobre-azul { color: #fff; }
.boton-icono--sobre-azul:hover { background: rgba(255, 255, 255, .14); }

.vista {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 18px 18px calc(var(--tabbar) + 26px);
  scrollbar-width: thin;
}
.vista--limpia { padding-bottom: 26px; }
.vista::-webkit-scrollbar { width: 6px; }
.vista::-webkit-scrollbar-thumb { background: #D3DBE7; border-radius: 4px; }

.seccion { margin-top: 26px; }
.seccion__titulo {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin-bottom: 12px;
}
.seccion__titulo h2 { font-size: 15.5px; letter-spacing: -.02em; }
.seccion__titulo a, .seccion__titulo button {
  font-size: 13px; color: var(--azul); background: none; border: 0; cursor: pointer; font-weight: 500;
}

.eyebrow {
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--tinta-45); font-weight: 600;
}

/* ---------- 6. Tabbar ----------------------------------------- */
.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--tabbar);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(255, 255, 255, .93);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--linea);
  padding-bottom: 4px;
  z-index: 20;
}
.tabbar__item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--tinta-45); font-size: 10.5px; font-weight: 500; letter-spacing: -.01em;
  transition: color .15s;
}
.tabbar__item.activo { color: var(--azul); }
.tabbar__ico { display: grid; place-items: center; height: 26px; }
.tabbar__item--eje .tabbar__ico {
  width: 42px; height: 42px; border-radius: 14px; margin-top: -14px;
  background: var(--azul); color: #fff;
  box-shadow: 0 8px 18px rgba(23, 81, 214, .32);
  transition: transform .16s;
}
.tabbar__item--eje.activo .tabbar__ico { background: var(--azul-tinta); }
.tabbar__item--eje:hover .tabbar__ico { transform: translateY(-2px); }
.tabbar__item--eje .tabbar__texto { margin-top: -2px; }

/* ---------- 7. Libreta (firma visual) ------------------------- */
.libreta {
  position: relative; overflow: hidden;
  border-radius: var(--r-l);
  padding: 20px 20px 18px;
  color: #fff;
  background:
    linear-gradient(155deg, #0E3576 0%, #071B3D 62%, #061633 100%);
  box-shadow: 0 14px 34px rgba(7, 27, 61, .28);
}
.libreta::before {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(to bottom,
      transparent 0 27px, rgba(255, 255, 255, .045) 27px 28px);
  pointer-events: none;
}
.libreta::after {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(to bottom, #2F7BFF, #7FB0FF);
}

.libreta__cabeza {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  position: relative;
}
.libreta__rotulo {
  font-size: 11px; letter-spacing: .15em; text-transform: uppercase;
  color: #9DBBE8; font-weight: 600;
}
.libreta__folio {
  font-size: 11px; color: #8FAFDD; border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 999px; padding: 3px 9px;
}
.libreta__saldo {
  font-family: var(--cifra); font-variant-numeric: tabular-nums;
  font-size: 36px; font-weight: 500; letter-spacing: -.045em;
  margin: 8px 0 2px; position: relative;
}
.libreta__pie { font-size: 12.5px; color: #A9C4E8; position: relative; }

.libreta__desglose {
  position: relative; margin-top: 16px; padding-top: 14px;
  border-top: 1px dashed rgba(255, 255, 255, .22);
  display: grid; gap: 7px;
}
.libreta__desglose .dato__rotulo { color: #A9C4E8; }
.libreta__desglose .dato__valor { color: #fff; }
.libreta__desglose .dato__linea { border-bottom-color: rgba(255, 255, 255, .22); }

.libreta__acciones { display: flex; gap: 8px; margin-top: 16px; position: relative; }
.libreta__acciones .boton {
  flex: 1 1 0; min-width: 0; padding: 12px 10px; font-size: 13.5px; gap: 6px;
}

/* medidor de cupo */
.medidor { margin-top: 16px; position: relative; }
.medidor__cabeza {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12.5px; color: #A9C4E8; margin-bottom: 7px;
}
.medidor__cabeza strong { color: #fff; font-family: var(--cifra); font-size: 13.5px; font-weight: 500; }
.medidor__pista {
  height: 7px; border-radius: 999px; background: rgba(255, 255, 255, .16); overflow: hidden;
  display: flex;
}
.medidor__usado { background: #7FB0FF; height: 100%; transition: width .8s cubic-bezier(.2, .8, .3, 1); }
.medidor__nota { font-size: 11.5px; color: #8FAFDD; margin-top: 7px; }

/* ---------- 8. Tarjetas y listas ------------------------------ */
.tarjeta {
  background: var(--papel); border: 1px solid var(--linea);
  border-radius: var(--r-m); padding: 16px;
  box-shadow: var(--sombra-1);
}
.tarjeta--plana { box-shadow: none; }
.tarjeta + .tarjeta { margin-top: 10px; }

.lista { display: grid; gap: 10px; }

.item {
  display: flex; align-items: center; gap: 13px; width: 100%; text-align: left;
  background: var(--papel); border: 1px solid var(--linea); border-radius: var(--r-m);
  padding: 14px; cursor: pointer;
  transition: border-color .16s, transform .16s, box-shadow .16s;
}
.item:hover { border-color: #C6D5EC; box-shadow: var(--sombra-2); transform: translateY(-1px); }
.item:active { transform: translateY(0); }
.item__marca {
  width: 42px; height: 42px; flex: none; border-radius: 13px;
  display: grid; place-items: center;
  background: var(--azul-niebla); color: var(--azul-tinta);
}
.item__marca--ok { background: var(--ok-suave); color: var(--ok); }
.item__marca--espera { background: var(--espera-suave); color: var(--espera); }
.item__marca--no { background: var(--no-suave); color: var(--no); }
.item__cuerpo { flex: 1; min-width: 0; }
.item__titulo { font-weight: 600; font-size: 14.5px; letter-spacing: -.015em; }
.item__sub { font-size: 12.5px; color: var(--tinta-45); margin-top: 2px; }
.item__derecha { text-align: right; flex: none; display: grid; gap: 4px; justify-items: end; }
.item__monto { font-family: var(--cifra); font-size: 14px; font-variant-numeric: tabular-nums; }
.item__flecha { color: var(--tinta-25); flex: none; }

.pastilla {
  display: inline-block; font-size: 11.5px; font-weight: 600; letter-spacing: -.01em;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.pastilla--ok { background: var(--ok-suave); color: var(--ok); }
.pastilla--espera { background: var(--espera-suave); color: var(--espera); }
.pastilla--no { background: var(--no-suave); color: var(--no); }
.pastilla--neutro { background: var(--azul-humo); color: var(--tinta-45); }
.item__marca--tenue { background: var(--azul-humo); color: var(--tinta-45); }
.pastilla--azul { background: var(--azul-niebla); color: var(--azul-tinta); }

/* datos con línea de puntos (estilo libro contable) */
.dato { display: flex; align-items: baseline; gap: 8px; font-size: 13.5px; }
.dato__rotulo { color: var(--tinta-45); flex: none; }
.dato__linea { flex: 1; border-bottom: 1px dotted var(--linea); transform: translateY(-3px); }
.dato__valor { font-weight: 600; flex: none; letter-spacing: -.01em; }
.dato--fuerte .dato__valor { font-size: 15px; }
.datos { display: grid; gap: 9px; }

/* ---------- 9. Botones ---------------------------------------- */
.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px 18px; border-radius: 14px; cursor: pointer;
  font-family: var(--texto); font-size: 15px; font-weight: 600; letter-spacing: -.015em;
  border: 1px solid transparent; background: var(--azul); color: #fff;
  transition: background .15s, transform .12s, box-shadow .15s, opacity .15s;
  box-shadow: 0 6px 16px rgba(23, 81, 214, .22);
}
.boton:hover { background: #1246BE; }
.boton:active { transform: translateY(1px); }
.boton[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }

.boton--tenue {
  background: var(--azul-niebla); color: var(--azul-tinta); box-shadow: none;
}
.boton--tenue:hover { background: #DDE8FD; }

.boton--linea {
  background: transparent; color: var(--tinta); border-color: var(--linea); box-shadow: none;
}
.boton--linea:hover { background: var(--azul-humo); border-color: #C6D5EC; }

.boton--claro {
  background: rgba(255, 255, 255, .14); color: #fff;
  border-color: rgba(255, 255, 255, .28); box-shadow: none; backdrop-filter: blur(4px);
}
.boton--claro:hover { background: rgba(255, 255, 255, .24); }

.boton--peligro { background: var(--no); box-shadow: none; }
.boton--peligro:hover { background: #A72039; }

.boton--corto { width: auto; padding: 11px 16px; font-size: 14px; }
.boton--mini { width: auto; padding: 8px 13px; font-size: 13px; border-radius: 11px; box-shadow: none; }

.acciones { display: grid; gap: 9px; margin-top: 18px; }
.acciones--par { grid-template-columns: 1fr 1fr; }

/* barra de acción fija al pie de una vista */
.pie-fijo {
  position: sticky; bottom: 0; margin: 18px -18px -26px;
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--papel) 72%, rgba(255, 255, 255, 0));
}
.vista--limpia .pie-fijo { margin-bottom: -26px; }

/* ---------- 10. Formularios ----------------------------------- */
.campo { display: grid; gap: 6px; margin-bottom: 14px; }
.campo > label { font-size: 13px; font-weight: 600; color: var(--tinta-70); letter-spacing: -.01em; }
.campo__nota { font-size: 12px; color: var(--tinta-45); }

.entrada, select.entrada, textarea.entrada {
  width: 100%; padding: 13px 14px; border-radius: 13px;
  border: 1px solid var(--linea); background: var(--papel); color: var(--tinta);
  font-family: var(--texto); font-size: 15px; transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.entrada:focus {
  outline: none; border-color: var(--azul-vivo);
  box-shadow: 0 0 0 3px rgba(47, 123, 255, .14);
}
.entrada::placeholder { color: var(--tinta-25); }
textarea.entrada { min-height: 84px; resize: vertical; }
select.entrada {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236B7688' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px;
}

.entrada--monto {
  font-family: var(--cifra); font-size: 26px; font-weight: 500; letter-spacing: -.04em;
  text-align: center; padding: 16px 14px;
}

.grupo-entrada { position: relative; display: flex; align-items: center; }
.grupo-entrada .entrada { padding-right: 46px; }
.grupo-entrada__boton {
  position: absolute; right: 6px; border: 0; background: none; cursor: pointer;
  color: var(--tinta-45); width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
}
.grupo-entrada__boton:hover { background: var(--azul-humo); color: var(--tinta); }

/* deslizador de monto */
.deslizador {
  -webkit-appearance: none; appearance: none; width: 100%; height: 26px;
  background: transparent; cursor: pointer;
}
.deslizador::-webkit-slider-runnable-track {
  height: 6px; border-radius: 999px;
  background: linear-gradient(to right, var(--azul) var(--relleno, 50%), var(--linea) var(--relleno, 50%));
}
.deslizador::-moz-range-track { height: 6px; border-radius: 999px; background: var(--linea); }
.deslizador::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--azul); }
.deslizador::-webkit-slider-thumb {
  -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; border: 2px solid var(--azul); margin-top: -9px;
  box-shadow: 0 2px 8px rgba(10, 42, 94, .22);
}
.deslizador::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%; background: #fff;
  border: 2px solid var(--azul); box-shadow: 0 2px 8px rgba(10, 42, 94, .22);
}
.deslizador__topes {
  display: flex; justify-content: space-between; font-size: 11.5px; color: var(--tinta-45);
  font-family: var(--cifra);
}

/* chips de plazo / opciones */
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  padding: 9px 14px; border-radius: 11px; cursor: pointer; font-size: 13.5px; font-weight: 500;
  border: 1px solid var(--linea); background: var(--papel); color: var(--tinta-70);
  transition: all .14s;
}
.chip:hover { border-color: #C6D5EC; background: var(--azul-humo); }
.chip[aria-pressed="true"] {
  background: var(--azul-tinta); border-color: var(--azul-tinta); color: #fff; font-weight: 600;
}

/* opción tipo radio en tarjeta */
.opcion {
  display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left;
  padding: 13px 14px; border-radius: var(--r-s); cursor: pointer;
  border: 1px solid var(--linea); background: var(--papel); transition: all .14s;
}
.opcion:hover { border-color: #C6D5EC; }
.opcion[aria-pressed="true"] { border-color: var(--azul); background: var(--azul-niebla); }
.opcion__marca {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--linea);
  flex: none; margin-top: 1px; display: grid; place-items: center; transition: all .14s;
}
.opcion[aria-pressed="true"] .opcion__marca { border-color: var(--azul); background: var(--azul); }
.opcion[aria-pressed="true"] .opcion__marca::after {
  content: ''; width: 7px; height: 7px; border-radius: 50%; background: #fff;
}
.opcion__titulo { font-weight: 600; font-size: 14px; }
.opcion__sub { font-size: 12.5px; color: var(--tinta-45); margin-top: 2px; }

/* casilla de verificación */
.casilla {
  display: flex; gap: 11px; align-items: flex-start; cursor: pointer;
  padding: 12px 13px; border-radius: var(--r-s); border: 1px solid var(--linea);
  background: var(--papel); transition: border-color .14s, background .14s;
  font-size: 13px; line-height: 1.5; color: var(--tinta-70);
}
.casilla:hover { border-color: #C6D5EC; }
.casilla input { position: absolute; opacity: 0; width: 0; height: 0; }
.casilla__caja {
  width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--linea);
  flex: none; margin-top: 1px; display: grid; place-items: center; color: transparent;
  transition: all .14s;
}
.casilla input:checked ~ .casilla__caja {
  background: var(--azul); border-color: var(--azul); color: #fff;
}
.casilla input:focus-visible ~ .casilla__caja { outline: 2.5px solid var(--azul-vivo); outline-offset: 2px; }
.casilla__caja .ico { width: 14px; height: 14px; }

/* interruptor */
.interruptor {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 13px 0; cursor: pointer;
}
.interruptor + .interruptor { border-top: 1px solid var(--linea-suave); }
.interruptor__texto { font-size: 14px; font-weight: 500; }
.interruptor__nota { font-size: 12.5px; color: var(--tinta-45); margin-top: 1px; }
.interruptor input { position: absolute; opacity: 0; }
.interruptor__pista {
  width: 46px; height: 27px; border-radius: 999px; background: #CFD8E6; flex: none;
  position: relative; transition: background .18s;
}
.interruptor__pista::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px;
  background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  transition: transform .18s cubic-bezier(.3, 1.4, .5, 1);
}
.interruptor input:checked ~ .interruptor__pista { background: var(--azul); }
.interruptor input:checked ~ .interruptor__pista::after { transform: translateX(19px); }

/* subida de documentos */
.subida {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  border: 1.5px dashed var(--linea); border-radius: var(--r-s); background: var(--papel);
  padding: 13px 14px; cursor: pointer; transition: all .15s;
}
.subida:hover { border-color: var(--azul-vivo); background: var(--azul-humo); }
.subida--lista { border-style: solid; border-color: var(--ok); background: var(--ok-suave); }
.subida__ico { color: var(--tinta-45); }
.subida--lista .subida__ico { color: var(--ok); }
.subida__titulo { font-size: 14px; font-weight: 600; }
.subida__nota { font-size: 12px; color: var(--tinta-45); }

/* ---------- 11. Avisos en línea -------------------------------- */
.nota {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 13px 14px; border-radius: var(--r-s); font-size: 13px; line-height: 1.55;
  border: 1px solid var(--linea); background: var(--azul-humo); color: var(--tinta-70);
}
.nota .ico { width: 19px; height: 19px; margin-top: 1px; color: var(--azul); }
.nota strong { color: var(--tinta); font-weight: 600; }
.nota--ok { background: var(--ok-suave); border-color: #C8E6D8; }
.nota--ok .ico { color: var(--ok); }
.nota--espera { background: var(--espera-suave); border-color: #EEDCB8; }
.nota--espera .ico { color: var(--espera); }
.nota--no { background: var(--no-suave); border-color: #F3CDD5; }
.nota--no .ico { color: var(--no); }

/* ---------- 12. Hoja modal ------------------------------------ */
.hoja {
  position: absolute; inset: 0; z-index: 50;
  display: flex; align-items: flex-end;
}
.hoja[hidden] { display: none; }

.hoja__velo {
  position: absolute; inset: 0; cursor: pointer;
  background: rgba(7, 20, 41, .5); backdrop-filter: blur(2px);
  animation: aparece .22s ease both;
}
@keyframes aparece { from { opacity: 0; } to { opacity: 1; } }

.hoja__caja {
  position: relative; width: 100%;
  max-height: 86%; display: flex; flex-direction: column;
  background: var(--papel); border-radius: 26px 26px 0 0;
  box-shadow: 0 -12px 40px rgba(7, 27, 61, .24);
  animation: sube .3s cubic-bezier(.2, .85, .3, 1);
}
.hoja__caja:focus { outline: none; }
.hoja--alta .hoja__caja { height: 92%; max-height: 92%; }
@keyframes sube { from { transform: translateY(100%); } to { transform: none; } }

.hoja__asa {
  width: 40px; height: 4px; border-radius: 999px; background: var(--linea);
  margin: 10px auto 0; flex: none;
}
.hoja__cabeza {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 16px 10px; flex: none;
}
.hoja__cabeza h2 { font-size: 17px; letter-spacing: -.025em; }
.hoja__cuerpo { padding: 4px 18px 20px; overflow-y: auto; flex: 1; min-height: 0; }
.hoja__pie {
  padding: 14px 18px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--linea-suave); flex: none; background: var(--papel);
}

/* ---------- 13. Brindis (toast) -------------------------------- */
.brindis {
  position: absolute; top: 44px; left: 14px; right: 14px; z-index: 60;
  display: flex; justify-content: center; pointer-events: none;
  opacity: 0; transform: translateY(-14px); transition: opacity .24s, transform .24s;
}
.brindis.visible { opacity: 1; transform: none; }
.brindis__pieza {
  display: flex; align-items: center; gap: 10px;
  background: var(--azul-noche); color: #fff;
  padding: 11px 16px; border-radius: 14px; font-size: 13.5px; line-height: 1.35;
  box-shadow: 0 12px 28px rgba(7, 27, 61, .32); max-width: 100%;
}
.brindis__pieza .ico { width: 18px; height: 18px; flex: none; }
.brindis__pieza--ok .ico { color: #6EE7B0; }
.brindis__pieza--no .ico { color: #FF9BAE; }

/* ---------- 14. Login ----------------------------------------- */
.acceso {
  flex: 1; display: flex; flex-direction: column; overflow-y: auto;
  background: linear-gradient(168deg, #0E3576 0%, #071B3D 58%, #061633 100%);
  color: #fff; padding: 30px 26px calc(26px + env(safe-area-inset-bottom));
  position: relative;
}
.acceso::before {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(to bottom, transparent 0 33px, rgba(255, 255, 255, .035) 33px 34px);
  pointer-events: none;
}
.acceso > * { position: relative; }
.acceso__marca { display: flex; align-items: center; gap: 11px; margin-bottom: auto; }
.acceso__logo {
  width: 40px; height: 40px; border-radius: 11px; background: #fff; color: var(--azul-noche);
  display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 17px;
  letter-spacing: -.04em;
}
.acceso__marca div { font-size: 12px; color: #A8C0E6; letter-spacing: .1em; text-transform: uppercase; }
.acceso__marca strong { display: block; font-family: var(--display); font-size: 14.5px; letter-spacing: -.01em; color: #fff; text-transform: none; }

.acceso h1 { font-size: 30px; letter-spacing: -.035em; margin: 34px 0 8px; }
.acceso h1 em { font-style: normal; color: #7FB0FF; }
.acceso > p { color: #B9CBE8; font-size: 14.5px; margin-bottom: 24px; max-width: 34ch; }

.acceso .campo > label { color: #B9CBE8; }
.acceso .entrada {
  background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .22); color: #fff;
}
.acceso .entrada::placeholder { color: #7E99C2; }
.acceso .entrada:focus { border-color: #7FB0FF; box-shadow: 0 0 0 3px rgba(127, 176, 255, .18); background: rgba(255, 255, 255, .14); }
.acceso .grupo-entrada__boton { color: #A8C0E6; }
.acceso .grupo-entrada__boton:hover { background: rgba(255, 255, 255, .12); color: #fff; }

.acceso__fila { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 20px; }
.acceso__fila .casilla {
  border: 0; background: none; padding: 0; color: #B9CBE8; font-size: 13px;
}
.acceso__fila .casilla__caja { border-color: rgba(255, 255, 255, .35); width: 18px; height: 18px; }

.acceso__boton { background: #fff; color: var(--azul-noche); box-shadow: none; }
.acceso__boton:hover { background: #E7EFFC; }

.acceso__huella {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  margin-top: 16px; background: none; border: 0; cursor: pointer;
  color: #B9CBE8; font-size: 13.5px; width: 100%; padding: 10px;
}
.acceso__huella:hover { color: #fff; }
.acceso__huella .ico { width: 24px; height: 24px; }

.acceso__pista {
  margin-top: 22px; padding: 12px 14px; border-radius: var(--r-s);
  border: 1px dashed rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .05);
  font-size: 12.5px; color: #A8C0E6; line-height: 1.5;
}
.acceso__pista strong { color: #fff; font-family: var(--cifra); font-weight: 500; }
.acceso__legal { margin-top: 18px; font-size: 11.5px; color: #7E99C2; text-align: center; line-height: 1.5; }

/* ---------- 15. Asistente (wizard) ---------------------------- */
.progreso { display: flex; gap: 4px; padding: 0 18px 12px; background: var(--papel); }
.progreso__tramo {
  flex: 1; height: 3px; border-radius: 999px; background: var(--linea);
  transition: background .3s;
}
.progreso__tramo.lleno { background: var(--azul); }

.paso__titulo { font-size: 22px; letter-spacing: -.03em; margin-bottom: 6px; }
.paso__texto { color: var(--tinta-45); font-size: 14px; margin-bottom: 20px; line-height: 1.55; }

/* resumen sticky de cuota en el simulador */
.resumen-cuota {
  border-radius: var(--r-m); padding: 15px 16px; color: #fff;
  background: linear-gradient(150deg, #0E3576, #071B3D);
  display: grid; gap: 3px;
}
.resumen-cuota__rotulo { font-size: 11.5px; letter-spacing: .13em; text-transform: uppercase; color: #9DBBE8; font-weight: 600; }
.resumen-cuota__valor { font-family: var(--cifra); font-size: 30px; letter-spacing: -.045em; font-weight: 500; }
.resumen-cuota__pie { font-size: 12.5px; color: #A9C4E8; }
.resumen-cuota__reglas {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 12px;
  padding-top: 12px; border-top: 1px dashed rgba(255, 255, 255, .22);
}
.resumen-cuota__reglas div span { display: block; font-size: 11px; color: #9DBBE8; }
.resumen-cuota__reglas div strong { font-family: var(--cifra); font-size: 13.5px; font-weight: 500; letter-spacing: -.02em; }

/* ---------- 16. Evaluación ------------------------------------ */
.evaluacion {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  padding: 26px 22px; background: var(--papel); overflow-y: auto;
}
.evaluacion__cabeza { text-align: center; margin-bottom: 26px; }
.evaluacion__anillo {
  width: 68px; height: 68px; margin: 0 auto 16px; border-radius: 50%;
  border: 3px solid var(--azul-niebla); border-top-color: var(--azul);
  animation: gira 1s linear infinite;
}
@keyframes gira { to { transform: rotate(360deg); } }
.evaluacion h2 { font-size: 20px; letter-spacing: -.03em; }
.evaluacion__cabeza p { color: var(--tinta-45); font-size: 13.5px; margin-top: 6px; }

.regla {
  display: flex; align-items: center; gap: 11px; padding: 11px 2px;
  border-bottom: 1px solid var(--linea-suave); opacity: .32;
  transition: opacity .3s;
}
.regla.activa { opacity: 1; }
.regla__id {
  font-family: var(--cifra); font-size: 11px; color: var(--tinta-25); flex: none; width: 34px;
}
.regla__texto { flex: 1; font-size: 13.5px; letter-spacing: -.01em; }
.regla__detalle { font-size: 11.5px; color: var(--tinta-45); margin-top: 1px; }
.regla__marca { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 50%; }
.regla__marca--pendiente { border: 2px solid var(--linea-suave); border-top-color: var(--azul); animation: gira .8s linear infinite; }
.regla__marca--ok { background: var(--ok-suave); color: var(--ok); }
.regla__marca--alerta { background: var(--espera-suave); color: var(--espera); }
.regla__marca--falla { background: var(--no-suave); color: var(--no); }
.regla__marca .ico { width: 14px; height: 14px; }

/* ---------- 17. Resultado ------------------------------------- */
.resultado {
  flex: 1; display: flex; flex-direction: column; overflow-y: auto;
  padding: 30px 22px calc(22px + env(safe-area-inset-bottom)); text-align: center;
}
.resultado--ok { background: linear-gradient(180deg, var(--ok-suave), var(--papel) 42%); }
.resultado--espera { background: linear-gradient(180deg, var(--espera-suave), var(--papel) 42%); }
.resultado--no { background: linear-gradient(180deg, var(--no-suave), var(--papel) 42%); }

.resultado__emblema {
  width: 82px; height: 82px; border-radius: 50%; margin: 8px auto 20px;
  display: grid; place-items: center; background: var(--papel);
  box-shadow: 0 10px 26px rgba(11, 18, 32, .12);
  animation: sello .5s cubic-bezier(.2, 1.5, .4, 1) both;
}
@keyframes sello { from { transform: scale(.5); opacity: 0; } to { transform: none; opacity: 1; } }
.resultado__emblema .ico { width: 40px; height: 40px; stroke-width: 2; }
.resultado--ok .resultado__emblema { color: var(--ok); }
.resultado--espera .resultado__emblema { color: var(--espera); }
.resultado--no .resultado__emblema { color: var(--no); }

.resultado h2 { font-size: 25px; letter-spacing: -.035em; margin-bottom: 8px; }
.resultado__texto { color: var(--tinta-70); font-size: 14.5px; line-height: 1.6; max-width: 34ch; margin: 0 auto; }
.resultado__monto {
  font-family: var(--cifra); font-size: 34px; letter-spacing: -.045em; font-weight: 500;
  margin: 20px 0 4px;
}
.resultado__cuerpo { text-align: left; margin-top: 24px; }

/* ---------- 18. Tabla de amortización ------------------------- */
.tabla { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tabla th {
  text-align: right; font-weight: 600; color: var(--tinta-45); font-size: 11px;
  letter-spacing: .06em; text-transform: uppercase; padding: 8px 6px;
  border-bottom: 1.5px solid var(--linea); position: sticky; top: 0; background: var(--papel);
}
.tabla th:first-child, .tabla td:first-child { text-align: left; }
.tabla td {
  padding: 9px 6px; text-align: right; border-bottom: 1px solid var(--linea-suave);
  font-family: var(--cifra); font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.tabla tr:nth-child(even) td { background: #FAFCFE; }
.tabla__nota { font-size: 12px; color: var(--tinta-45); margin-top: 12px; line-height: 1.5; }

/* ---------- 19. Línea de tiempo / bitácora -------------------- */
.linea-tiempo { display: grid; gap: 0; margin-top: 4px; }
.hito { display: flex; gap: 13px; }
.hito__eje { display: flex; flex-direction: column; align-items: center; flex: none; }
.hito__punto {
  width: 11px; height: 11px; border-radius: 50%; background: var(--azul); margin-top: 5px;
  box-shadow: 0 0 0 3px var(--azul-niebla);
}
.hito__punto--tenue { background: var(--linea); box-shadow: 0 0 0 3px var(--papel-2); }
.hito__hilo { width: 1.5px; flex: 1; background: var(--linea); margin: 4px 0; }
.hito__cuerpo { padding-bottom: 18px; flex: 1; }
.hito__titulo { font-size: 13.5px; font-weight: 600; letter-spacing: -.01em; }
.hito__meta { font-size: 12px; color: var(--tinta-45); margin-top: 2px; }
.hito__sello { font-family: var(--cifra); font-size: 11px; color: var(--tinta-25); margin-top: 3px; }

/* ---------- 20. Firma / OTP ----------------------------------- */
.otp { display: flex; gap: 9px; justify-content: center; margin: 20px 0 10px; }
.otp input {
  width: 46px; height: 56px; text-align: center; border-radius: 13px;
  border: 1.5px solid var(--linea); background: var(--papel);
  font-family: var(--cifra); font-size: 22px; font-weight: 500; color: var(--tinta);
}
.otp input:focus {
  outline: none; border-color: var(--azul); box-shadow: 0 0 0 3px rgba(47, 123, 255, .14);
}
.otp input.lleno { border-color: var(--azul); background: var(--azul-niebla); }

.documento-firma {
  border: 1px solid var(--linea); border-radius: var(--r-s); background: var(--papel);
  padding: 16px; font-size: 12.5px; line-height: 1.6; color: var(--tinta-70);
  max-height: 210px; overflow-y: auto;
}
.documento-firma h4 {
  font-size: 13px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--tinta-45); margin-bottom: 10px;
}
.documento-firma p + p { margin-top: 9px; }

.sello-firma {
  display: flex; gap: 11px; align-items: center; margin-top: 12px; padding: 12px 13px;
  border: 1px dashed var(--ok); border-radius: var(--r-s); background: var(--ok-suave);
  font-size: 12.5px; color: #0B5F41;
}
.sello-firma .ico { color: var(--ok); }
.sello-firma strong { display: block; font-size: 13px; }

/* ---------- 21. Vacíos y varios ------------------------------- */
.vacio { text-align: center; padding: 46px 20px; }
.vacio__marca {
  width: 58px; height: 58px; border-radius: 18px; margin: 0 auto 16px;
  background: var(--azul-niebla); color: var(--azul); display: grid; place-items: center;
}
.vacio__marca .ico { width: 26px; height: 26px; }
.vacio h3 { font-size: 16.5px; margin-bottom: 6px; }
.vacio p { color: var(--tinta-45); font-size: 13.5px; max-width: 30ch; margin: 0 auto 18px; line-height: 1.55; }

.rejilla-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.mini-tarjeta {
  border: 1px solid var(--linea); border-radius: var(--r-s); background: var(--papel);
  padding: 13px; display: grid; gap: 3px;
}
.mini-tarjeta span { font-size: 11.5px; color: var(--tinta-45); }
.mini-tarjeta strong { font-family: var(--cifra); font-size: 17px; font-weight: 500; letter-spacing: -.03em; }

.aviso-fila { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--linea-suave); }
.aviso-fila:last-child { border-bottom: 0; }
.aviso-fila__punto { width: 8px; height: 8px; border-radius: 50%; background: var(--azul); margin-top: 6px; flex: none; }
.aviso-fila__punto--leido { background: var(--linea); }
.aviso-fila__titulo { font-size: 13.5px; font-weight: 600; }
.aviso-fila__cuerpo { font-size: 12.5px; color: var(--tinta-45); margin-top: 2px; line-height: 1.5; }
.aviso-fila__fecha { font-size: 11.5px; color: var(--tinta-25); margin-top: 3px; }

.filtros { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; }
.filtros::-webkit-scrollbar { display: none; }

.perfil-cabeza { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.perfil-avatar {
  width: 58px; height: 58px; border-radius: 20px; flex: none;
  background: linear-gradient(145deg, #1751D6, #0A2A5E); color: #fff;
  display: grid; place-items: center; font-family: var(--display); font-size: 21px; font-weight: 700;
  letter-spacing: -.03em;
}
.perfil-cabeza h2 { font-size: 19px; letter-spacing: -.03em; }
.perfil-cabeza p { font-size: 13px; color: var(--tinta-45); margin-top: 2px; }

.insignia {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600;
  color: var(--ok); background: var(--ok-suave); padding: 3px 9px; border-radius: 999px; margin-top: 6px;
}
.insignia .ico { width: 13px; height: 13px; }

/* ---------- 22. Responsivo ------------------------------------ */
@media (max-width: 1080px) {
  .marco { grid-template-columns: 1fr; gap: 34px; padding: 34px 24px; }
  .lateral { max-width: 620px; margin: 0 auto; text-align: center; }
  .lateral__marca, .fichas { justify-content: center; }
  .lateral p { margin: 0 auto; }
  .dispositivo { margin: 0 auto; }
}

@media (max-width: 640px) {
  .marco {
    display: block; padding: 0; min-height: 100dvh; background: var(--papel-2);
  }
  .lateral { display: none; }
  .dispositivo {
    width: 100%; height: 100dvh; border-radius: 0; padding: 0; box-shadow: none; background: var(--papel-2);
  }
  .pantalla { border-radius: 0; }
  .estado-movil { display: none; }
  .vista { padding-bottom: calc(var(--tabbar) + 30px + env(safe-area-inset-bottom)); }
  .tabbar { padding-bottom: calc(4px + env(safe-area-inset-bottom)); height: calc(var(--tabbar) + env(safe-area-inset-bottom)); }
  .brindis { top: 12px; }
  .flotante-demo { display: grid; }
}

/* botón flotante para abrir el panel de demo en móvil */
.flotante-demo {
  display: none; position: fixed; right: 14px; bottom: calc(var(--tabbar) + 16px + env(safe-area-inset-bottom));
  width: 44px; height: 44px; border-radius: 14px; place-items: center; z-index: 40;
  background: var(--azul-noche); color: #fff; border: 0; cursor: pointer;
  box-shadow: 0 8px 20px rgba(7, 27, 61, .3);
}

/* ---------- 23. Movimiento reducido --------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .evaluacion__anillo, .regla__marca--pendiente { animation: none !important; border-top-color: var(--azul); }
}

/* ---------- 24. Impresión ------------------------------------- */
@media print {
  .marco { display: block; background: #fff; padding: 0; }
  .lateral, .tabbar, .estado-movil, .flotante-demo { display: none !important; }
  .dispositivo { width: 100%; height: auto; box-shadow: none; padding: 0; }
  .pantalla { height: auto; border-radius: 0; }
}
