/* ═══════════════════════════════════════════════════════════════════════════
   SOYLA MONEDA — Librería de componentes compartidos (v2.1).
   Únicas dos tipografías autorizadas:
     · Oswald Light (300): cifras principales / montos calculables (.num)
     · Inter Regular (400): toda la interfaz, títulos y etiquetas (sin bold)
   Base de diseño 360×720 = escala 1 (--u: 1px). Escala hasta 450px.
   ═══════════════════════════════════════════════════════════════════════════ */

@font-face {
  font-family: Inter;
  src: url(/recursos/fuentes/Inter.ttf) format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Oswald;
  src: url(vendor/fuentes-2026-11-15/oswald-300.woff2) format('woff2');
  font-weight: 300;
  font-display: swap;
}

:root {
  --ancho-app: clamp(320px, 100vw, 450px);
  --u: calc(var(--ancho-app) / 360);
}

.moneda {
  --teal: #006060;
  --teal-osc: #004040;
  --tinta: #002020;
  --tether: #00a0a0;
  --lime: #c0e020;
  --lime-suave: #eef6cc;
  --verde: #00803a;
  --verde-vivo: #00c040;
  --naranja: #f0502a;
  --naranja-graf: #f26b2d;
  --link: #1565c0;
  --muted: #5a6e6e;
  --muted-texto: #3d5252;
  --muted-suave: #758584;
  --panel: #e4eceb;
  --panel-card: #f1f5f5;
  --surface: #ffffff;
  --line: #b8d4d2;

  --fondo: var(--panel);
  --carta: var(--surface);
  --t1: var(--tinta);
  --t2: var(--muted);
  --titulo: var(--teal);
  --enlace: var(--link);
  --sep: var(--line);
  --ico-f: var(--teal);
  --ico-t: #ffffff;
  --barra: #d5dada;
  color-scheme: light;
}

.osc .moneda {
  --fondo: #002020;
  --carta: #003838;
  --panel-card: #002c2c;
  --t1: #ffffff;
  --t2: #b8d4d2;
  --titulo: #c0e020;
  --enlace: #c0e020;
  --sep: rgba(184, 212, 210, .2);
  --ico-f: #006060;
  --ico-t: #ffffff;
  --barra: #1f4d4d;
  color-scheme: dark;
}

/* Regla estricta sin negritas: solo Inter Regular (400) y Oswald Light (300). */
:where(.moneda, .moneda *, .moneda *::before, .moneda *::after,
       .escaner, .escaner *, .escaner *::before, .escaner *::after) {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  margin: 0;
  padding: 0;
  font-weight: 400;
  font-style: normal;
}

.escaner .cam-lst-fila.on .cam-lst-txt b { font-weight: 400; }

body.moneda-cuerpo {
  margin: 0;
  padding: 0;
  min-height: 100dvh;
  background: #d6e0df;
  font-family: Inter, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  font-weight: 400;
  color: #002020;
}
.osc body.moneda-cuerpo { background: #001616; color: #ffffff; }
body.moneda-cuerpo #escanear { display: none; }

.moneda {
  position: relative;
  width: var(--ancho-app);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--fondo);
  color: var(--t1);
  overflow-x: hidden;
  font-size: calc(14 * var(--u));
  font-weight: 400;
}

