/* Base común a las tres áreas (votación, inscripción, panel). Mobile-first: los @media agregan para
   pantallas más grandes. Colores, fondos e ícono de puntaje son variables que pisa cada tema
   (wwwroot/temas/<tema>/tema.css). Las URL de los temas van absolutas: un url() relativo dentro
   de una variable se resuelve distinto según el navegador. */

@font-face { font-family: 'Gotham'; src: url('../fonts/Gotham-Light.otf') format('opentype'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'Gotham'; src: url('../fonts/Gotham-Medium.otf') format('opentype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Gotham'; src: url('../fonts/Gotham-Black.otf') format('opentype'); font-weight: 900; font-display: swap; }

:root {
  --color-fondo: #12101a;
  --color-superficie: #1f1b2e;
  --color-superficie-2: #2a2540;
  --color-texto: #f5f3ff;
  --color-texto-suave: #b9b3d1;
  --color-primario: #ff7a1a;
  --color-primario-texto: #1a0f00;
  --color-acento: #8b5cf6;
  --color-ok: #22c55e;
  --color-error: #ef4444;
  --color-borde: rgba(255, 255, 255, 0.12);
  --fondo-pagina: none;
  --fondo-login: none;
  --icono-puntaje: url('/temas/halloween/calabaza.svg');
  --titulo-imagen: none;
  --radio: 14px;
  --sombra: 0 8px 24px rgba(0, 0, 0, 0.35);
  --fuente-titulo: 'Gotham', system-ui, sans-serif;
  --fuente: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

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

/* Una clase con display: flex le gana a [hidden] del navegador: sin esto, "hidden" no oculta. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--fuente);
  font-size: 16px;
  line-height: 1.45;
  color: var(--color-texto);
  background-color: var(--color-fondo);
  background-image: var(--fondo-pagina);
  background-size: cover;
  background-attachment: fixed;
  overflow-x: hidden;
}

img, video { max-width: 100%; display: block; }
a { color: var(--color-primario); }
h1, h2, h3 { font-family: var(--fuente-titulo); font-weight: 900; line-height: 1.15; margin: 0 0 0.5em; }
:focus-visible { outline: 2px solid var(--color-primario); outline-offset: 2px; }

.contenedor { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 16px; }

/* --- Cabecera --------------------------------------------------------------------------- */
.cabecera {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--color-fondo) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-borde);
}
.cabecera-fila {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 16px;
}
.titulo-edicion {
  margin: 0;
  font-size: 1.05rem;
  color: var(--color-primario);
  background: var(--titulo-imagen) left center / contain no-repeat;
}
.cabecera-usuario { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 0.9rem; color: var(--color-texto-suave); }
.cabecera-usuario span { max-width: 38vw; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cabecera-usuario form { margin: 0; }

/* --- Botones y formularios -------------------------------------------------------------- */
.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  color: var(--color-primario-texto);
  background: var(--color-primario);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.2s;
}
.boton:active { transform: scale(0.97); }
.boton:disabled { opacity: 0.5; cursor: not-allowed; }
.boton-secundario { color: var(--color-texto); background: var(--color-superficie-2); }
.boton-peligro { color: #fff; background: var(--color-error); }
.boton-chico { min-height: 44px; padding: 6px 14px; font-size: 0.85rem; }
.boton-bloque { width: 100%; }

.campo { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.campo label { font-weight: 600; font-size: 0.95rem; }
.campo input, .campo select, .campo textarea {
  min-height: 44px;
  padding: 10px 12px;
  font: inherit;
  color: var(--color-texto);
  background: var(--color-superficie-2);
  border: 1px solid var(--color-borde);
  border-radius: 10px;
}

/* El ojo para ver la clave, dentro del campo (a la derecha). */
.campo-clave { position: relative; display: flex; }
.campo-clave input { flex: 1; min-width: 0; padding-right: 52px; }
.ver-clave {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--color-texto-suave);
  background: none;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}
.ver-clave:hover { color: var(--color-texto); }
.ver-clave svg { width: 22px; height: 22px; }

/* --- Avisos ----------------------------------------------------------------------------- */
.aviso { margin: 12px 0; padding: 12px 14px; border-radius: 10px; background: var(--color-superficie-2); border-left: 4px solid var(--color-acento); }
.aviso-error { border-left-color: var(--color-error); }
.aviso-ok { border-left-color: var(--color-ok); }

/* --- Login (las tres áreas) ------------------------------------------------------------- */
.pagina-login {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background-color: var(--color-fondo);
  background-image: var(--fondo-login);
  background-size: cover;
  background-position: center;
}
.tarjeta-login {
  width: 100%;
  max-width: 420px;
  padding: 28px 22px;
  background: color-mix(in srgb, var(--color-superficie) 92%, transparent);
  border: 1px solid var(--color-borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
}
/* DNI / Pasaporte: dos opciones que se ven como un interruptor; el radio real queda oculto pero accesible. */
.selector-documento { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 14px; padding: 4px; border-radius: 999px; background: var(--color-superficie-2); }
.selector-documento label { position: relative; display: block; cursor: pointer; }
.selector-documento input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.selector-documento span { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 999px; font-weight: 700; color: var(--color-texto-suave); }
.selector-documento input:checked + span { color: var(--color-primario-texto); background: var(--color-primario); }
.selector-documento input:focus-visible + span { outline: 2px solid var(--color-primario); outline-offset: 2px; }
.ayuda { font-size: 0.85rem; color: var(--color-texto-suave); }
.tarjeta-login h1 { font-size: 1.5rem; color: var(--color-primario); }
.tarjeta-login p { color: var(--color-texto-suave); }

/* --- Toast ------------------------------------------------------------------------------ */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 100;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 700;
  color: #04130a;
  background: var(--color-ok);
  box-shadow: var(--sombra);
  transform: translateX(-50%);
  animation: toast-entrada 0.25s ease-out;
}
.toast.toast-error { color: #fff; background: var(--color-error); }
@keyframes toast-entrada {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.sin-scroll { overflow: hidden; }
.solo-lectores { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (min-width: 768px) {
  .titulo-edicion { font-size: 1.4rem; }
  .tarjeta-login { padding: 36px 32px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* Edicion:ModoPrueba: que nadie confunda este sitio con el concurso real. */
.franja-prueba { position: sticky; top: 0; z-index: 70; padding: 6px 12px; text-align: center; font-size: 0.85rem; font-weight: 800; letter-spacing: 0.04em; color: #1d0c00; background: repeating-linear-gradient(-45deg, #facc15 0 14px, #fde047 14px 28px); }
