/* ═══════════════════════════════════════════════════════════════════════
   LOGIN — Deep Cosmos Theme
   Self-contained overrides; does not affect other pages.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Scene ──────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #060B18;
  position: relative;
  overflow: hidden;
  padding: 24px;
}

/* kill the old radial from layout.css */
.login-page::before { display: none; }

/* ── Animated orbs ─────────────────────────────────────────────────── */
.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

.login-orb--1 {
  width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(30, 159, 255, .22) 0%, transparent 70%);
  top: -12%; right: -8%;
  animation: orb-drift-1 14s ease-in-out infinite, orb-appear .8s .2s ease-out forwards;
}
.login-orb--2 {
  width: 440px; height: 440px;
  background: radial-gradient(circle, rgba(6, 182, 212, .18) 0%, transparent 70%);
  bottom: -10%; left: -6%;
  animation: orb-drift-2 18s ease-in-out infinite, orb-appear .8s .4s ease-out forwards;
}
.login-orb--3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(139, 92, 246, .14) 0%, transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation: orb-drift-3 22s ease-in-out infinite, orb-appear .8s .6s ease-out forwards;
}

@keyframes orb-appear {
  to { opacity: 1; }
}
@keyframes orb-drift-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(-40px, 30px) scale(1.08); }
  66%      { transform: translate(20px, -20px) scale(.95); }
}
@keyframes orb-drift-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(35px, -25px) scale(.93); }
  66%      { transform: translate(-20px, 15px) scale(1.06); }
}
@keyframes orb-drift-3 {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50%      { transform: translate(-45%, -55%) scale(1.12); }
}

/* ── Subtle grid texture ───────────────────────────────────────────── */
.login-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(30, 159, 255, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 159, 255, .04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 20%, transparent 100%);
  pointer-events: none;
}

/* ── Card wrapper (centered column) ────────────────────────────────── */
.login-page > .login-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 2;
}

/* ── Logo ───────────────────────────────────────────────────────────── */
.login-wrap > img {
  height: 120px;
  margin-bottom: 32px;
  filter: drop-shadow(0 0 30px rgba(30, 159, 255, .25));
  animation: logo-enter .7s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes logo-enter {
  from { opacity: 0; transform: translateY(-18px) scale(.92); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Glass card ────────────────────────────────────────────────────── */
.login-card {
  width: 100%;
  background: rgba(255, 255, 255, .05);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 20px;
  padding: 44px 40px 40px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, .4),
    inset 0 1px 0 rgba(255, 255, 255, .06);
  animation: card-enter .8s .15s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes card-enter {
  from { opacity: 0; transform: translateY(24px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Card header ───────────────────────────────────────────────────── */
.login-logo {
  text-align: center;
  margin-bottom: 36px;
}

.login-logo h1 {
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -.03em;
  color: #F1F5F9;
  margin-bottom: 6px;
}

.login-logo p {
  font-size: .82rem;
  font-weight: 400;
  color: rgba(148, 163, 184, .8);
  letter-spacing: .03em;
  text-transform: uppercase;
}

/* ── Separator line ────────────────────────────────────────────────── */
.login-logo::after {
  content: "";
  display: block;
  width: 40px;
  height: 2px;
  margin: 20px auto 0;
  background: linear-gradient(90deg, transparent, var(--c-accent), transparent);
  border-radius: 2px;
}

/* ── Form groups with stagger ──────────────────────────────────────── */
.login-card .form-group {
  margin-bottom: 20px;
  animation: field-enter .6s cubic-bezier(.22, 1, .36, 1) both;
}
.login-card .form-group:nth-child(1) { animation-delay: .35s; }
.login-card .form-group:nth-child(2) { animation-delay: .45s; }

@keyframes field-enter {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Labels ────────────────────────────────────────────────────────── */
.login-card label {
  font-size: .76rem;
  font-weight: 500;
  color: rgba(148, 163, 184, .7);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* ── Input wrappers (icon support via sibling SVG) ─────────────────── */
.login-input-wrap {
  position: relative;
}

.login-input-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: rgba(148, 163, 184, .45);
  pointer-events: none;
  transition: color .25s;
}

.login-input-wrap input {
  width: 100%;
  padding: 13px 16px 13px 44px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  font-size: .9rem;
  color: #F1F5F9;
  transition: border-color .25s, box-shadow .25s, background .25s;
}

.login-input-wrap input::placeholder {
  color: rgba(148, 163, 184, .35);
}

.login-input-wrap input:focus {
  outline: none;
  background: rgba(255, 255, 255, .07);
  border-color: rgba(30, 159, 255, .5);
  box-shadow: 0 0 0 3px rgba(30, 159, 255, .1), 0 0 20px rgba(30, 159, 255, .06);
}

.login-input-wrap:focus-within svg {
  color: var(--c-accent);
}

/* ── Error message ─────────────────────────────────────────────────── */
#login-error {
  font-size: .82rem;
  color: #F87171;
  text-align: center;
  min-height: 22px;
  margin-bottom: 6px;
  animation: field-enter .5s .55s cubic-bezier(.22, 1, .36, 1) both;
}

/* ── Submit button ─────────────────────────────────────────────────── */
#login-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--c-accent) 0%, #0D8CE0 100%);
  color: #fff;
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .01em;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform .2s, box-shadow .3s, opacity .2s;
  animation: field-enter .6s .6s cubic-bezier(.22, 1, .36, 1) both;
}

#login-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.15) 0%, transparent 50%);
  opacity: 0;
  transition: opacity .3s;
}

#login-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(30, 159, 255, .35), 0 2px 8px rgba(30, 159, 255, .2);
}

#login-btn:hover:not(:disabled)::before {
  opacity: 1;
}

#login-btn:active:not(:disabled) {
  transform: translateY(0);
}

#login-btn:disabled {
  opacity: .7;
  cursor: not-allowed;
  transform: none;
}

