/*
 * Panel de la Pasarela — marca Iván García «Oro».
 * Fuente: «Identidad Visual Ivan Garcia Oro» (negro cálido, crema, oro como acento único).
 * Colores de estado (verde / amarillo / rojo) solo en puntos y textos pequeños, nunca en bloques.
 */

@font-face { font-family: "Clash Display"; src: url("/fuentes/clash-display-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url("/fuentes/satoshi-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url("/fuentes/satoshi-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url("/fuentes/satoshi-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("/fuentes/instrument-serif-latin-400-italic.woff2") format("woff2"); font-style: italic; font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fuentes/jetbrains-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --negro: #090807;
  --superficie: #110F0C;
  --superficie-2: #1A1713;
  --superficie-3: #2A261F;
  --crema: #F7F2E8;
  --secundario: #A9A397;
  --apagado: #7D776C;
  --oro: #F2B92C;
  --ambar: #E9A21A;
  --borde: rgba(255, 236, 200, 0.08);
  --borde-fuerte: rgba(255, 236, 200, 0.16);
  --verde: #7BD49A;
  --amarillo: #F2B92C;
  --rojo: #F2836B;
  --gris: #A9A397;
  --radio: 20px;
  --radio-grande: 28px;
  --titular: "Clash Display", "Satoshi", system-ui, sans-serif;
  --cuerpo: "Satoshi", system-ui, -apple-system, "Segoe UI", sans-serif;
  --datos: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --enfasis: "Instrument Serif", Georgia, serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--negro);
  color: var(--crema);
  font-family: var(--cuerpo);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
}
a { color: var(--crema); text-decoration-color: var(--borde-fuerte); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--oro); }
:focus-visible { outline: 2px solid var(--oro); outline-offset: 2px; border-radius: 6px; }
/* Clash Display tiene el espacio muy estrecho: se abre un poco entre palabras para que no se peguen. */
h1, h2, h3 { font-family: var(--titular); font-weight: 600; letter-spacing: -0.02em; word-spacing: 0.14em; line-height: 1.05; margin: 0; }
h1 { font-size: clamp(28px, 3.4vw, 40px); }
h2 { font-size: 21px; letter-spacing: -0.01em; }
h3 { font-size: 17px; letter-spacing: 0; }
em.oro { font-family: var(--enfasis); font-style: italic; font-weight: 400; color: var(--oro); letter-spacing: -0.01em; font-size: 1.1em; }
p { margin: 0; }
.mono, code { font-family: var(--datos); font-size: 13px; }
.secundario { color: var(--secundario); }
.pequeno { font-size: 13px; }

/* ---------- logotipo ---------- */
.logo { display: inline-flex; align-items: center; gap: 12px; color: var(--crema); text-decoration: none; }
.logo > span:first-child { display: inline-flex; align-items: center; gap: 10px; }
.logo__nombre { word-spacing: 0.1em; }
.logo__punto { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: var(--oro); box-shadow: 0 0 18px 3px rgba(242, 185, 44, 0.5); flex: none; }
.logo__nombre { font-family: var(--titular); font-weight: 600; font-size: 22px; letter-spacing: -0.045em; line-height: 1; }
.logo__apellido { font-family: var(--enfasis); font-style: italic; font-weight: 400; font-size: 1.14em; letter-spacing: -0.02em; }
.logo__producto { font-family: var(--datos); font-size: 11px; color: var(--secundario); text-transform: uppercase; letter-spacing: 0.08em; }

