/* auth-shell.css — shell público de acceso (Bienvenid@, Registro, PIN,
 * "Revisa tu correo") y la tarjeta que lo contiene.
 *
 * Se carga SIEMPRE, junto a base/shells/player: no depende del torneo ni de
 * haber pasado por la landing. Antes vivía dentro de landing-futbol.css, que
 * sólo se inyecta en las pantallas de marketing — por eso entrar por una ruta
 * directa de quiniela renderizaba estas pantallas sin estilo, distintas al
 * mismo registro hecho desde la landing.
 *
 * El marketing de la landing sigue en landing-futbol.css y sigue siendo
 * perezoso: son ~48 KB que la mayoría de las sesiones nunca necesita.
 */



/* 100dvh y no 100vh: en móvil 100vh cuenta la barra del navegador como si no
   existiera, así que centrar dentro de esa altura dejaba el "Bienvenid@"
   empujado hacia abajo, fuera de lo que se ve al abrir. */
#screen-access,
#screen-login,
#screen-pin-setup {
  max-width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding: 24px 0;
  background:
    linear-gradient(rgba(5, 20, 12, 0.9), rgba(5, 20, 12, 0.94)),
    repeating-linear-gradient(0deg, transparent 0 64px, rgba(112, 196, 128, 0.10) 64px 66px),
    linear-gradient(115deg, #06170d, #102c1b 52%, #071a10);
}

.landing-topbar,
.landing-footer,
.landing-hero,
.landing-proof,
.landing-admin-control,
.landing-story,
.landing-action-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.landing-subtitle {
  margin: 0;
  max-width: 500px;
  color: rgba(240,240,240,0.74);
  font-size: 1.02rem;
  line-height: 1.65;
  white-space: pre-line;
}

.login-email-highlight {
  font-size: 1.25em;
  font-weight: 800;
  color: var(--text);
  overflow-wrap: anywhere;
}

.landing-action-shell {
  padding: var(--landing-section-pad) 0;
}

.login-card--public {
  min-height: auto;
  max-width: 460px;
  margin: 0 auto;
  padding: 36px 24px 44px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(14,19,14,0.92), rgba(10,14,10,0.96));
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 28px 70px rgba(0,0,0,0.28);
}

/* Un solo sistema de acceso: cancha discreta y tarjeta amplia, sobria y
 * verde. Conserva la presencia vertical del selector y el interior limpio de
 * los pasos de correo, registro y PIN. */
#screen-access .login-card--public,
#screen-login .login-card--public,
#screen-pin-setup .login-card--public {
  width: min(540px, calc(100vw - 32px));
  min-height: 0;
  padding: clamp(38px, 6vw, 64px) clamp(28px, 5vw, 58px);
  border-radius: 20px;
  background: rgba(21, 43, 30, 0.95);
  border-color: rgba(198, 232, 207, 0.14);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.36);
}

#screen-access .login-logo-emoji,
#screen-login .login-logo-emoji,
#screen-pin-setup .login-logo-emoji {
  display: grid;
  place-items: center;
  width: auto;
  height: auto;
  margin: 0 0 10px;
  font-size: clamp(4.4rem, 10vw, 6rem);
  line-height: 1;
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.26));
}

#screen-access .landing-header::after,
#screen-login .landing-header::after,
#screen-pin-setup .landing-header::after {
  display: none;
}

#screen-access .landing-input,
#screen-login .landing-input,
#screen-pin-setup .landing-input {
  min-height: 64px;
  border-radius: 14px;
  background: rgba(6, 19, 11, 0.74);
  border-color: rgba(220, 241, 224, 0.19);
  text-align: center;
  font-size: 1.05rem;
}

#screen-access .landing-input:focus,
#screen-login .landing-input:focus,
#screen-pin-setup .landing-input:focus {
  border-color: rgba(238, 190, 75, 0.92);
  box-shadow: 0 0 0 3px rgba(238, 190, 75, 0.16);
}

#screen-access .login-name-btn,
#screen-login .login-name-btn,
#screen-pin-setup .login-name-btn {
  min-height: 64px;
  border-radius: 14px;
  background: #e9ba45;
  color: #161407;
  box-shadow: none;
}

