/* ═══════════════════════════════════════════════════════
   ESCALA · Tema de Navidad (solo visual)
   Todo cuelga de html.navidad, que pone assets/js/navidad.js
   en temporada. Ningún adorno intercepta clics, y no se tocan
   los colores que significan algo (errores, estados, cursos).
   Las ilustraciones están en assets/img/navidad/.
   ═══════════════════════════════════════════════════════ */

html.navidad {
  --nav-rojo:    #c4302a;
  --nav-rojo-dk: #8f1d17;
  --nav-verde:   #14603c;
  --nav-oro:     #ffd45c;
}

/* Los dibujos que se repiten llevan 2px transparentes en el borde
   opuesto: sin ellos, con zoom del sistema, asoma una línea. */

/* ── Guirnalda de abeto con luces ───────────────────────
   Dos capas que se alternan para que parpadeen. Quedan por
   debajo de modales, diálogos y videollamada (z-index ≥ 150). */
html.navidad::before,
html.navidad::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 46px;
  z-index: 101;
  pointer-events: none;
  background: url('../img/navidad/guirnalda-a.svg') repeat-x;
}
html.navidad::after {
  background-image: url('../img/navidad/guirnalda-b.svg');
  animation: navLuces 2.4s ease-in-out infinite;
}
@keyframes navLuces { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* ── Fondo: halos, paisaje nevado y nieve, detrás de todo ── */
html.navidad .aurora-blob-1 { background: radial-gradient(circle, rgba(196,48,42,.22), transparent 62%); }
html.navidad .aurora-blob-2 { background: radial-gradient(circle, rgba(20,96,60,.26), transparent 62%); }
html.navidad .aurora-blob-3 { background: radial-gradient(circle, rgba(242,179,44,.24), transparent 60%); }

html.navidad .aurora-bg::before {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 220px;
  background: url('../img/navidad/paisaje.svg') repeat-x left 0 bottom -2px;
}
html.navidad .tema-oscuro .aurora-bg::before { opacity: .22; }
html.navidad .tema-oscuro .aurora-blob { opacity: .45; }

html.navidad .aurora-bg::after {
  content: '';
  position: absolute;
  top: -380px; left: 0; right: 0; bottom: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='380' height='380'%3E%3Cg fill='%237fb6da' fill-opacity='.7'%3E%3Ccircle cx='24' cy='36' r='3'/%3E%3Ccircle cx='132' cy='14' r='1.8'/%3E%3Ccircle cx='214' cy='96' r='3.4'/%3E%3Ccircle cx='322' cy='52' r='2.2'/%3E%3Ccircle cx='72' cy='152' r='2'/%3E%3Ccircle cx='268' cy='188' r='1.6'/%3E%3Ccircle cx='158' cy='232' r='2.6'/%3E%3Ccircle cx='40' cy='282' r='1.5'/%3E%3Ccircle cx='346' cy='266' r='3'/%3E%3Ccircle cx='226' cy='322' r='2.2'/%3E%3Ccircle cx='108' cy='356' r='2.4'/%3E%3C/g%3E%3Cg stroke='%237fb6da' stroke-width='1.4' stroke-opacity='.75'%3E%3Cpath d='M180 40v16M173 44l14 8M187 44l-14 8M296 134v12M291 137l10 6M301 137l-10 6M92 244v14M86 247l12 8M98 247l-12 8'/%3E%3C/g%3E%3C/svg%3E");
  animation: navNieve 22s linear infinite;
}
@keyframes navNieve { to { transform: translateY(380px); } }

/* ── Gorro sobre el logotipo ──────────────────────────── */
html.navidad .sidebar-logo,
html.navidad .login-logo { position: relative; }
html.navidad .sidebar-logo { padding-top: 50px; padding-bottom: 8px; }
html.navidad .main { padding-top: 52px; }

html.navidad .sidebar-logo::after,
html.navidad .login-logo::after {
  content: '';
  position: absolute;
  width: 40px; height: 36px;
  pointer-events: none;
  transform: rotate(-14deg);
  background: url('../img/navidad/gorro.svg') no-repeat;
}
html.navidad .sidebar-logo::after { left: 9px; top: 30px; }
html.navidad .login-logo::after   { left: -13px; top: -21px; }

/* ── Menú, títulos y tarjetas ─────────────────────────── */
html.navidad .sidebar .nav-item.active {
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,.1) 0 7px, transparent 7px 14px),
    linear-gradient(135deg, var(--nav-rojo), var(--nav-rojo-dk));
  color: #fff;
  box-shadow: 0 8px 18px rgba(196,48,42,.3);
}
html.navidad .sidebar .nav-item.active::after {
  content: '❄';
  margin-left: auto;
  font-size: 14px;
  opacity: .9;
}
html.navidad .sidebar .nav-section-label::after { content: ' ✦'; color: var(--nav-rojo); }