/* ---------- estructura del panel ---------- */
.marco { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.lateral {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 28px;
  padding: 28px 18px; border-right: 1px solid var(--borde); background: var(--negro);
}
.lateral .logo { padding: 0 10px; flex-direction: column; align-items: flex-start; gap: 8px; }
.lateral .logo > span:first-child { display: inline-flex; align-items: center; gap: 10px; }
.menu { display: flex; flex-direction: column; gap: 2px; }
.menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px; color: var(--secundario); text-decoration: none; font-weight: 500;
}
.menu a:hover { background: var(--superficie); color: var(--crema); }
.menu a[aria-current="page"] { background: var(--superficie-2); color: var(--crema); }
.menu a[aria-current="page"]::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--oro); box-shadow: 0 0 10px 2px rgba(242, 185, 44, 0.45); }
.lateral__pie { margin-top: auto; padding: 14px 12px 0; border-top: 1px solid var(--borde); display: flex; flex-direction: column; gap: 10px; }
.lateral__pie form { margin: 0; }
.principal { padding: 40px clamp(20px, 4vw, 56px) 80px; max-width: 1180px; width: 100%; }
.cabecera { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 28px; }
.cabecera__texto { display: flex; flex-direction: column; gap: 8px; }
.migas { font-family: var(--datos); font-size: 12px; color: var(--secundario); }
.migas a { color: var(--secundario); }

/* ---------- bloques ---------- */
.tarjeta { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); padding: 24px; }
.tarjeta + .tarjeta, .tarjeta + .rejilla, .rejilla + .tarjeta, .rejilla + .rejilla { margin-top: 20px; }
.tarjeta__cabecera { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.rejilla { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.rejilla--2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.cifra { display: flex; flex-direction: column; gap: 6px; }
.cifra__numero { font-family: var(--titular); font-size: 40px; letter-spacing: -0.04em; line-height: 1; }
.cifra__texto { color: var(--secundario); font-size: 13px; }
.pila { display: flex; flex-direction: column; gap: 14px; }
.fila { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.separado { justify-content: space-between; }
.datos { display: grid; grid-template-columns: max-content 1fr; gap: 10px 24px; margin: 0; }
.datos dt { color: var(--secundario); font-size: 13px; }
.datos dd { margin: 0; overflow-wrap: anywhere; }
.vacio { padding: 28px; text-align: center; color: var(--secundario); border: 1px dashed var(--borde-fuerte); border-radius: var(--radio); }

/* ---------- tablas ---------- */
.tabla-envoltorio { overflow-x: auto; margin: 0 -8px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 500; color: var(--secundario); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; padding: 10px 8px; border-bottom: 1px solid var(--borde); white-space: nowrap; }
td { padding: 14px 8px; border-bottom: 1px solid var(--borde); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255, 236, 200, 0.02); }

/* ---------- estados ---------- */
.estado { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 10px; border-radius: 999px; background: var(--superficie-2); font-size: 13px; font-weight: 500; white-space: nowrap; }
.estado::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gris); flex: none; }
.estado--verde::before { background: var(--verde); box-shadow: 0 0 8px 1px rgba(123, 212, 154, 0.45); }
.estado--amarillo::before { background: var(--amarillo); box-shadow: 0 0 8px 1px rgba(242, 185, 44, 0.45); }
.estado--rojo::before { background: var(--rojo); box-shadow: 0 0 8px 1px rgba(242, 131, 107, 0.45); }
.pildora { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--superficie-2); font-size: 12px; font-family: var(--datos); color: var(--secundario); }
.pildora--oro::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--oro); box-shadow: 0 0 10px 2px rgba(242, 185, 44, 0.5); }

/* ---------- mensajes ---------- */
.mensaje { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-radius: 16px; border: 1px solid var(--borde-fuerte); background: var(--superficie); margin-bottom: 20px; }
.mensaje::before { content: ""; width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; flex: none; background: var(--verde); }
.mensaje--error { border-color: rgba(242, 131, 107, 0.4); }
.mensaje--error::before { background: var(--rojo); }
.secreto-una-vez {
  position: relative; overflow: hidden;
  border: 1px solid rgba(242, 185, 44, 0.45); border-radius: var(--radio); background: var(--superficie); padding: 24px;
}
.secreto-una-vez::after { content: ""; position: absolute; width: 260px; height: 260px; right: -120px; top: -140px; border-radius: 50%; background: var(--ambar); filter: blur(90px); opacity: 0.25; pointer-events: none; }
.secreto-una-vez > * { position: relative; }
.copiable { display: flex; gap: 10px; align-items: stretch; margin-top: 14px; flex-wrap: wrap; }
.copiable input { flex: 1 1 320px; font-family: var(--datos); font-size: 14px; }

