/* Animações compartilhadas pelo login e pelo tema de Natal do sistema. */
.christmas-decor {
  --christmas-ink: #f2d49a;
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.christmas-decor[hidden],
html:not([data-season="christmas"]) .christmas-decor[data-system] {
  display: none !important;
}

html[data-season="christmas"] .christmas-decor {
  --christmas-ink: #90652c;
}

.christmas-decor[data-system] {
  opacity: 0.5;
  z-index: -1;
}

.christmas-decor[data-system] .christmas-wish {
  display: none;
}

.christmas-aura {
  position: absolute;
  inset: -8%;
  background:
    radial-gradient(ellipse at 88% 78%, rgba(255, 194, 105, 0.13), transparent 30%),
    radial-gradient(ellipse at 8% 14%, rgba(139, 191, 255, 0.16), transparent 34%),
    radial-gradient(ellipse at 65% 8%, rgba(255, 222, 162, 0.07), transparent 26%);
  animation: christmasAura 14s ease-in-out infinite alternate;
}

#christmas-lights {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.christmas-wish {
  position: absolute;
  left: 0;
  top: max(24px, calc(50% - 315px));
  width: max-content;
  white-space: nowrap;
  color: var(--christmas-ink);
  font: 500 clamp(12px, 1.15vw, 16px) 'Poppins', 'Segoe UI', sans-serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0;
  animation: christmasWish 76s linear infinite;
}

.christmas-wish-one { animation-delay: -22s; }
.christmas-wish-three {
  top: auto;
  bottom: max(54px, calc(50% - 315px));
  animation-duration: 88s;
  animation-delay: -28s;
}

.christmas-sleigh {
  position: absolute;
  top: 13%;
  left: 0;
  width: clamp(190px, 22vw, 300px);
  color: var(--christmas-ink);
  opacity: 0;
  filter: drop-shadow(0 0 9px rgba(246, 203, 127, 0.2));
  animation: christmasFlight 54s linear infinite;
  animation-delay: -17s;
}

.christmas-sleigh svg { display: block; width: 100%; height: auto; }
.christmas-sleigh-body { animation: christmasBob 4s ease-in-out infinite; }
.christmas-reindeer { animation: christmasLeap 2.4s ease-in-out infinite alternate; }
.christmas-reindeer-second { animation-delay: -1.2s; }