#screen-access .landing-entry-card {
  border-radius: 14px;
  background: rgba(6, 19, 11, 0.64);
  box-shadow: none;
}

#screen-access .landing-entry-card--directivo {
  border-color: rgba(113, 163, 222, 0.36);
  background: rgba(10, 31, 51, 0.7);
}

#screen-access .landing-entry-card--jugador {
  border-color: rgba(233, 186, 69, 0.5);
  background: rgba(52, 42, 12, 0.7);
}

@media (max-width: 560px) {
  /* En celular la tarjeta arranca arriba en vez de centrarse: centrada, el
     título quedaba a media pantalla y había que hacer scroll para leerlo. */
  #screen-access,
  #screen-login,
  #screen-pin-setup {
    align-items: flex-start;
    padding: 12px 0 24px;
  }
  #screen-access .login-card--public,
  #screen-login .login-card--public,
  #screen-pin-setup .login-card--public { padding: 28px 22px 32px; }
  #screen-access .login-logo-emoji,
  #screen-login .login-logo-emoji,
  #screen-pin-setup .login-logo-emoji { font-size: clamp(3.4rem, 15vw, 4.4rem); }
}

#screen-access[data-access-mode="create"] .login-card--public {
  background: linear-gradient(180deg, rgba(13, 22, 41, 0.96), rgba(8, 14, 28, 0.98));
  border-color: rgba(96, 165, 250, 0.3);
  box-shadow:
    inset 0 0 0 1px rgba(96, 165, 250, 0.08),
    0 28px 70px rgba(0,0,0,0.28);
}

#screen-access[data-access-mode="create"] .landing-header::after {
  background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.42), transparent);
}

#screen-access[data-access-mode="create"] .landing-kicker {
  border-color: rgba(96, 165, 250, 0.32);
  background: rgba(96, 165, 250, 0.1);
  color: #bfdbfe;
}

#screen-access[data-access-mode="create"] .landing-input {
  background: rgba(15, 23, 42, 0.54);
  border-color: rgba(59, 130, 246, 0.28);
}

#screen-access[data-access-mode="create"] .landing-input:focus {
  border-color: rgba(96, 165, 250, 0.92);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}

#screen-access[data-access-mode="create"] .login-name-btn {
  background: linear-gradient(180deg, #22c55e, #16a34a);
  color: #06110b;
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.28), 0 4px 12px rgba(0,0,0,0.4);
}

#screen-access[data-access-mode="create"] .landing-copy-btn {
  border-color: rgba(59, 130, 246, 0.3);
  background: rgba(15, 23, 42, 0.48);
}

#screen-access[data-access-mode="create"] .landing-copy-btn:hover {
  border-color: rgba(96, 165, 250, 0.68);
}

#screen-access[data-access-mode="create"] .landing-admin-note {
  color: rgba(191, 219, 254, 0.84);
}

#screen-access.is-create-compact #access-tournament-status,
#screen-access.is-create-compact #access-tournament-subtitle {
  display: none;
}

#screen-access[data-access-mode="create"] .landing-code-display {
  color: #93c5fd;
  text-shadow: 0 0 24px rgba(96, 165, 250, 0.35);
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(96, 165, 250, 0.34);
}

.landing-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 22px;
  position: relative;
}

.landing-header::after {
  content: '';
  width: min(260px, 72%);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245,197,24,0.34), transparent);
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
}

.landing-action-title {
  color: #fff;
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.landing-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 320px;
}

.landing-back-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0;
  text-align: left;
  width: fit-content;
}

.landing-back-btn:hover { color: var(--text); }

.landing-back-btn--center {
  margin: 6px auto 0;
  text-align: center;
}

.landing-options-back {
  display: block;
  margin-top: 18px;
  text-decoration: none;
}

.landing-input {
  width: 100%;
  background: rgba(17, 24, 17, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 1rem;
  padding: 12px 14px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.landing-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245,197,24,0.15);
}

.landing-admin-note {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 0 0 4px;
  text-align: left;
  white-space: pre-line;
}

.landing-admin-note strong { color: var(--text); }

