/* =====================================================================
   BASE · colores, tipografía y estructura de pantallas
   Los colores de marca son los de las balotas: B azul, I rojo,
   N gris, G verde, O amarillo.
   ===================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,800&family=Figtree:wght@400;500;600;700&display=swap");

:root {
  --bola-b: #1d5fd1;
  --bola-i: #d93a3a;
  --bola-n: #7c8699;
  --bola-g: #1c9a5b;
  --bola-o: #f0b429;

  --noche: #13233f;
  --noche-2: #1f3560;
  --papel: #f2f4f8;
  --superficie: #ffffff;
  --tinta: #18202e;
  --tinta-suave: #5b6578;
  --linea: #d9dee7;

  --primario: var(--bola-b);
  --peligro: var(--bola-i);
  --exito: var(--bola-g);
  --alerta: var(--bola-o);

  --fuente-titulo: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --fuente-texto: "Figtree", "Segoe UI", system-ui, sans-serif;

  --radio-s: 6px;
  --radio-m: 10px;
  --radio-l: 16px;
  --sombra: 0 1px 2px rgba(19, 35, 63, 0.08), 0 6px 18px rgba(19, 35, 63, 0.07);
}

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

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

body {
  margin: 0;
  font-family: var(--fuente-texto);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--tinta);
  background: var(--papel);
  font-variant-numeric: tabular-nums;
}

h1, h2, h3 {
  font-family: var(--fuente-titulo);
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem); font-weight: 800; }
h2 { font-size: 1.3rem; font-weight: 800; }
h3 { font-size: 1.05rem; font-weight: 600; }

p { margin: 0 0 1em; }
a { color: var(--primario); }
img { max-width: 100%; }

:focus-visible {
  outline: 3px solid var(--bola-o);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

.oculto-visual {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

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

/* Páginas privadas: nada se ve hasta confirmar la sesión */
body[data-protegida]:not(.lista) > * { visibility: hidden; }


/* ---------------------------------------------------------------------
   LOGIN
   --------------------------------------------------------------------- */
.login {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(circle at 15% 0%, var(--noche-2), transparent 60%),
    var(--noche);
}
.login__caja { width: 100%; max-width: 380px; }
.login__marca { display: flex; justify-content: center; margin-bottom: 2rem; }
.login__panel {
  background: var(--superficie);
  border-radius: var(--radio-l);
  padding: 1.75rem 1.5rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.login__titulo { margin-bottom: 0.25rem; }
.login__texto { color: var(--tinta-suave); margin-bottom: 1.25rem; }
.login__pie { color: #aab4c8; text-align: center; font-size: 0.88rem; margin-top: 1.25rem; }


/* ---------------------------------------------------------------------
   APP ADMIN · menú lateral + contenido
   --------------------------------------------------------------------- */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.menu {
  background: var(--noche);
  color: #dfe5f0;
  padding: 1.25rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.menu__marca { padding: 0 0.5rem; text-decoration: none; }
.menu__marca .marca { font-size: 0.78rem; }
.menu__lista {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.menu__enlace {
  display: block;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radio-s);
  color: inherit;
  text-decoration: none;
  font-weight: 500;
}
.menu__enlace:hover { background: var(--noche-2); }
.menu__enlace[aria-current="page"] {
  background: var(--superficie);
  color: var(--noche);
  font-weight: 700;
}
.menu__usuario {
  margin-top: auto;
  padding: 1rem 0.75rem 0;
  border-top: 1px solid var(--noche-2);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.9rem;
}
.menu__usuario span { color: #9fabc2; }
.menu__usuario .boton { margin-top: 0.5rem; }
.menu .menu__alternar { display: none; }

.contenido {
  padding: 2rem clamp(1rem, 3vw, 2.5rem);
  width: 100%;
  max-width: 1200px;
}

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .menu {
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 0.75rem 1rem;
    gap: 0.75rem;
    z-index: 20;
  }
  .menu .menu__alternar { display: inline-flex; margin-left: auto; }
  .menu__lista, .menu__usuario { display: none; width: 100%; }
  .menu.abierto .menu__lista, .menu.abierto .menu__usuario { display: flex; }
}


/* ---------------------------------------------------------------------
   APP VENDEDOR · pensada para celular
   --------------------------------------------------------------------- */
.app-vendedor {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}

.barra-vendedor {
  background: var(--noche);
  color: #fff;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 20;
}
.barra-vendedor .marca { font-size: 0.68rem; }

.contenido-vendedor {
  padding: 1.25rem 1rem;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
}

.nav-inferior {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--superficie);
  border-top: 1px solid var(--linea);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 20;
}
.nav-inferior a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0.55rem 0.25rem;
  color: var(--tinta-suave);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
}
.nav-inferior svg { width: 24px; height: 24px; }
.nav-inferior a[aria-current="page"] { color: var(--primario); }


/* ---------------------------------------------------------------------
   LOGO BINGOMANIA · tipografía Bungee (licencia libre OFL, en /fuentes)
   --------------------------------------------------------------------- */
@font-face {
  font-family: "Bungee";
  src: url("../fuentes/Bungee-Regular.ttf") format("truetype");
  font-display: swap;
}

.logo {
  display: inline-flex;
  align-items: center;
  font-family: "Bungee", var(--fuente-titulo);
  font-size: 1.5rem;
  line-height: 1;
  white-space: nowrap;
  color: #fff;
}
.logo__texto { text-shadow: 0 0.08em 0 rgba(0, 0, 0, 0.35); }
.logo__texto:last-child { color: var(--bola-o); }

/* La "O" es una balota con un aro de los cinco colores del juego */
.logo__bola {
  position: relative;
  width: 0.9em;
  height: 0.9em;
  margin: 0 0.05em;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.logo__bola::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    var(--bola-b) 0 20%, var(--bola-i) 0 40%, var(--bola-n) 0 60%,
    var(--bola-g) 0 80%, var(--bola-o) 0 100%);
  animation: logo-giro 10s linear infinite;
}
.logo__bola > span {
  position: relative;
  width: 56%;
  height: 56%;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 -0.04em 0.06em rgba(0, 0, 0, 0.2);
}
@keyframes logo-giro { to { transform: rotate(360deg); } }

.menu__marca .logo { font-size: 1.3rem; }
.barra-vendedor .logo { font-size: 1.1rem; }
.logo.marca--grande { font-size: 2.5rem; animation: logo-entra 0.9s cubic-bezier(0.2, 1.3, 0.3, 1) both; }
@keyframes logo-entra { from { transform: scale(0.6); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .logo__bola::before, .logo.marca--grande { animation: none; }
}