/* ── Login page ───────────────────────────────────────────────────────────── */
/* The animated gradient backdrop lives in shared.css (applied to body).
   The login page layers three cursor-reactive color orbs on top of that for
   depth, then renders the card in Apple-style frosted glass. */

.login-hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

/* ── Cursor-reactive background orbs ─────────────────────────────────────── */
.login-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  will-change: transform;
  transition: transform 0.05s linear;
}

.orb-1 {
  width: 520px; height: 520px;
  top: -10%; left: -8%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.85), transparent 70%);
}

.orb-2 {
  width: 620px; height: 620px;
  bottom: -15%; right: -12%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.75), transparent 70%);
}

.orb-3 {
  width: 460px; height: 460px;
  top: 40%; left: 55%;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.65), transparent 70%);
}

/* Slow ambient drift — keeps things alive when cursor is still */
@keyframes orb-drift-1 { 0%,100% { translate: 0 0; } 50% { translate: 40px 30px; } }
@keyframes orb-drift-2 { 0%,100% { translate: 0 0; } 50% { translate: -50px -20px; } }
@keyframes orb-drift-3 { 0%,100% { translate: 0 0; } 50% { translate: 30px -40px; } }

.orb-1 { animation: orb-drift-1 14s ease-in-out infinite; }
.orb-2 { animation: orb-drift-2 18s ease-in-out infinite; }
.orb-3 { animation: orb-drift-3 16s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .orb { animation: none !important; transition: none !important; }
}

/* ── The card — Apple-style frosted glass ────────────────────────────────── */
.login-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  /* Subtle gradient tint over the heavy backdrop blur is what gives that
     liquid-glass feel — pure rgba doesn't refract enough. */
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.02) 100%),
    rgba(20, 28, 45, 0.55);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 22px;
  padding: 2.5rem 2.25rem 2rem;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04);
}

/* Shake animation on failed login */
.login-card.is-shaking {
  animation: login-shake 0.45s cubic-bezier(.36, .07, .19, .97);
}
@keyframes login-shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-8px); }
  40%, 60% { transform: translateX(8px); }
}

/* ── Brand block ─────────────────────────────────────────────────────────── */
.login-brand {
  text-align: center;
  margin-bottom: 2rem;
}
.login-logo {
  width: 6rem;
  height: 6rem;
  margin-bottom: 0.85rem;
  filter: drop-shadow(0 4px 12px rgba(59, 130, 246, 0.35));
}
.login-title {
  color: var(--signal-text-strong);
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.3rem;
  letter-spacing: -0.5px;
}
.login-subtitle {
  color: var(--signal-text-dim);
  font-size: 0.85rem;
  margin: 0;
}

/* ── Form ────────────────────────────────────────────────────────────────── */
.login-form { margin-top: 0.5rem; }

/* Glassy input — translucent so the card backdrop shows through */
.login-input {
  background-color: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: var(--signal-text-bright) !important;
  padding: 1rem 2.5rem !important;
  font-size: 0.95rem !important;
  height: auto !important;
  border-radius: 12px !important;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.login-input:focus {
  background-color: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(59, 130, 246, 0.55) !important;
  box-shadow:
    0 0 0 3px rgba(59, 130, 246, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}
.login-input::placeholder {
  color: rgba(203, 213, 225, 0.4);
  letter-spacing: 0;
}

/* Lock and eye icons — vertically centered on the taller input */
.login-form .control.has-icons-left .icon.is-left,
.login-form .control.has-icons-right .icon.is-right {
  height: 100% !important;
  top: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
}
.login-form .icon.is-left  { color: rgba(203, 213, 225, 0.45) !important; }
.login-form .icon.is-right { color: var(--signal-text-muted) !important; }
.login-eye {
  pointer-events: auto !important;
  cursor: pointer;
  transition: color 0.15s;
}
.login-eye:hover { color: var(--signal-text-dim) !important; }

/* Glassy primary button */
.login-button {
  margin-top: 1rem;
  padding: 1.05rem 1rem !important;
  height: auto !important;
  font-weight: 600 !important;
  letter-spacing: 0.2px;
  border-radius: 12px !important;
  background: linear-gradient(135deg, #4f8df8, #3b82f6) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: #fff !important;
  box-shadow:
    0 8px 20px rgba(59, 130, 246, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.05s, box-shadow 0.2s, filter 0.15s;
}
.login-button:hover {
  filter: brightness(1.08);
  box-shadow:
    0 10px 26px rgba(59, 130, 246, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.login-button:active { transform: translateY(1px); }

/* Two stacked input fields need a little air between them */
.login-form .field + .field { margin-top: 0.85rem; }

/* ── Forgot password link ────────────────────────────────────────────────── */
.login-forgot {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.82rem;
}
.login-forgot a {
  color: var(--signal-text-dim);
  text-decoration: none;
  transition: color 0.15s;
}
.login-forgot a:hover {
  color: var(--signal-text-bright);
}

/* ── Error line ──────────────────────────────────────────────────────────── */
.login-error {
  display: none;
  margin-top: 1rem;
  padding: 0.55rem 0.85rem;
  background: rgba(127, 29, 29, 0.35);
  border: 1px solid rgba(248, 113, 113, 0.4);
  border-radius: 8px;
  color: #fca5a5;
  font-size: 0.8rem;
  text-align: center;
}
.login-error.is-visible { display: block; }

.login-success {
  display: none;
  margin-top: 1rem;
  padding: 0.55rem 0.85rem;
  background: rgba(6, 78, 59, 0.35);
  border: 1px solid rgba(110, 231, 183, 0.4);
  border-radius: 8px;
  color: #6ee7b7;
  font-size: 0.8rem;
  text-align: center;
}
.login-success.is-visible { display: block; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.login-footer {
  margin-top: 2rem;
  color: var(--signal-text-muted);
  font-size: 0.72rem;
  text-align: center;
  letter-spacing: 0.2px;
}

/* ── Small-screen tweaks ─────────────────────────────────────────────────── */
@media (max-width: 500px) {
  .login-card { padding: 2rem 1.5rem 1.75rem; border-radius: 18px; }
  .login-logo { width: 48px; height: 48px; }
  .login-title { font-size: 1.5rem; }
  .orb { filter: blur(70px); opacity: 0.45; }
}