#screen-access .landing-action-shell,
#screen-login .landing-action-shell,
#screen-pin-setup .landing-action-shell {
  width: min(440px, calc(100% - 32px));
  padding: 0;
}

#screen-access .landing-header,
#screen-login .landing-header,
#screen-pin-setup .landing-header {
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 18px;
}@media (max-width: 767px) {

  .landing-topbar,
  .landing-footer,
  .landing-hero,
  .landing-proof,
  .landing-admin-control,
  .landing-story,
  .landing-action-shell {
    width: min(100%, calc(100% - 28px));
  }

  .landing-title,
  .landing-section-title,
  .landing-subtitle {
    max-width: none;
  }
}


.landing-action-shell {
  padding-top: 12px;
}

/* ── PIN input ───────────────────────────────────────────────────────────────── */
.pin-input-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 8px 0 14px;
}

.pin-digit {
  width: 56px;
  height: 64px;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text, #fff);
  font-size: 1.8rem;
  font-weight: 700;
  text-align: center;
  /* Con el caret oculto no había señal de en qué caja estás parado al hacer
     clic: la caja se veía idéntica antes y después de enfocarla. */
  caret-color: var(--gold, #f5c518);
  outline: none;
  -moz-appearance: textfield;
  /* Enmascarar el dígito mientras se escribe (sin perder teclado numérico) */
  -webkit-text-security: disc;
  text-security: disc;
  transition: border-color 0.15s;
}
.pin-digit::-webkit-outer-spin-button,
.pin-digit::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pin-digit:focus {
  border-color: var(--gold, #f5c518);
  background: rgba(245, 197, 24, 0.08);
}
.pin-digit--filled {
  border-color: rgba(255, 255, 255, 0.35);
}

/* ── Código de acceso (OTP) ──────────────────────────────────────────────────
   Seis cajas, no cuatro, y con dos diferencias deliberadas frente al PIN:

   1. Sin enmascarar. El PIN es un secreto que se reutiliza y se teclea de
      memoria; el código es de un solo uso, dura 10 minutos y la persona lo
      está copiando desde su correo. Taparlo no protege nada y sí impide
      revisar lo que escribió — que es justo lo que uno quiere hacer al
      transcribir seis dígitos.
   2. Más angostas. 6 × 56px + gaps se pasa de 375px y desbordaba en móvil. */
.pin-input-row--code {
  gap: 8px;
}
.pin-input-row--code .pin-digit {
  width: 44px;
  height: 56px;
  font-size: 1.5rem;
  -webkit-text-security: none;
  text-security: none;
}
@media (max-width: 360px) {
  .pin-input-row--code { gap: 6px; }
  .pin-input-row--code .pin-digit { width: 38px; height: 50px; font-size: 1.3rem; }
}

/* Era 0.82rem sin fondo: el error de PIN pasaba desapercibido justo cuando la
   persona necesita entender que se equivocó. */
.pin-error {
  color: #fecaca;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  margin: 12px 0 0;
  padding: 10px 14px;
  border: 1px solid rgba(248, 113, 113, 0.5);
  border-radius: 12px;
  background: rgba(127, 29, 29, 0.32);
}

body[data-screen="landing"] .landing-topbar,
body[data-screen="landing"] .landing-footer,
body[data-screen="landing"] .landing-hero,
body[data-screen="landing"] .landing-proof,
body[data-screen="landing"] .landing-admin-control,
body[data-screen="landing"] .landing-story,
body[data-screen="landing"] .landing-action-shell {
  width: min(1180px, calc(100% - 48px));
}

body[data-screen="landing"] .landing-subtitle {
  max-width: 560px;
  color: rgba(242, 241, 233, 0.66);
  font-size: 1.02rem;
}@media (max-width: 767px) {

  body[data-screen="landing"] .landing-topbar,
  body[data-screen="landing"] .landing-footer,
  body[data-screen="landing"] .landing-hero,
  body[data-screen="landing"] .landing-proof,
  body[data-screen="landing"] .landing-admin-control,
  body[data-screen="landing"] .landing-story,
  body[data-screen="landing"] .landing-action-shell {
    width: min(100%, calc(100% - 28px));
  }
}