/* Shimmer animation while logging in */
#login-btn.is-loading {
  pointer-events: none;
}
#login-btn.is-loading::after {
  content: "";
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.15), transparent);
  animation: btn-shimmer 1.4s ease-in-out infinite;
}
@keyframes btn-shimmer {
  to { left: 100%; }
}

/* ── Forgot password link ──────────────────────────────────────────── */
.forgot-link {
  font-size: .82rem;
  color: rgba(148, 163, 184, .7);
  text-decoration: none;
  transition: color .25s;
}
.forgot-link:hover {
  color: var(--c-accent);
  text-decoration: underline;
}

/* ── Forgot form message ──────────────────────────────────────────── */
#forgot-msg {
  font-size: .82rem;
  text-align: center;
  min-height: 22px;
  margin-bottom: 6px;
}
#forgot-msg.success { color: #34D399; }
#forgot-msg.error   { color: #F87171; }

/* ── Forgot/reset buttons inherit login-btn style ─────────────────── */
#forgot-btn,
#reset-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--c-accent) 0%, #0D8CE0 100%);
  color: #fff;
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .01em;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform .2s, box-shadow .3s, opacity .2s;
}
#forgot-btn:hover:not(:disabled),
#reset-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(30, 159, 255, .35), 0 2px 8px rgba(30, 159, 255, .2);
}
#forgot-btn:disabled,
#reset-btn:disabled {
  opacity: .7;
  cursor: not-allowed;
  transform: none;
}

/* ── Footer text ───────────────────────────────────────────────────── */
.login-footer {
  text-align: center;
  margin-top: 24px;
  font-size: .74rem;
  color: rgba(148, 163, 184, .35);
  letter-spacing: .02em;
  animation: field-enter .6s .75s cubic-bezier(.22, 1, .36, 1) both;
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .login-card {
    padding: 32px 24px 28px;
    border-radius: 16px;
  }
  .login-wrap > img {
    height: 90px;
    margin-bottom: 24px;
  }
  .login-logo h1 { font-size: 1.35rem; }
  .login-orb--1 { width: 320px; height: 320px; }
  .login-orb--2 { width: 280px; height: 280px; }
  .login-orb--3 { width: 200px; height: 200px; }
}
