* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0a0a14;
  --card: #12121f;
  --purple: #6E55FF;
  --purple-light: #a78bfa;
  --white: #ffffff;
  --dim: #9ca3af;
  --dim2: #6b7280;
  --border: rgba(255,255,255,0.08);
  --green: #10b981;
  --red: #ef4444;
}

html, body { width: 100%; height: 100%; overflow: hidden; background: #000; font-family: 'Segoe UI', system-ui, sans-serif; color: var(--white); }

.screen { position: fixed; inset: 0; display: none; }
.screen.active { display: flex; }

/* =================== LOGIN =================== */
.login-container { display: flex; width: 100%; height: 100%; background: var(--bg); }

.login-left {
  display: none; position: relative; width: 55%; overflow: hidden;
  align-items: center; justify-content: center;
}
@media (min-width: 900px) { .login-left { display: flex; } }

.login-mesh {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(110,85,255,0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(167,139,250,0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(67,56,202,0.12) 0%, transparent 50%);
  animation: mesh-shift 12s ease-in-out infinite alternate;
}
@keyframes mesh-shift {
  0% { filter: hue-rotate(0deg); transform: scale(1); }
  100% { filter: hue-rotate(15deg); transform: scale(1.05); }
}

.orb {
  position: absolute; border-radius: 50%; filter: blur(80px); pointer-events: none;
}
.orb-1 { top: 15%; left: 20%; width: 300px; height: 300px; background: rgba(110,85,255,0.2); animation: float-slow 8s ease-in-out infinite alternate; }
.orb-2 { bottom: 10%; right: 15%; width: 250px; height: 250px; background: rgba(167,139,250,0.15); animation: float-slow 10s ease-in-out infinite alternate-reverse; }
.orb-3 { top: 50%; left: 60%; width: 180px; height: 180px; background: rgba(67,56,202,0.2); animation: float-slow 7s ease-in-out infinite alternate; }

@keyframes float-slow {
  0% { transform: translateY(0) translateX(0); }
  100% { transform: translateY(-20px) translateX(10px); }
}

.login-left-content { position: relative; z-index: 2; padding: 3rem; max-width: 480px; }
.logo-row { display: flex; align-items: center; gap: 12px; margin-bottom: 2.5rem; }
.logo-icon { width: 44px; height: 44px; }
.logo-text { font-size: 1.4rem; font-weight: 700; }
.hero-title { font-size: 2.8rem; font-weight: 800; line-height: 1.2; margin-bottom: 0.8rem; }
.hero-title span { color: var(--purple); }
.hero-sub { color: var(--dim); font-size: 1rem; line-height: 1.6; margin-bottom: 2rem; }
.feature-pills { display: flex; flex-direction: column; gap: 12px; }
.pill { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 0.9rem; }
.pill-icon { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: rgba(110,85,255,0.1); font-size: 0.85rem; }

.login-right {
  flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem;
}
.login-form-wrapper { width: 100%; max-width: 400px; }
.form-title { font-size: 1.6rem; font-weight: 700; margin-bottom: 0.3rem; }
.form-sub { color: var(--dim); font-size: 0.9rem; margin-bottom: 2rem; }

.field { margin-bottom: 1.2rem; }
.field label { display: block; font-size: 0.85rem; color: var(--dim); margin-bottom: 0.4rem; font-weight: 500; }
.field input {
  width: 100%; padding: 0.75rem 1rem; background: rgba(255,255,255,0.04);
  border: 1px solid var(--border); border-radius: 12px; color: var(--white);
  font-size: 0.95rem; outline: none; transition: all 0.2s;
}
.field input::placeholder { color: rgba(255,255,255,0.2); }
.field input:focus { border-color: rgba(110,85,255,0.5); box-shadow: 0 0 0 3px rgba(110,85,255,0.15); }

.error-msg {
  padding: 0.7rem 1rem; background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2);
  border-radius: 10px; color: var(--red); font-size: 0.85rem; margin-bottom: 1rem;
}

#btn-login {
  width: 100%; padding: 0.85rem; background: var(--purple); border: none; border-radius: 12px;
  color: white; font-size: 0.95rem; font-weight: 600; cursor: pointer;
  transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 8px;
}
#btn-login:hover { background: #5a43e6; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(110,85,255,0.3); }
#btn-login:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.login-footer { text-align: center; margin-top: 2rem; color: var(--dim2); font-size: 0.75rem; }

.hidden { display: none !important; }

/* =================== PLAYER =================== */
#player-screen { background: #000; }

.media-layer {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; background: #000; z-index: 1;
}
.media-layer.hidden { display: none; }

video.media-layer { z-index: 2; }
#image-layer { z-index: 1; }
#video-a { z-index: 3; }
#video-b { z-index: 2; }

/* Screensaver */
#screensaver { z-index: 5; background: #000; display: flex; align-items: center; justify-content: center; }
#screensaver video, #screensaver img { z-index: 1; }
.screensaver-default {
  position: relative; z-index: 2; display: flex; flex-direction: column;
  align-items: center; gap: 1.5rem;
}
.ss-logo { width: 80px; height: 80px; opacity: 0.6; animation: float-slow 6s ease-in-out infinite alternate; }
.ss-clock { font-size: 4rem; font-weight: 200; letter-spacing: 4px; color: rgba(255,255,255,0.7); }
.ss-label { font-size: 0.9rem; color: rgba(255,255,255,0.3); letter-spacing: 3px; }

/* Overlays */
.overlay {
  position: absolute; inset: 0; z-index: 50; display: flex;
  align-items: center; justify-content: center; background: #000;
}

.loading-content, .deactivated-content, .display-off-content {
  text-align: center;
}
.loading-logo { width: 64px; height: 64px; opacity: 0.5; margin-bottom: 1.5rem; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 0.3; } 50% { opacity: 0.7; } }
.loading-text { font-size: 1.1rem; color: var(--dim); }
.loading-detail { font-size: 0.8rem; color: var(--dim2); margin-top: 0.5rem; }

.deactivated-icon { font-size: 3rem; margin-bottom: 1rem; }
.deactivated-text { font-size: 1.3rem; font-weight: 600; color: var(--red); }
.deactivated-sub { font-size: 0.9rem; color: var(--dim); margin-top: 0.5rem; }

.display-off-icon { font-size: 3rem; opacity: 0.3; }

/* HUD */
.hud {
  position: fixed; top: 12px; right: 12px; z-index: 100;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1); border-radius: 10px;
  padding: 8px 14px; font-size: 0.75rem; min-width: 180px;
  opacity: 0; transition: opacity 0.3s;
}
.hud.visible { opacity: 1; }
.hud-row { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.hud-dot { width: 6px; height: 6px; border-radius: 50%; }
.hud-dot.online { background: var(--green); }
.hud-dot.offline { background: var(--red); }
.hud-dim { color: var(--dim2); font-size: 0.7rem; }

/* Transition fade */
.fade-in { animation: fadeIn 0.5s ease-in forwards; }
.fade-out { animation: fadeOut 0.5s ease-out forwards; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
