/* =========================================================================
   Decoração de Natal das telas de login. Só é carregado quando tema_natal
   está ativo (TEMA_LOGIN no config.py). Não altera o login.css: desligando o
   tema, a tela volta exatamente ao visual padrão.
   ========================================================================= */

body.tema-natal {
  background:
    radial-gradient(circle at 30% 35%, rgba(59, 130, 246, 0.18), transparent 45%),
    radial-gradient(circle at 80% 20%, rgba(250, 204, 21, 0.08), transparent 35%),
    linear-gradient(180deg, #0b1630 0%, #0f1f45 60%, #13285a 100%);
  overflow-x: hidden;
}

.tema-natal .login-container {
  position: relative;
  z-index: 3;
}

.tema-natal .login-left {
  background:
    radial-gradient(circle at 50% 40%, rgba(96, 165, 250, 0.18), transparent 60%),
    linear-gradient(160deg, #0f1f45 0%, #0b1630 100%);
}

.natal-cena {
  position: fixed;
  inset: 0;
  pointer-events: none;
  /* na frente do cartão de login (z-index 3); pointer-events: none deixa o
     formulário clicável por baixo dos enfeites */
  z-index: 6;
  overflow: hidden;
}

.natal-cena * {
  pointer-events: none;
}

/* Neve */
.natal-neve span {
  position: absolute;
  top: -30px;
  color: #fff;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
  animation-name: natal-cair;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes natal-cair {
  0%   { transform: translate3d(0, -30px, 0) rotate(0deg); }
  50%  { transform: translate3d(24px, 50vh, 0) rotate(180deg); }
  100% { transform: translate3d(-12px, 105vh, 0) rotate(360deg); }
}

/* Guirlanda */
.natal-guirlanda {
  position: absolute;
  top: 0;
  left: 0;
}

.natal-lampadas circle {
  animation: natal-piscar 1.6s ease-in-out infinite;
  filter: drop-shadow(0 0 4px currentColor);
}

.natal-lampadas circle:nth-child(2n) { animation-delay: 0.5s; }
.natal-lampadas circle:nth-child(3n) { animation-delay: 1s; }

@keyframes natal-piscar {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* Bolas penduradas */
.natal-bola {
  position: absolute;
  top: 0;
  width: 46px;
  height: calc(var(--fio) + 46px);
  transform-origin: top center;
  animation: natal-balancar 4s ease-in-out infinite;
}

.natal-bola::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 1.5px;
  height: var(--fio);
  background: rgba(255, 255, 255, 0.55);
}

.natal-bola::after {
  content: "";
  position: absolute;
  left: 0;
  top: var(--fio);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #fff 0 6%, var(--cor1) 30%, var(--cor2) 100%);
  border-top: 5px solid #d4a017;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

@keyframes natal-balancar {
  0%, 100% { transform: rotate(4deg); }
  50% { transform: rotate(-4deg); }
}

/* Imagens 3D: Papai Noel, presentes, árvore, sinos, flocos e estrelas */
.natal-canto-esq,
.natal-canto-dir {
  position: absolute;
  bottom: 34px;
  display: flex;
  align-items: flex-end;
  z-index: 2;
}

.natal-canto-esq { left: 0.5%; }
.natal-canto-dir { right: 0.5%; flex-direction: row-reverse; }

.natal-canto-esq img,
.natal-canto-dir img {
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.4));
}

.natal-papai {
  position: relative;
  z-index: 3;
  width: 250px;
  margin-right: -36px;
  transform-origin: bottom center;
  animation: natal-acenar 3.5s ease-in-out infinite;
}

.natal-papai-rosto {
  display: block;
  width: 100%;
}

/* mãozinha de joinha na frente da barba */
.natal-papai-joinha {
  position: absolute;
  right: -26px;
  bottom: 34px;
  width: 44%;
  transform-origin: bottom center;
  animation: natal-joinha 1.8s ease-in-out infinite;
}

@keyframes natal-joinha {
  0%, 100% { transform: rotate(-6deg) translateY(0); }
  50% { transform: rotate(4deg) translateY(-6px); }
}

@keyframes natal-acenar {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}

/* presentes da esquerda meio afundados na neve, longe do nome do sistema */
.natal-presente.p1 { width: 120px; position: relative; z-index: 2; margin-bottom: -34px; }
.natal-presente.p2 { width: 86px; margin-left: -18px; margin-bottom: -30px; transform: rotate(8deg); }
.natal-presente.p3 { width: 96px; margin-right: -30px; position: relative; z-index: 2; transform: rotate(-6deg); }

.natal-arvore {
  width: 250px;
}

.natal-sino {
  position: absolute;
  top: 30px;
  width: 58px;
  transform-origin: top center;
  animation: natal-balancar 2.6s ease-in-out infinite;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35));
}

.natal-floco {
  position: absolute;
  opacity: 0.85;
  animation: natal-girar 18s linear infinite;
  filter: drop-shadow(0 0 8px rgba(186, 230, 253, 0.6));
}

@keyframes natal-girar {
  to { transform: rotate(360deg); }
}

.natal-estrela-img {
  position: absolute;
  width: 40px;
  animation: natal-brilho 2.4s ease-in-out infinite;
  filter: drop-shadow(0 0 10px rgba(250, 204, 21, 0.85));
}

@keyframes natal-brilho {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.18); opacity: 0.75; }
}

.natal-chao {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 80px;
}

/* Gorro e azevinho no cartão */
.natal-gorro {
  position: absolute;
  top: -70px;
  right: -62px;
  width: 172px;
  transform: rotate(14deg);
  z-index: 4;
  pointer-events: none;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.3));
}

.natal-azevinho {
  position: absolute;
  top: -30px;
  left: calc(58% - 40px);
  width: 92px;
  z-index: 4;
  pointer-events: none;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.3));
}

/* Telas menores: tira o que encostaria no formulário */
@media (max-width: 1360px) {
  .natal-papai { width: 190px; }
  .natal-arvore { width: 180px; }
  .natal-presente.p1 { width: 84px; margin-bottom: -26px; }
  .natal-presente.p2 { width: 60px; margin-bottom: -22px; }
  .natal-presente.p3 { width: 72px; }
}

@media (max-width: 1150px) {
  .natal-canto-esq,
  .natal-canto-dir,
  .natal-bola-dir,
  .natal-floco,
  .natal-sino { display: none; }
}

@media (max-width: 991px) {
  .natal-azevinho { left: -18px; top: -26px; width: 76px; }
  .natal-bola,
  .natal-estrela-img { display: none; }
  .natal-gorro { width: 110px; top: -40px; right: -24px; }
}

@media (max-width: 576px) {
  .natal-gorro { width: 86px; top: -30px; right: -12px; }
  .natal-chao { height: 50px; }
}

@media (prefers-reduced-motion: reduce) {
  .natal-lampadas circle,
  .natal-bola,
  .natal-sino,
  .natal-papai,
  .natal-papai-joinha,
  .natal-floco,
  .natal-estrela-img { animation: none; }
  .natal-neve { display: none; }
}