html.navidad .page-title::before {
  width: 7px;
  background: repeating-linear-gradient(135deg, var(--nav-rojo) 0 4px, #fff 4px 8px);
  box-shadow: 0 0 0 1px rgba(196,48,42,.35);
}
html.navidad .page-header { border-bottom-color: rgba(20,96,60,.28); }

/* Cinta de regalo en el borde superior de las tarjetas de Inicio */
html.navidad .dash-card,
html.navidad .dash-stat-card {
  border-top: 4px solid transparent;
  border-image: none;
  box-shadow: inset 0 3px 0 rgba(196,48,42,.75), var(--glass-shadow);
}
html.navidad .dash-card:nth-child(even),
html.navidad .dash-stat-card:nth-child(even) {
  box-shadow: inset 0 3px 0 rgba(20,96,60,.8), var(--glass-shadow);
}

/* ── Saludo de Inicio: escena nocturna ────────────────── */
html.navidad body .dash-welcome-banner {
  /* !important porque la capa móvil pinta el suyo. */
  background: linear-gradient(115deg, #0d4a30 0%, #14603c 40%, #12385a 100%) !important;
  min-height: 180px;
  padding-top: 40px !important;
  box-shadow: 0 18px 42px rgba(16,64,52,.3) !important;
}
/* Nieve acumulada arriba */
html.navidad .dash-welcome-banner::before {
  top: 0; left: 0; right: 0;
  width: auto; height: 22px;
  border-radius: 0;
  background: url('../img/navidad/nieve-borde.svg') repeat-x left 0 top -2px;
  pointer-events: none;
}
/* Árbol, luna y regalos a la derecha */
html.navidad .dash-welcome-banner::after {
  top: auto; right: 0; bottom: 0;
  width: 460px; max-width: 62%; height: 100%;
  border-radius: 0;
  background: url('../img/navidad/saludo.svg') no-repeat right bottom / contain;
  pointer-events: none;
}
/* El texto nunca se mete debajo del dibujo */
html.navidad .dash-welcome-fecha,
html.navidad .dash-welcome-titulo,
html.navidad .dash-welcome-subtitulo { max-width: 58%; text-shadow: 0 1px 8px rgba(0,0,0,.35); }
html.navidad .dash-welcome-subtitulo::after {
  content: '★ Felices fiestas';
  display: block;
  margin-top: 8px;
  color: var(--nav-oro);
  font-size: 15px;
  font-weight: 800;
}

/* ── Acceso y carga: noche de Nochebuena ──────────────── */
html.navidad body:has(> .splash-card),
html.navidad body:has(> .login-card) {
  /* luna · paisaje · cielo. !important por la capa móvil. */
  background:
    radial-gradient(circle at 84% 18%, #fff3c9 0 30px, rgba(255,243,201,.22) 31px 56px, transparent 90px),
    url('../img/navidad/paisaje.svg') repeat-x left 0 bottom -2px,
    linear-gradient(180deg, #081a33 0%, #123a63 62%, #1d5a7e 100%) !important;
  background-attachment: fixed !important;
}
html.navidad body:has(> .login-card) { padding: 52px 0 200px; }
html.navidad body:has(> .splash-card) .aurora-blob,
html.navidad body:has(> .splash-card) .aurora-bg::before,
html.navidad body:has(> .login-card) .aurora-blob,
html.navidad body:has(> .login-card) .aurora-bg::before { display: none; }
html.navidad body:has(> .splash-card) .aurora-bg::after,
html.navidad body:has(> .login-card) .aurora-bg::after { filter: brightness(1.8); }

html.navidad body .login-card {
  background: rgba(255,255,255,.96) !important;
  box-shadow: 0 30px 70px rgba(0,0,0,.4) !important;
  overflow: visible;
}
/* Nieve posada sobre la tarjeta */
html.navidad .login-card::before {
  content: '';
  position: absolute;
  top: -3px; left: 22px; right: 22px;
  height: 22px;
  background: url('../img/navidad/nieve-borde.svg') repeat-x left 0 top -2px;
  filter: drop-shadow(0 2px 2px rgba(40,100,150,.3));
  pointer-events: none;
}
html.navidad .login-card::after {
  content: '★  Felices fiestas  ★';
  display: block;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 2px dashed rgba(196,48,42,.35);
  color: var(--nav-verde);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  white-space: pre;
}
html.navidad body .btn-login {
  background: linear-gradient(135deg, var(--nav-rojo), var(--nav-rojo-dk)) !important;
  box-shadow: 0 12px 26px rgba(196,48,42,.32) !important;
}
/* El pie va sobre el cielo y la nieve: en una pastilla oscura se lee siempre */
html.navidad body .footer-info {
  width: auto;
  max-width: 92vw;
  padding: 8px 18px;
  border-radius: 20px;
  background: rgba(6,20,40,.72);
  color: #fff !important;
}
html.navidad body .footer-info a { color: #a9ddff !important; }

/* ── Pantalla de carga ────────────────────────────────── */
html.navidad .splash-card { background: rgba(255,255,255,.96); }
/* Nieve posada sobre la tarjeta */
html.navidad .splash-card::before {
  content: '';
  position: absolute;
  top: -3px; left: 26px; right: 26px;
  height: 22px;
  background: url('../img/navidad/nieve-borde.svg') repeat-x left 0 top -2px;
  filter: drop-shadow(0 2px 2px rgba(40,100,150,.3));
  pointer-events: none;
}
html.navidad .splash-card::after {
  content: '★ Felices fiestas ★';
  display: block;
  margin-top: 18px;
  color: var(--nav-verde);
  font-size: 14px;
  font-weight: 800;
}
html.navidad .logo-wrap { position: relative; box-shadow: 0 18px 40px rgba(196,48,42,.28); }
html.navidad .logo-wrap::after {
  content: '';
  position: absolute;
  top: -34px; left: -24px;
  width: 76px; height: 68px;
  transform: rotate(-16deg);
  background: url('../img/navidad/gorro.svg') no-repeat center / contain;
  pointer-events: none;
}
html.navidad .brand-bar {
  width: 76px; height: 6px; border-radius: 3px;
  background: repeating-linear-gradient(135deg, var(--nav-rojo) 0 6px, #fff 6px 12px);
  box-shadow: 0 0 0 1px rgba(196,48,42,.35);
}
html.navidad .welcome-msg span { color: var(--nav-rojo); }
html.navidad .brand-sub .dot { background: var(--nav-rojo); }
html.navidad .brand-sub .dot:nth-child(2) { background: var(--nav-verde); opacity: 1; }
html.navidad .brand-sub .dot:nth-child(3) { background: #e9a51a; }
/* Barra de progreso como un bastón de caramelo */
html.navidad .progress-wrap { width: 200px; height: 9px; border-radius: 5px; background: #e6eef5; }
html.navidad .progress-bar {
  border-radius: 5px;
  background: repeating-linear-gradient(135deg, var(--nav-rojo) 0 7px, #fff 7px 12px, var(--nav-verde) 12px 19px, #fff 19px 24px);
}
html.navidad body .version { color: #3c5a72; font-weight: 700; }

/* ── Móvil ────────────────────────────────────────────── */
@media (max-width: 640px) {
  /* La barra superior (z-index 150) taparía la guirnalda: va encima,
     más pequeña y sin llegar a los botones. */
  html.navidad::before,
  html.navidad::after {
    height: 19px;
    z-index: 151;
    background-size: 100px 19px;
  }
  html.navidad .main { padding-top: 60px; }
  /* Sin nieve cayendo ni paisaje en el panel: batería y datos de la videoclase. */
  html.navidad .aurora-bg::before,
  html.navidad .aurora-bg::after { display: none; }
  html.navidad body .dash-welcome-banner { min-height: 160px; padding-top: 30px !important; }
  html.navidad .dash-welcome-banner::after { max-width: 52%; }
  html.navidad .dash-welcome-fecha,
  html.navidad .dash-welcome-titulo,
  html.navidad .dash-welcome-subtitulo { max-width: 68%; }
  /* Sin luna: en pantalla estrecha quedaba detrás de la tarjeta. */
  html.navidad body:has(> .splash-card),
  html.navidad body:has(> .login-card) {
    background:
      url('../img/navidad/paisaje.svg') repeat-x left 0 bottom -2px,
      linear-gradient(180deg, #081a33 0%, #123a63 62%, #1d5a7e 100%) !important;
    background-attachment: fixed !important;
  }
  html.navidad body:has(> .login-card) { padding-bottom: 150px; }
  /* La carga dura 3 segundos: aquí la nieve sí se queda. */
  html.navidad body:has(> .splash-card) .aurora-bg::after { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  html.navidad::after,
  html.navidad .aurora-bg::after { animation: none; }
}

@media print {
  html.navidad::before,
  html.navidad::after { display: none; }
}