:where(.moneda, .escaner) :where(button, input, select, textarea) {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
:where(.moneda, .escaner) button:disabled { cursor: default; opacity: .45; }
:where(.moneda, .escaner) [hidden] { display: none !important; }

.moneda .num,
.escaner .num,
.escaner .esc-monto-inp,
.escaner .esc-cant-circ {
  font-family: Oswald, 'Arial Narrow', sans-serif;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
}

.moneda .svg-ico,
.escaner .svg-ico {
  width: calc(20 * var(--u));
  height: calc(20 * var(--u));
  fill: currentColor;
  flex: none;
  display: inline-block;
  vertical-align: middle;
}

/* ── Pantallas y cabeceras reutilizables ─────────────────────────────────── */
.pantalla { display: none; min-height: 100dvh; flex-direction: column; }
.pantalla.on { display: flex; }

.appbar-limpia {
  height: calc(56 * var(--u));
  padding: env(safe-area-inset-top, 0px) calc(16 * var(--u)) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
}
.appbar-limpia .atras {
  display: inline-flex;
  align-items: center;
  gap: calc(8 * var(--u));
  font-size: calc(18 * var(--u));
  color: var(--teal-osc);
}
.osc .appbar-limpia .atras { color: var(--t1); }
.appbar-limpia .atras .svg-ico.chev { width: calc(14 * var(--u)); height: calc(14 * var(--u)); }
.atras-solo { width: calc(28 * var(--u)); height: calc(32 * var(--u)); display: grid; place-items: center; color: var(--t1); flex: none; }
.atras-solo .svg-ico { width: calc(14 * var(--u)); height: calc(14 * var(--u)); }
.appbar-link { font-size: calc(16 * var(--u)); color: var(--enlace); }
.ibtn { width: calc(40 * var(--u)); height: calc(40 * var(--u)); display: grid; place-items: center; color: var(--titulo); }
.ibtn.hoy {
  width: auto;
  padding: 0 calc(10 * var(--u));
  font-size: calc(13 * var(--u));
  background: var(--lime);
  color: #002020;
  border-radius: 999px;
  height: calc(28 * var(--u));
}

.badge-suave {
  font-size: calc(12 * var(--u));
  padding: calc(5 * var(--u)) calc(10 * var(--u));
  border-radius: 999px;
  background: var(--lime-suave);
  color: #004040;
}
.badge-suave.verde { background: #e3f6e8; color: #007a37; }

/* ── Botones reutilizables (48u zona pulgar + 40u circulares) ────────────── */
.moneda .btn-verde,
.escaner .btn-verde {
  width: 100%;
  height: calc(48 * var(--u));
  border-radius: calc(24 * var(--u));
  background: var(--verde, #00803a);
  color: #ffffff;
  font-size: calc(16 * var(--u));
  display: flex;
  align-items: center;
  justify-content: center;
}
.moneda .btn-suave,
.escaner .btn-suave {
  width: 100%;
  height: calc(48 * var(--u));
  border-radius: calc(24 * var(--u));
  background: var(--panel, #e4eceb);
  color: var(--enlace, #1565c0);
  font-size: calc(16 * var(--u));
  display: flex;
  align-items: center;
  justify-content: center;
}
.osc .moneda .btn-suave { background: #004b4b; }

.cir-btn {
  width: calc(40 * var(--u));
  height: calc(40 * var(--u));
  border-radius: 50%;
  background: var(--carta);
  color: var(--titulo);
  display: grid;
  place-items: center;
  flex: none;
}
.cir-btn .svg-ico { width: calc(18 * var(--u)); height: calc(18 * var(--u)); }

/* ── Selector segmentado pill (.seg y .pill-seg) ─────────────────────────── */
.seg,
.pill-seg {
  display: flex;
  background: var(--carta);
  border-radius: calc(24 * var(--u));
  height: calc(48 * var(--u));
  padding: 0;
  overflow: hidden;
  flex: none;
}
.pill-seg { height: calc(40 * var(--u)); border-radius: calc(20 * var(--u)); }
.seg button,
.pill-seg button {
  flex: 1;
  border-radius: calc(24 * var(--u));
  font-size: calc(16 * var(--u));
  color: var(--teal-osc);
}
.osc .seg button,
.osc .pill-seg button { color: var(--t1); }
.pill-seg button { font-size: calc(20 * var(--u)); border-radius: calc(20 * var(--u)); }
.seg button.on,
.pill-seg button.on { background: #006060; color: #ffffff; }

/* ── Insignias circulares, interruptores y filas estándar de tasas ───────── */
.ico {
  width: calc(40 * var(--u));
  height: calc(40 * var(--u));
  border-radius: 50%;
  background: var(--ico-f);
  color: var(--ico-t);
  display: grid;
  place-items: center;
  font-size: calc(18 * var(--u));
  flex: none;
}
.ico.t { background: var(--tether); color: #ffffff; }
.ico.dark { background: #002020; color: #ffffff; font-size: calc(14 * var(--u)); }

.interr {
  width: calc(44 * var(--u));
  height: calc(26 * var(--u));
  border-radius: calc(13 * var(--u));
  background: #b8d4d2;
  position: relative;
  flex: none;
  transition: background .15s;
}
.interr::after {
  content: "";
  position: absolute;
  left: calc(3 * var(--u));
  top: calc(3 * var(--u));
  width: calc(20 * var(--u));
  height: calc(20 * var(--u));
  border-radius: 50%;
  background: #ffffff;
  transition: left .15s;
}
.interr.on { background: var(--verde); }
.interr.on::after { left: calc(21 * var(--u)); }

.fila-tasa {
  width: 100%;
  height: calc(56 * var(--u));
  display: flex;
  align-items: center;
  gap: calc(10 * var(--u));
  border-bottom: 1px solid var(--sep);
  text-align: left;
}
.row-nom { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.row-nom b,
.row-nom-tit { font-size: calc(15 * var(--u)); color: var(--t1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-nom small,
.row-nom span { font-size: calc(14 * var(--u)); color: var(--t2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.row-val { text-align: right; display: flex; flex-direction: column; line-height: 1.2; white-space: nowrap; }
.row-val b,
.row-val-num { font-size: calc(18 * var(--u)); color: var(--t1); font-variant-numeric: tabular-nums; }
.row-val small,
.row-val span,
.row-var { font-size: calc(14 * var(--u)); color: var(--t2); font-variant-numeric: tabular-nums; }
.sube { color: var(--verde); }
.baja { color: var(--naranja); }
.igual { color: var(--t2); }

/* ── Tarjetas, campos pill y velos inferiores modales ────────────────────── */
.card-blanca { background: var(--carta); border-radius: calc(20 * var(--u)); overflow: hidden; }
.cta-abajo { margin-top: auto; }
.con-fecha { position: relative; display: inline-block; }
.con-fecha.elegir { display: block; margin-top: calc(16 * var(--u)); }
.encima { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }

.pill-campo {
  height: calc(48 * var(--u));
  border-radius: calc(24 * var(--u));
  background: var(--carta);
  padding: 0 calc(18 * var(--u));
  display: flex;
  align-items: center;
  gap: calc(10 * var(--u));
}
.pill-campo label { font-size: calc(15 * var(--u)); color: var(--t2); min-width: calc(68 * var(--u)); }
.pill-campo input,
.pill-campo select { flex: 1; min-width: 0; font-size: calc(15 * var(--u)); color: var(--t1); outline: none; background: transparent; }

.velo {
  position: fixed;
  inset: 0;
  background: rgba(0, 64, 64, .8);
  z-index: 40;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .14s ease .08s, visibility 0s linear .22s;
}
.velo.on {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity .16s ease-out 0s, visibility 0s linear 0s;
}
.hojita {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: var(--ancho-app);
  margin: 0 auto;
  background: #ffffff;
  color: #002020;
  border-radius: calc(28 * var(--u)) calc(28 * var(--u)) 0 0;
  padding: calc(12 * var(--u)) calc(16 * var(--u)) calc(24 * var(--u) + env(safe-area-inset-bottom, 0px));
  max-height: 92dvh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform .16s cubic-bezier(.4, 0, .7, 1);
  will-change: transform;
}
.velo.on .hojita {
  transform: translateY(0);
  transition: transform .22s cubic-bezier(.16, 1, .3, 1);
}
.agarre { width: calc(44 * var(--u)); height: calc(4 * var(--u)); border-radius: 2px; background: #b9bbbd; margin: 0 auto calc(8 * var(--u)); }
.cabh { display: flex; align-items: center; gap: calc(8 * var(--u)); height: calc(52 * var(--u)); margin-bottom: calc(8 * var(--u)); }
.cabh .tit { flex: 1; font-size: calc(18 * var(--u)); text-align: center; color: #002020; }
.cabh .cerrar { width: calc(36 * var(--u)); height: calc(36 * var(--u)); display: grid; place-items: center; color: var(--muted, #5a6e6e); }
.svg-ico.x { width: calc(16 * var(--u)); height: calc(16 * var(--u)); }

/* Overlay genérico de texto largo (06C Panel 4: Condiciones, Acerca de, etc.) */
.texto-doc {
  display: flex;
  flex-direction: column;
  gap: calc(12 * var(--u));
  max-height: 64dvh;
  overflow-y: auto;
  padding: calc(4 * var(--u)) calc(2 * var(--u)) calc(8 * var(--u));
}
.texto-doc p { font-size: calc(14 * var(--u)); line-height: 1.45; color: #002020; }
.texto-doc h4 { font-size: calc(15 * var(--u)); color: #006060; margin-top: calc(4 * var(--u)); }
.texto-doc .texto-link { margin-top: calc(6 * var(--u)); text-decoration: none; }
.priv-en-hoja { font-size: calc(14 * var(--u)); margin-top: calc(6 * var(--u)); }
.priv-en-hoja a { color: #1565c0; text-decoration: underline; }

/* ── Transiciones uniformes ──────────────────────────────────────────────── */
.seg button, .pill-seg button, .tabs button, .nav button, .acc-card, .btn-verde, .btn-suave, .cir-btn {
  transition: background-color .16s ease, color .16s ease, transform .12s ease;
}
.acc-card:active, .btn-verde:active, .btn-suave:active, .cir-btn:active { transform: scale(.98); }
@media (prefers-reduced-motion: reduce) {
  .velo, .hojita, .seg button, .pill-seg button, .tabs button, .nav button, .acc-card, .btn-verde, .btn-suave, .cir-btn {
    transition: none !important;
  }
}