/* ---------- formularios ---------- */
form { margin: 0; }
.formulario { display: flex; flex-direction: column; gap: 18px; max-width: 640px; }
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo label { font-weight: 500; }
.campo .ayuda { color: var(--secundario); font-size: 13px; }
.campos-2 { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
input, select, textarea {
  width: 100%; min-height: 46px; padding: 11px 14px;
  background: var(--negro); color: var(--crema);
  border: 1px solid var(--borde-fuerte); border-radius: 14px;
  font: inherit;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--oro); box-shadow: 0 0 0 3px rgba(242, 185, 44, 0.18); }
input::placeholder, textarea::placeholder { color: var(--apagado); }
input[readonly] { background: var(--superficie-2); }
input[type="checkbox"], input[type="radio"] { width: 18px; min-height: 0; height: 18px; padding: 0; margin: 0 8px 0 0; accent-color: var(--oro); vertical-align: middle; flex: none; }
.casilla { display: flex; align-items: center; gap: 0; font-weight: 400; }
.codigo-2fa { font-family: var(--datos); font-size: 24px; letter-spacing: 0.3em; text-align: center; max-width: 240px; }

/* ---------- botones ---------- */
.boton {
  min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 0 22px; border-radius: 999px; border: 1px solid var(--borde-fuerte);
  background: transparent; color: var(--crema); font: inherit; font-weight: 700; font-size: 15px;
  text-decoration: none; cursor: pointer; transition: border-color .2s ease, background .2s ease, gap .3s ease; white-space: nowrap;
}
.boton:hover { border-color: rgba(242, 185, 44, 0.6); }
.boton--oro { background: var(--oro); color: var(--negro); border-color: var(--oro); }
.boton--oro:hover { background: #f5c650; gap: 14px; }
.boton--peligro { color: var(--rojo); border-color: rgba(242, 131, 107, 0.45); }
.boton--peligro:hover { border-color: var(--rojo); }
.boton--pequeno { min-height: 36px; padding: 0 16px; font-size: 14px; }
.boton--texto { border: 0; padding: 0; min-height: 0; color: var(--secundario); font-weight: 500; }
.boton--texto:hover { color: var(--crema); }

details.accion { border: 1px solid var(--borde); border-radius: 16px; padding: 0; }
details.accion > summary { cursor: pointer; padding: 14px 18px; font-weight: 700; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
details.accion > summary::-webkit-details-marker { display: none; }
details.accion > summary::after { content: "+"; font-family: var(--datos); color: var(--secundario); }
details.accion[open] > summary::after { content: "−"; }
details.accion > div { padding: 0 18px 18px; }

/* ---------- barras de límite ---------- */
.barra { height: 8px; border-radius: 999px; background: var(--superficie-3); overflow: hidden; }
.barra > span { display: block; height: 100%; border-radius: 999px; background: var(--verde); }
.barra--medio > span { background: var(--amarillo); }
.barra--alto > span { background: var(--rojo); }

/* ---------- páginas públicas (entrar, invitación, alta) ---------- */
.publico { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 16px; position: relative; overflow: hidden; }
.publico::before { content: ""; position: absolute; width: 640px; height: 640px; left: 50%; top: -420px; transform: translateX(-50%); border-radius: 50%; background: var(--ambar); filter: blur(160px); opacity: 0.16; pointer-events: none; }
.publico__caja { position: relative; width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 28px; }
.publico__caja--ancha { max-width: 620px; }
.publico .tarjeta { border-radius: var(--radio-grande); padding: clamp(24px, 4vw, 36px); }
.lista-codigos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 16px; padding: 18px; border-radius: 16px; background: var(--negro); border: 1px solid var(--borde); font-family: var(--datos); font-size: 16px; list-style: none; margin: 0; }
.pasos { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.pasos li::marker { color: var(--oro); font-family: var(--datos); }

/* ---------- móvil ---------- */
.menu-movil { display: none; }
@media (max-width: 900px) {
  .marco { grid-template-columns: 1fr; }
  .lateral { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 16px; gap: 12px; border-right: 0; border-bottom: 1px solid var(--borde); }
  .lateral .logo { flex-direction: row; align-items: center; }
  .menu { flex-direction: row; overflow-x: auto; width: 100%; order: 3; gap: 4px; padding-bottom: 4px; }
  .menu a { white-space: nowrap; padding: 8px 12px; }
  .lateral__pie { margin: 0 0 0 auto; padding: 0; border: 0; flex-direction: row; align-items: center; }
  .lateral__pie .secundario { display: none; }
  .principal { padding: 24px 16px 64px; }
  .datos { grid-template-columns: 1fr; gap: 2px; }
  .datos dd { margin-bottom: 10px; }
  .tarjeta { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.logo-enlace { text-decoration: none; }
.arriba-8 { margin-top: 8px; }
.arriba-20 { margin-top: 20px; }

/* Anchos de las barras en pasos de 5 % (sin estilos en línea, por la política de seguridad). */
.ancho-0 { width: 0%; }
.ancho-5 { width: 5%; }
.ancho-10 { width: 10%; }
.ancho-15 { width: 15%; }
.ancho-20 { width: 20%; }
.ancho-25 { width: 25%; }
.ancho-30 { width: 30%; }
.ancho-35 { width: 35%; }
.ancho-40 { width: 40%; }
.ancho-45 { width: 45%; }
.ancho-50 { width: 50%; }
.ancho-55 { width: 55%; }
.ancho-60 { width: 60%; }
.ancho-65 { width: 65%; }
.ancho-70 { width: 70%; }
.ancho-75 { width: 75%; }
.ancho-80 { width: 80%; }
.ancho-85 { width: 85%; }
.ancho-90 { width: 90%; }
.ancho-95 { width: 95%; }
.ancho-100 { width: 100%; }
.buscador { flex: 1 1 260px; width: auto; }
.fila > form { display: inline; }
.rejilla > .tarjeta, .rejilla > section { margin-top: 0 !important; }
td.mono { white-space: nowrap; }
.rejilla--4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.pila > .estado, .pila > a.estado { align-self: flex-start; white-space: normal; }
td { vertical-align: middle; }
/* La línea del menú lateral llega hasta abajo aunque la página sea larga. */
@media (min-width: 901px) {
  .marco { background: linear-gradient(var(--borde), var(--borde)) 247px 0 / 1px 100% no-repeat; }
  .lateral { border-right: 0; }
}
.principal .formulario > .boton { align-self: flex-start; }
/* Móvil: nada puede ensanchar la página. */
.marco > *, .lateral > *, .rejilla > * { min-width: 0; }
.rejilla { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.rejilla--2 { grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); }
.rejilla--4 { grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); }
.copiable input { min-width: 0; flex-basis: 220px; }
.rejilla--4 { grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); }
.menu { scrollbar-width: none; }
.menu::-webkit-scrollbar { display: none; }
.sin-corte { white-space: nowrap; }
/* Alta del segundo factor: código QR y clave escrita en letra de datos (la O y el 0 no se confunden). */
.qr-2fa { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
.qr-2fa__codigo { flex: none; padding: 10px; border-radius: 16px; background: #ffffff; line-height: 0; }
.qr-2fa__codigo svg { display: block; width: 200px; height: 200px; }
.qr-2fa .pasos { flex: 1 1 220px; }
.clave-2fa { font-family: var(--datos); font-size: 15px; letter-spacing: 0.04em; }
