:root {
  --auth-primary: #9333ea;
  --auth-primary-dark: #6b21a8;
  --auth-primary-soft: rgba(147, 51, 234, 0.14);
  --auth-bg: #f8fafc;
  --auth-card: #ffffff;
  --auth-border: #e2e8f0;
  --auth-text: #0f172a;
  --auth-muted: #64748b;
}

.auth-theme-admin {
  --auth-primary: #2563eb;
  --auth-primary-dark: #1d4ed8;
  --auth-primary-soft: rgba(37, 99, 235, 0.14);
}

* { box-sizing: border-box; }

body.auth-page {
  margin: 0;
  min-height: 100vh;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  background: var(--auth-bg);
  color: var(--auth-text);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}

.auth-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, var(--auth-primary-dark) 0%, var(--auth-primary) 45%, #3b82f6 100%);
  color: #fff;
  padding: 3rem;
  display: flex;
  align-items: center;
}

.auth-hero-inner { position: relative; z-index: 2; max-width: 520px; }

.auth-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.auth-hero-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 1rem;
}

.auth-hero-text {
  font-size: 1rem;
  opacity: 0.92;
  line-height: 1.6;
  margin-bottom: 1.75rem;
}

.auth-hero-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
}

.auth-hero-list li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
  font-weight: 500;
}

.auth-hero-list i { color: #bbf7d0; }

.auth-hero-stats {
  display: flex;
  gap: 2rem;
}

.auth-hero-stats strong {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
}

.auth-hero-stats span {
  font-size: 0.78rem;
  opacity: 0.8;
}

.auth-hero-shapes span {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
}

.auth-hero-shapes span:nth-child(1) { width: 320px; height: 320px; top: -80px; right: -60px; }
.auth-hero-shapes span:nth-child(2) { width: 180px; height: 180px; bottom: 10%; left: -40px; }
.auth-hero-shapes span:nth-child(3) { width: 120px; height: 120px; bottom: 25%; right: 15%; }

.auth-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.auth-card {
  width: min(440px, 100%);
  background: var(--auth-card);
  border: 1px solid var(--auth-border);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  animation: authFadeUp 0.5s ease;
}

@keyframes authFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-card-head {
  text-align: center;
  padding: 2rem 2rem 0.5rem;
}

.auth-logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--auth-primary), var(--auth-primary-dark));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  margin: 0 auto 1rem;
  box-shadow: 0 8px 24px var(--auth-primary-soft);
}

.auth-card-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0 0 0.25rem;
  letter-spacing: -0.02em;
}

.auth-card-sub {
  color: var(--auth-muted);
  font-size: 0.9rem;
  margin: 0;
}

.auth-card-body { padding: 1.25rem 2rem 2rem; }

.auth-field {
  margin-bottom: 1.1rem;
}

.auth-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--auth-text);
}

.auth-input-wrap {
  position: relative;
}

.auth-input-wrap i {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--auth-muted);
  pointer-events: none;
}

.auth-input-wrap .form-control {
  padding-left: 2.5rem;
  border-radius: 12px;
  border: 1px solid var(--auth-border);
  min-height: 46px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-input-wrap .form-control:focus {
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 4px var(--auth-primary-soft);
}

.auth-toggle-pw {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--auth-muted);
  padding: 0.25rem;
}

.auth-btn {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--auth-primary), var(--auth-primary-dark));
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.auth-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px var(--auth-primary-soft);
  color: #fff;
}

.auth-btn:disabled { opacity: 0.7; cursor: wait; }

.auth-btn .spinner-border { width: 1.1rem; height: 1.1rem; border-width: 2px; }

.auth-alert {
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.auth-alert.error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.auth-alert.success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }

.auth-footer-link {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.9rem;
  color: var(--auth-muted);
}

.auth-footer-link a {
  color: var(--auth-primary);
  font-weight: 600;
  text-decoration: none;
}

.auth-copy {
  margin-top: 1.5rem;
  font-size: 0.78rem;
  color: var(--auth-muted);
}

.auth-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--auth-muted);
  margin-bottom: 1.25rem;
}

.auth-2fa-field {
  animation: authFadeUp 0.35s ease;
  border: 1px solid #bfdbfe;
  background: linear-gradient(135deg, #eff6ff, #f8fafc);
  border-radius: 12px;
  padding: 0.85rem;
}

@media (max-width: 991.98px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-main { padding-top: 3rem; }
}