/* O trenó fica entre o fundo e o conteúdo do cabeçalho, em todos os temas. */
.christmas-header-host { isolation: isolate; }
.christmas-header-static { position: relative; }
.christmas-header-scene {
  --christmas-ink: var(--color-gold, #c5a059);
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}
.christmas-header-scene .christmas-sleigh {
  top: 50%;
  width: 200px;
  animation: christmasHeaderFlight 36s linear infinite;
  animation-delay: -11s;
}
@keyframes christmasHeaderFlight {
  0% { opacity: 0; transform: translate3d(-220px, -50%, 0); }
  10%, 86% { opacity: 0.85; }
  100% { opacity: 0; transform: translate3d(calc(100vw + 220px), -50%, 0); }
}

@keyframes christmasWish {
  0% { opacity: 0; transform: translate3d(calc(-100% - 60px), 0, 0); }
  12% { opacity: 0.3; }
  85% { opacity: 0.3; }
  100% { opacity: 0; transform: translate3d(calc(100vw + 60px), -12px, 0); }
}

@keyframes christmasFlight {
  0% { opacity: 0; transform: translate3d(-340px, 18px, 0); }
  10% { opacity: 0.68; }
  50% { transform: translate3d(50vw, -16px, 0); }
  85% { opacity: 0.68; }
  100% { opacity: 0; transform: translate3d(calc(100vw + 340px), 12px, 0); }
}

@keyframes christmasBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes christmasLeap {
  from { transform: translateY(1px); }
  to { transform: translateY(-4px); }
}

@keyframes christmasAura {
  from { opacity: 0.5; transform: translate3d(-1%, 1%, 0); }
  to { opacity: 1; transform: translate3d(1%, -1%, 0); }
}

@media (max-width: 768px) {
  .christmas-decor { opacity: 0.85; }
  .christmas-wish-one { top: 22px; }
  .christmas-sleigh { top: 9%; width: 190px; }
}

.christmas-paused *,
.christmas-paused .christmas-aura {
  animation-play-state: paused !important;
}

@media (prefers-reduced-motion: reduce) {
  .christmas-aura {
    animation: none;
  }
  .christmas-wish,
  .christmas-sleigh { display: none; }
  .holiday-bauble,
  .holiday-loader-halo { animation: none !important; }
}

@media print {
  .christmas-decor,
  .christmas-header-scene,
  .escobar-christmas-notice { display: none !important; }
}

/* Bolas com volume e reflexos para a abertura e para o fundo do login. */
.holiday-baubles {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 3;
}
.holiday-bauble {
  --ball-light: #edcd87; --ball-mid: #b2863d; --ball-dark: #5b3f1b;
  position: absolute; top: 0; left: var(--x); width: var(--size);
  height: calc(var(--drop) + var(--size)); transform-origin: 50% 0;
  animation: holidayBaubleSway var(--time, 11s) ease-in-out infinite alternate;
  animation-delay: var(--delay, -3s);
}
.holiday-bauble::before {
  content: ''; position: absolute; top: 0; left: 50%; height: var(--drop); width: 1px;
  background: linear-gradient(transparent, rgba(236, 211, 157, 0.65));
}
.holiday-bauble i {
  position: absolute; top: var(--drop); width: var(--size); height: var(--size);
  border-radius: 50%; border: 1px solid rgba(255, 237, 196, 0.2);
  background: radial-gradient(circle at 28% 23%, rgba(255,255,255,0.8), transparent 15%),
    radial-gradient(circle at 33% 28%, var(--ball-light), var(--ball-mid) 45%, var(--ball-dark) 90%);
  box-shadow: inset -5px -7px 12px rgba(0,0,0,0.2), 0 8px 28px rgba(0,0,0,0.2);
}
.holiday-bauble i::before {
  content: ''; position: absolute; top: -5px; left: 38%; width: 24%; height: 6px;
  border-radius: 2px 2px 0 0; background: linear-gradient(90deg, #8d6a34, #f2d69c, #8d6a34);
}
.holiday-bauble i::after {
  content: ''; position: absolute; inset: 14% 12%; border-radius: 50%;
  border-top: 1px solid rgba(255,245,217,0.5); border-bottom: 1px solid rgba(255,245,217,0.22);
  transform: rotate(-28deg);
}
.holiday-bauble-wine { --ball-light: #dc8997; --ball-mid: #9b3e53; --ball-dark: #3b1525; }
.holiday-bauble-green { --ball-light: #91c3ac; --ball-mid: #357b61; --ball-dark: #10382c; }
.holiday-loader-halo {
  position: absolute; top: 50%; left: 50%; width: min(72vw, 440px); aspect-ratio: 1;
  border-radius: 50%; border: 1px solid rgba(221,185,114,0.13); pointer-events: none;
  background: radial-gradient(circle, rgba(218,178,104,0.1), transparent 66%);
  box-shadow: 0 0 90px rgba(203,160,78,0.06), inset 0 0 65px rgba(203,160,78,0.05);
  animation: holidayHaloPulse 8s ease-in-out infinite alternate;
}
.holiday-loader-halo::after {
  content: ''; position: absolute; inset: 9%; border: 1px dashed rgba(221,185,114,0.15); border-radius: 50%;
}
#loader-wrapper.hidden .holiday-bauble,
#loader-wrapper.hidden .holiday-loader-halo { animation-play-state: paused; }
@keyframes holidayBaubleSway {
  from { transform: rotate(-4deg); }
  to { transform: rotate(4deg); }
}
@keyframes holidayHaloPulse {
  from { transform: translate(-50%, -50%) scale(0.94) rotate(-8deg); opacity: 0.55; }
  to { transform: translate(-50%, -50%) scale(1.06) rotate(8deg); opacity: 1; }
}
@media (max-width: 768px) {
  .holiday-bauble { scale: 0.7; }
  #main-content .holiday-bauble:nth-child(3), #main-content .holiday-bauble:nth-child(4) { display: none; }
}


/* Integração com o layout existente, sem alterar cartões, tabelas ou modais. */
html[data-season="christmas"] body.escobar-christmas-page { isolation: isolate; }
html[data-season="christmas"] {
  --christmas-particles: 165, 116, 43;
  --christmas-snow: 71, 126, 111;
}
#main-content > .christmas-decor { position: absolute; z-index: 2; }
.christmas-theme-button {
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #28584b 50%, #a64b52 50%);
  border: 1px solid #b99350; color: #fff3cb; font-size: 9px;
}
[data-theme-option][aria-pressed="true"] {
  outline: 2px solid var(--color-gold); outline-offset: 3px;
}
.escobar-update-message {
  margin: -10px 0 14px; padding: 8px 10px; border: 1px solid rgba(197,160,89,0.3);
  border-radius: 8px; color: #e8d3ad; background: rgba(197,160,89,0.06);
  font-size: 11px; line-height: 1.5;
}
.escobar-christmas-notice {
  position: fixed; right: 18px; bottom: 18px; z-index: 90;
  width: min(350px, calc(100vw - 36px)); box-sizing: border-box;
  padding: 16px 38px 14px 16px; border: 1px solid var(--color-border);
  border-radius: 14px; background: var(--color-card); color: var(--color-text);
  box-shadow: 0 10px 36px rgba(30,60,45,0.14); font-family: var(--font-family-main, 'Outfit', sans-serif);
}
.escobar-christmas-notice strong { display: block; font-size: 13px; }
.escobar-christmas-notice strong span { color: var(--color-gold); }
.escobar-christmas-notice p { margin: 7px 0 10px; color: var(--color-muted); font-size: 12px; line-height: 1.6; }
.escobar-notice-close {
  position: absolute; top: 7px; right: 7px; width: 28px; height: 28px; border: 0; border-radius: 6px;
  background: transparent; color: var(--color-muted); font-size: 20px; cursor: pointer;
}
.escobar-notice-action {
  border: 0; padding: 0; background: transparent; color: var(--color-accent); font: inherit;
  font-size: 12px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.escobar-dashboard-themes {
  position: fixed; left: 16px; bottom: 16px; z-index: 60; display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; background: var(--color-card); border: 1px solid var(--color-border);
  border-radius: 12px; box-shadow: 0 4px 18px rgba(30,60,45,0.08);
}
.escobar-dashboard-themes span { font: 600 9px var(--font-family-main, sans-serif); letter-spacing: 0.1em; color: var(--color-muted); }
.escobar-dashboard-themes button { width: 16px; height: 16px; border: 1px solid #9cafa4; border-radius: 50%; cursor: pointer; padding: 0; }
@media (max-width: 520px) {
  .escobar-christmas-notice { bottom: 70px; }
}
@media print {
  .escobar-christmas-notice, .escobar-dashboard-themes { display: none !important; }
}

