/* --- ZMIENNE I KONFIGURACJA --- */
:root {
  --primary-font: 'Lexend', sans-serif;
  --accent-color: #8324bc;
  --accent-gradient: linear-gradient(135deg, #8324bc, #5b7add);
  --text-main: #333;
  --text-muted: #666;
  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
  --input-bg: rgba(255, 255, 255, 0.7);
  --error-color: #a5f2f3;
}

/* Tryb ciemny (opcjonalnie, jeśli obsługiwany przez klasę nadrzędną) */
html.dark-mode {
    --text-main: #f0f0f0;
    --text-muted: #ccc;
    --glass-bg: rgba(20, 20, 35, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(0, 0, 0, 0.3);
}

/* EKRAN LOGOWANIA */
.login-page {
  margin: 0;
  padding: 0;
  height: 100vh;
  min-height: 100vh;
  font-family: var(--primary-font);
    background: linear-gradient(
    135deg,
    rgba(117, 139, 208, 0.25),
    rgba(131, 36, 188, 0.25)
  );
  /* Alternatywny gradient ciemniejszy, jeśli wolisz stary: 
  background: linear-gradient(135deg, rgba(117, 139, 208, 0.25), rgba(131, 36, 188, 0.25)); */
  display: flex;
  justify-content: center;
  align-items: center;  
  overflow: hidden;
  position: relative;
}

/* Kontener centralny */
.container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 5;
  padding: 20px;
}

/* --- LOGO I CZAPKA --- */
.logo-wrapper {
    position: relative;
    width: 30%; /* Tak jak oryginał .logo2 */
    margin-bottom: 100px;
    z-index: 10;
    display: flex;
    justify-content: center;
    animation: fadeIn 1s ease forwards;
}

.logo2 {
  width: 100%; /* Wypełnia wrapper */
  height: auto;
  display: block;
}

.santa-hat {
    position: absolute;
    top: -30%;
    right: -5%;
    width: 18%;
    height: auto;
    transform: rotate(15deg);
    filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.3));
    z-index: 11;
    pointer-events: none;
}

@keyframes floatHat {
    0%, 100% { transform: rotate(12deg) translateY(0); }
    50% { transform: rotate(10deg) translateY(-5px); }
}

/* --- PANEL SZKLANY (GLASSMORPHISM) --- */
.login-box {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  padding: 40px;
  border-radius: 24px;
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 400px;
  margin-bottom: 5vh;
  animation: fadeSlideIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.login-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px 0 rgba(31, 38, 135, 0.25);
}

.login-content {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Efekt szronu */
.frost-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(circle at top right, rgba(255,255,255,0.4), transparent 70%);
    opacity: 0.6;
}

/* Typografia */
.login-box h1 {
  color: var(--text-main);
  margin-bottom: 10px;
  font-weight: 700;
  font-size: 1.8rem;
  text-align: center;
  letter-spacing: -0.5px;
}

.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(131, 36, 188, 0.1);
    color: #8324bc;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 15px;
    border: 1px solid rgba(131, 36, 188, 0.2);
}

.status-dot {
    width: 6px;
    height: 6px;
    background-color: #8324bc;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.login-box h2 {
  color: var(--text-muted);
  margin-bottom: 30px;
  font-weight: 400;
  text-align: center;
  font-size: 0.95rem;
}

/* --- POLA FORMULARZA --- */
.password-wrapper { 
    position: relative; 
    width: 100%; 
    margin-bottom: 25px;
}

.input-group {
    position: relative;
    width: 100%;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    opacity: 0.7;
    z-index: 3;
    pointer-events: none;
    font-size: 1rem;
}

.login-box input {
  width: 100%;
  padding: 16px 45px; /* Miejsce na ikony */
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 16px;
  outline: none;
  font-size: 1rem;
  font-family: var(--primary-font);
  background: var(--input-bg);
  color: var(--text-main);
  transition: all 0.3s ease;
}

