/* ── Auth Pages (login.html) ───────────────────────────────── */
:root {
  --brand:       #6C63FF;
  --brand-dark:  #4B44CC;
  --brand-glow:  rgba(108,99,255,.35);
  --surface:     #12121e;
  --card:        #1a1a2e;
  --card2:       #22223a;
  --border:      rgba(255,255,255,.08);
  --text:        #f0f0f8;
  --muted:       #8888aa;
  --error:       #ff5e7a;
  --success:     #10B981;
  --warning:     #F59E0B;
  --radius:      14px;
  --shadow:      0 24px 60px rgba(0,0,0,.55);
}

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

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--surface);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  position: relative;
}

/* ── Animated background */
.auth-bg {
  position: fixed; inset: 0; z-index: 0;
  background: radial-gradient(ellipse 80% 70% at 50% -10%, rgba(108,99,255,.18) 0%, transparent 60%),
              radial-gradient(ellipse 60% 60% at 90% 90%, rgba(16,185,129,.10) 0%, transparent 55%),
              var(--surface);
}
.auth-bg::after {
  content: '';
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle, rgba(108,99,255,.06) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* ── Card */
.auth-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 440px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 44px 40px;
  box-shadow: var(--shadow), 0 0 0 1px rgba(108,99,255,.06) inset;
  animation: fadeUp .5s ease both;
}

@keyframes fadeUp {
  from { opacity:0; transform:translateY(24px); }
  to   { opacity:1; transform:translateY(0);    }
}

/* ── Logo */
.auth-logo {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 32px;
}
.auth-logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--brand), #9B8AFF);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff;
}
.auth-logo-text { font-size: 20px; font-weight: 700; letter-spacing: -.3px; }
.auth-logo-text span { color: var(--brand); }

/* ── Headings */
.auth-title {
  font-size: 26px; font-weight: 700; letter-spacing: -.4px;
  margin-bottom: 6px;
}
.auth-sub {
  font-size: 14px; color: var(--muted);
  margin-bottom: 28px; line-height: 1.5;
}

/* ── Form */
.auth-form { display: flex; flex-direction: column; gap: 16px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; font-weight: 500; color: var(--muted); }

.form-input {
  background: var(--card2);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px; color: var(--text);
  transition: border-color .2s, box-shadow .2s;
  outline: none; width: 100%;
  font-family: inherit;
}
.form-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}
.form-input::placeholder { color: var(--muted); }

/* password wrapper with show/hide toggle */
.pw-wrap { position: relative; }
.pw-wrap .form-input { padding-right: 42px; }
.pw-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 15px; padding: 4px;
  transition: color .2s;
}
.pw-toggle:hover { color: var(--text); }

/* ── Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--brand), #9B8AFF);
  color: #fff; border: none; border-radius: 10px;
  padding: 13px 20px; font-size: 14px; font-weight: 600;
  cursor: pointer; width: 100%; letter-spacing: .2px;
  transition: opacity .2s, transform .15s, box-shadow .2s;
  box-shadow: 0 4px 20px var(--brand-glow);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary:hover  { opacity: .92; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-ghost {
  background: transparent; color: var(--muted);
  border: none; font-size: 13px; cursor: pointer;
  padding: 4px 0; transition: color .2s;
  font-family: inherit;
}
.btn-ghost:hover { color: var(--text); }

/* ── Alert banners */
.auth-alert {
  padding: 11px 14px; border-radius: 10px;
  font-size: 13px; line-height: 1.45; display: none;
}
.auth-alert.show { display: block; }
.auth-alert.error   { background: rgba(255,94,122,.12); color: var(--error);   border: 1px solid rgba(255,94,122,.25); }
.auth-alert.success { background: rgba(16,185,129,.12); color: var(--success); border: 1px solid rgba(16,185,129,.25); }
.auth-alert.info    { background: rgba(108,99,255,.12); color: #a8a2ff;        border: 1px solid rgba(108,99,255,.25); }

/* ── Footer links */
.auth-footer {
  margin-top: 24px; text-align: center;
  font-size: 13px; color: var(--muted);
}
.auth-footer a, .auth-link {
  color: var(--brand); text-decoration: none; font-weight: 500;
  background: none; border: none; cursor: pointer; font-size: 13px;
  font-family: inherit; padding: 0;
  transition: color .2s;
}
.auth-footer a:hover, .auth-link:hover { color: #a8a2ff; }

/* ── Divider */
.auth-divider {
  display: flex; align-items: center; gap: 10px;
  color: var(--muted); font-size: 12px; margin: 4px 0;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── Panels (step switching) */
.auth-panel { display: none; }
.auth-panel.active { display: block; }

/* ── Password strength */
.pw-strength { margin-top: 6px; }
.pw-strength-bar {
  height: 4px; border-radius: 2px; background: var(--card2);
  overflow: hidden; margin-bottom: 4px;
}
.pw-strength-fill {
  height: 100%; border-radius: 2px;
  transition: width .3s, background .3s;
  width: 0;
}
.pw-strength-label { font-size: 11px; color: var(--muted); }

/* ── Password requirements */
.pw-reqs { list-style: none; margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.pw-req  { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.pw-req::before { content: '○'; font-size: 10px; }
.pw-req.met { color: var(--success); }
.pw-req.met::before { content: '●'; }

/* ── Spinner */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff; border-radius: 50%;
  animation: spin .6s linear infinite; display: none;
}
.loading .spinner { display: block; }
.loading .btn-text { display: none; }

/* ── Role badge */
.role-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
}
.role-admin    { background: rgba(108,99,255,.2); color: #a8a2ff; }
.role-pm       { background: rgba(16,185,129,.2); color: #34d399; }
.role-backend  { background: rgba(59,130,246,.2); color: #60a5fa; }
.role-frontend { background: rgba(236,72,153,.2); color: #f472b6; }

/* ── Responsive */
@media (max-width: 480px) {
  .auth-card { margin: 16px; padding: 32px 24px; border-radius: 16px; }
  .auth-title { font-size: 22px; }
}
