/* Pantallas de acceso de NEXIA. Tema oscuro de la web de NEXIA; sin JavaScript ni recursos externos.
   Colores y fuentes tomados de /home/emilio/nexia-web/nexia/ (ver ofl.txt para las fuentes). */

@font-face { font-family: "Sora"; font-style: normal; font-weight: 100 800; font-display: swap; src: url(/estaticos/sora-latin-wght.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url(/estaticos/ibm-plex-sans-latin-400.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url(/estaticos/ibm-plex-sans-latin-500.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url(/estaticos/ibm-plex-sans-latin-600.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url(/estaticos/ibm-plex-mono-latin-500.woff2) format("woff2"); }

:root {
  color-scheme: dark;
  --nexia: #071a33;
  --deep: #051428;
  --navy-2: #0a2040;
  --card: #0e2748;
  --gold: #f2c94c;
  --coral: #e7876b;
  --success: #3fb8a8;
  --mist: #aeb9c8;
  --mist-light: #c9d2de;
  --white: #fff;
  --linea: rgb(255 255 255 / .12);
  --linea-fuerte: rgb(255 255 255 / .28);
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --display: "Sora", system-ui, sans-serif;
  --cuerpo: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

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

html { background: var(--deep); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.5rem 1rem;
  font-family: var(--cuerpo);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--mist-light);
  background:
    radial-gradient(60rem 36rem at 50% -8rem, rgb(14 39 72 / .9), transparent 70%),
    linear-gradient(180deg, var(--nexia), var(--deep));
  background-color: var(--deep);
  caret-color: var(--gold);
  -webkit-font-smoothing: antialiased;
  scrollbar-color: var(--linea-fuerte) var(--deep);
}

::selection { background: var(--gold); color: var(--nexia); }

.tarjeta {
  width: 100%;
  max-width: 26rem;
  padding: 2rem 1.5rem 1.75rem;
  background: var(--card);
  border: 1px solid var(--linea);
  border-radius: 1rem;
  box-shadow: 0 1px 0 rgb(255 255 255 / .05) inset, 0 24px 48px -16px rgb(0 0 0 / .55);
  animation: entrada 320ms var(--ease-out);
}

@keyframes entrada {
  from { opacity: 0; transform: translateY(8px); }
}

.logo { display: block; width: 8rem; max-width: 100%; height: auto; margin: 0 0 1.75rem; }

h1 {
  margin: 0 0 .5rem;
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.02em;
  color: var(--white);
  text-wrap: balance;
}

p { margin: 0 0 1rem; max-width: 65ch; text-wrap: pretty; }

form { margin: 1.25rem 0 0; }

label {
  display: block;
  margin: 1.1rem 0 .4rem;
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: .005em;
  color: var(--white);
}
form > label:first-of-type { margin-top: 0; }

input[type="text"], input[type="email"], input[type="password"] {
  display: block;
  width: 100%;
  min-height: 2.9rem;
  margin: 0;
  padding: .65rem .85rem;
  font: inherit;
  font-size: 1rem; /* 16 px: evita el zoom automático en iOS */
  color: var(--white);
  background: var(--navy-2);
  border: 1px solid var(--linea-fuerte);
  border-radius: .625rem;
  transition: border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}

input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-color: var(--gold);
}

input:-webkit-autofill {
  -webkit-text-fill-color: var(--white);
  caret-color: var(--gold);
  box-shadow: 0 0 0 100px var(--navy-2) inset;
}

/* Código de verificación: dato de 6 dígitos, en mono y centrado */
input[autocomplete="one-time-code"] {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 1.5rem;
  letter-spacing: .32em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

button, .boton {
  display: block;
  width: 100%;
  min-height: 2.9rem;
  margin: 1.5rem 0 0;
  padding: .7rem 1rem;
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  color: var(--nexia);
  background: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 999px;
  transition: transform 140ms var(--ease-out), background-color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}

button:active, .boton:active { transform: scale(.97); }

button:focus-visible, .boton:focus-visible, a:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 3px;
}

a { color: var(--gold); text-underline-offset: .2em; text-decoration-thickness: 1px; transition: color 160ms var(--ease-out); }
a:active { color: var(--white); }

@media (hover: hover) and (pointer: fine) {
  button:hover { background: #f7d874; border-color: #f7d874; }
  a:hover { color: var(--white); }
  .boton:hover { background: #f7d874; border-color: #f7d874; color: var(--nexia); }
}

/* Mensajes: el color va acompañado del borde y del texto, no solo del tono */
.mensaje {
  margin: 1rem 0 0;
  padding: .7rem .85rem;
  font-size: .9375rem;
  color: var(--white);
  background: rgb(231 135 107 / .12);
  border: 1px solid var(--coral);
  border-radius: .625rem;
}
.mensaje-aviso { background: rgb(242 201 76 / .1); border-color: var(--gold); }
.mensaje-exito { background: rgb(63 184 168 / .12); border-color: var(--success); }

/* Elegir empresa */
.empresas { list-style: none; margin: 1.25rem 0 0; padding: 0; }
.empresas:empty { display: none; }
.empresas li { margin: .6rem 0 0; }
.empresas .boton {
  margin: 0;
  text-align: left;
  font-family: var(--display);
  letter-spacing: -.01em;
  overflow-wrap: anywhere;
  color: var(--white);
  background: var(--navy-2);
  border-color: var(--linea-fuerte);
  border-radius: .75rem;
}
@media (hover: hover) and (pointer: fine) {
  .empresas .boton:hover { background: var(--nexia); border-color: var(--gold); color: var(--white); }
}

/* Alta del segundo factor: pasos numerados, QR y clave */
.pasos { list-style: none; counter-reset: paso; margin: 1.25rem 0 0; padding: 0; }
.pasos > li { counter-increment: paso; position: relative; margin: 0 0 1.5rem; padding-left: 2.25rem; }
.pasos > li::before {
  content: counter(paso);
  position: absolute; left: 0; top: .05rem;
  width: 1.65rem; height: 1.65rem;
  display: grid; place-items: center;
  font-family: var(--display); font-size: .875rem; font-weight: 600;
  color: var(--nexia); background: var(--gold); border-radius: 50%;
}
.pasos .paso { margin: 0 0 .75rem; color: var(--white); }
.pasos label { margin: 0; font-size: 1rem; font-weight: 400; letter-spacing: 0; }
.pasos form { margin: 0; }
/* QR: siempre negro sobre blanco y sin filtros, para que lo lea la cámara */
.qr {
  display: block;
  width: min(100%, 15rem);
  aspect-ratio: 1;
  height: auto;
  /* Centrado en la tarjeta: el paso lleva una sangría de 2.25rem a la izquierda (por el número); se centra en el paso y se desplaza media sangría */
  margin: 0 auto 1rem;
  position: relative; left: -1.125rem;
  padding: .5rem;
  background: #fff;
  border-radius: .5rem;
}
.clave-etiqueta { margin: 0 0 .35rem; font-size: .875rem; color: var(--mist-light); }
.clave-caja { margin: 0 0 .5rem; padding: .6rem .75rem; background: var(--navy-2); border: 1px solid var(--linea-fuerte); border-radius: .625rem; }
.clave { font-family: var(--mono); font-weight: 500; font-size: 1rem; letter-spacing: .06em; line-height: 1.6; color: var(--white); overflow-wrap: anywhere; -webkit-user-select: all; user-select: all; }
.datos { margin: 0; font-size: .875rem; color: var(--mist-light); }

/* Enlaces de salida: separados del contenido principal */
.salida { margin: 1.5rem 0 0; font-size: .9375rem; }
.salida a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; padding: 0 .5rem; margin-left: -.5rem; }

/* Campo de usuario para los gestores de contraseñas (la contraseña nueva se guarda con su cuenta): fuera de la vista, sin display:none */
/* Mayor especificidad que input[type="text"] (que fija width:100% y min-height): si no, el campo ocupa todo el ancho y desborda */
input[type="text"].solo-gestor { position: absolute; top: 0; left: 0; width: 1px; min-width: 0; max-width: 1px; height: 1px; min-height: 0; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; opacity: 0; pointer-events: none; }
.tarjeta > p:last-child { margin-bottom: 0; }

@media (min-width: 30rem) {
  body { padding: 3rem 1.5rem; }
  .tarjeta { padding: 2.5rem 2.25rem 2.25rem; }
  .logo { width: 9rem; }
  h1 { font-size: 1.625rem; }
}

@media (prefers-reduced-motion: reduce) {
  .tarjeta { animation: none; }
  button, .boton, a, input { transition: none; }
  button:active, .boton:active { transform: none; }
}

@media (forced-colors: active) {
  .tarjeta, .mensaje, input, button, .boton { border: 1px solid CanvasText; }
  button, .boton { background: ButtonFace; color: ButtonText; }
}