.login-box input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.login-box input:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-color);
  box-shadow: 0 0 0 4px rgba(131, 36, 188, 0.15);
  transform: translateY(-1px);  
}

/* Ikona oka */
#togglePassword {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-muted);
    padding: 5px;
    z-index: 10;
    transition: color 0.3s;
}
#togglePassword:hover { color: var(--accent-color); }

/* Caps Lock */
.caps-warning {
  position: absolute;
  right: 0;
  top: -25px;
  color: #ff9800;
  font-size: 0.75rem;
  font-weight: 600;
  display: none; 
  align-items: center;
  gap: 4px;
  animation: fadeIn 0.3s ease;
}

/* Error State (Zamarznięty) */
.login-box input.error {
  border-color: #a5f2f3;
  background: rgba(220, 245, 255, 0.6);
  color: #0d4666; 
  box-shadow: 0 0 0 4px rgba(165, 242, 243, 0.3);
}

/* --- PRZYCISK --- */
.login-box button {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 16px;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--primary-font);
  cursor: pointer;
  color: #fff;
  background: var(--accent-gradient);
  background-size: 200% auto;
  box-shadow: 0 10px 20px -5px rgba(131, 36, 188, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.login-box button:hover {
  background-position: right center;
  transform: translateY(-3px);
  box-shadow: 0 15px 25px -5px rgba(131, 36, 188, 0.5);
}

.btn-icon {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.login-box button:hover .btn-icon {
    transform: translateX(4px);
}

/* Komunikaty i stopka */
#errorMsg {
  color: #d32f2f;
  margin-top: 15px;
  opacity: 0;
  transition: opacity 0.3s ease;
  font-weight: 500;
  font-size: 0.9rem;
  text-align: center;
  min-height: 20px;
}
/* Jeśli tło jest ciemne, błąd lodowy */
html.dark-mode #errorMsg { color: #a5f2f3; }

.app-version {
    margin-top: 25px;
    font-size: 0.75rem;
    opacity: 0.5;
    font-weight: 300;
    letter-spacing: 1px;
    color: var(--text-main);
}

/* --- EFEKTY DODATKOWE --- */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(40px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(131, 36, 188, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(131, 36, 188, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(131, 36, 188, 0); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.login-box.shake { animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both; }

/* --- LAMPKI CHOINKOWE (Zachowane i dostosowane) --- */
/* .christmas-lights {
    position: absolute;
    top: -15px;
    left: 0;
    width: 100%;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    list-style: none;
    z-index: 20;
    pointer-events: none;
    overflow: hidden;
    white-space: nowrap;
}

.christmas-lights li {
    position: relative;
    margin: 0 15px;
    display: inline-block;
    width: 14px;
    height: 22px;
    border-radius: 50%;
    background: #ccc;
    animation-duration: 2s;
    animation-iteration-count: infinite;
    animation-fill-mode: both;
}

/* Kabel *
.christmas-lights li:before {
    content: "";
    position: absolute;
    top: -5px;
    left: -20px;
    width: 40px;
    height: 10px;
    border-bottom: 2px solid #2e3d36;
    border-radius: 50%;
    z-index: 0;
}
/* Oprawka *
.christmas-lights li:after {
    content: "";
    position: absolute;
    top: -3px;
    left: 2px;
    width: 10px;
    height: 5px;
    background: #222;
    z-index: 1;
}

.christmas-lights li:nth-child(4n+1) { background-color: #ff3b3b; animation-name: glow-red; }
.christmas-lights li:nth-child(4n+2) { background-color: #3bff3b; animation-name: glow-green; animation-delay: 0.5s; }
.christmas-lights li:nth-child(4n+3) { background-color: #3b8aff; animation-name: glow-blue; animation-delay: 1s; }
.christmas-lights li:nth-child(4n+4) { background-color: #ffd900; animation-name: glow-gold; animation-delay: 1.5s; }

@keyframes glow-red { 0%, 100% { box-shadow: 0 5px 25px 3px rgba(255, 59, 59, 1); opacity: 1; } 50% { opacity: 0.5; } }
@keyframes glow-green { 0%, 100% { box-shadow: 0 5px 25px 3px rgba(59, 255, 59, 1); opacity: 1; } 50% { opacity: 0.5; } }
@keyframes glow-blue { 0%, 100% { box-shadow: 0 5px 25px 3px rgba(59, 138, 255, 1); opacity: 1; } 50% { opacity: 0.5; } }
@keyframes glow-gold { 0%, 100% { box-shadow: 0 5px 25px 3px rgba(255, 217, 0, 1); opacity: 1; } 50% { opacity: 0.5; } } */

/* --- ŚNIEG (Parallax & Wind) --- */
#snow-container {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
}

.snowflake {
  position: absolute;
  top: -20px;
  color: #fff;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  background: white;
}

@keyframes snowfall {
  0% { opacity: 0; transform: translate3d(0, 0, 0) rotate(0deg); }
  10% { opacity: 0.8; }
  100% { opacity: 0; transform: translate3d(var(--wind-x, 50px), 110vh, 0) rotate(360deg); }
}

.snowflake.layer1 { width: 8px; height: 8px; z-index: 3; filter: blur(0.5px); --wind-x: 100px; animation: snowfall linear infinite; }
.snowflake.layer2 { width: 6px; height: 6px; z-index: 2; filter: blur(1px); --wind-x: 50px; animation: snowfall linear infinite; }
.snowflake.layer3 { width: 4px; height: 4px; z-index: 0; filter: blur(2px); opacity: 0.5; --wind-x: 20px; animation: snowfall linear infinite; }

/* --- EFEKT PARY --- */
.breath-overlay {
    position: fixed; bottom: 0; left: 0; width: 100%; height: 25vh;
    background: linear-gradient(to top, rgba(255,255,255,0.3), transparent);
    filter: blur(40px); pointer-events: none; z-index: 4; opacity: 0.3;
    animation: breathe 8s ease-in-out infinite;
}
@keyframes breathe { 0%, 100% { transform: scaleY(1); opacity: 0.2; } 50% { transform: scaleY(1.2); opacity: 0.4; } }

/* --- THEME TOGGLE --- */
.theme-toggle-container { position: absolute; top: 20px; right: 20px; z-index: 1000; }
.theme-toggle {
  position: relative; width: 60px; height: 32px; border-radius: 20px;
  cursor: pointer; padding: 0 5px; display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,0.4); border: 1px solid rgba(255,255,255,0.5);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1); transition: all 0.3s ease;
}
.theme-toggle .toggle-knob {
  position: absolute; top: 3px; left: 3px; width: 24px; height: 24px;
  border-radius: 50%; background: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2); transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}
.theme-toggle .sun-icon { color: #f39c12; font-size: 14px; }
.theme-toggle .moon-icon { color: #f1c40f; font-size: 14px; }
html.dark-mode .theme-toggle .toggle-knob { transform: translateX(28px); }

/* --- RESPANSYWNOŚĆ --- */
@media (max-width: 768px) {
    .login-box { max-width: 90%; padding: 30px 20px; }
    .logo-wrapper { width: 280px; margin-bottom: 30px; }
    .christmas-lights { width: 120%; left: -10%; }
    .christmas-lights li { margin: 0 8px; width: 10px; height: 16px; }
    .christmas-lights li:before { width: 25px; left: -12px; }
    .breath-overlay { display: none; }
    .snowflake.layer1 { display: none; }
    .login-box h1 { font-size: 1.5rem; }
}

@media (max-height: 600px) {
    .logo-wrapper { display: none; } /* Ukryj logo na bardzo niskich ekranach */
    .login-box { margin-bottom: 0; }
}