/* =====================================================================
   LOGIN SCREEN — Mesh gradient + glass morphism
   ===================================================================== */
#login-screen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  align-items: center;
  justify-content: center;
  background: var(--obsidian);
  overflow: hidden;
}
#login-screen.show { display: flex; }

#login-screen::before {
  content: '';
  position: absolute;
  inset: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(ellipse 600px 400px at 20% 30%, rgba(47,136,255,0.40), transparent),
    radial-gradient(ellipse 500px 500px at 80% 20%, rgba(34,211,238,0.30), transparent),
    radial-gradient(ellipse 400px 600px at 60% 80%, rgba(27,111,230,0.28),  transparent),
    radial-gradient(ellipse 700px 300px at 30% 70%, rgba(56,189,248,0.18), transparent);
  animation: meshDrift 20s ease-in-out infinite alternate;
}
@keyframes meshDrift {
  0%   { transform: translate(0, 0)    rotate(0deg); }
  33%  { transform: translate(-5%, 3%) rotate(1deg); }
  66%  { transform: translate(3%, -4%) rotate(-1deg); }
  100% { transform: translate(-2%, 5%) rotate(0.5deg); }
}

#login-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
}

.login-box {
  position: relative;
  z-index: 1;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(40px) saturate(1.4);
  -webkit-backdrop-filter: blur(40px) saturate(1.4);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-xl);
  padding: 44px 40px;
  width: 420px;
  max-width: 92vw;
  box-shadow: 0 32px 80px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.08);
  animation: loginAppear 0.7s var(--ease-out) both;
  color: #fff;
}
@keyframes loginAppear {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}
.login-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--brand-grad);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: 'Instrument Serif', serif;
  font-size: 30px;
  font-style: italic;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(47,136,255,0.45);
}
.login-title {
  font-family: 'Instrument Serif', serif;
  font-size: 26px;
  font-weight: 400;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1;
}
.login-subtitle {
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  margin-top: 4px;
}

.login-box .field span { color: rgba(255,255,255,0.7); }
.login-box .field input {
  background: rgba(255,255,255,0.05);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
}
.login-box .field input::placeholder { color: rgba(255,255,255,0.35); }
.login-box .field input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

.login-box .btn-primary {
  background: var(--brand);
  color: #fff;
  margin-top: 8px;
  padding: 12px 18px;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(47,136,255,0.40);
}
.login-box .btn-primary:hover {
  background: var(--brand-dark);
  color: #fff;
}

.login-error {
  min-height: 18px;
  color: #fca5a5;
  font-size: 13px;
  margin: 4px 0 8px;
}

.login-hint {
  margin-top: 20px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px dashed rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: rgba(255,255,255,0.6);
}
.login-hint strong { color: var(--brand-light); }
