:root {
  --accent: #6C63FF;
  --accent-2: #FF6584;
  --accent-3: #43D8C9;
  --gold: #F5A623;
  --bg-dark: #080B14;
  --bg-card: rgba(15, 20, 35, 0.85);
  --text-primary: #F0F2FF;
  --text-muted: #8892AA;
  --border: rgba(108, 99, 255, 0.2);
  --glass: rgba(255,255,255,0.04);
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── Background ─── */
.auth-root {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  position: relative;
}

.bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: float 8s ease-in-out infinite;
}
.orb-1 { width: 500px; height: 500px; background: radial-gradient(circle, #6C63FF, transparent); top: -100px; left: -100px; animation-delay: 0s; }
.orb-2 { width: 400px; height: 400px; background: radial-gradient(circle, #43D8C9, transparent); bottom: -50px; left: 30%; animation-delay: -3s; }
.orb-3 { width: 350px; height: 350px; background: radial-gradient(circle, #FF6584, transparent); top: 30%; right: -80px; animation-delay: -5s; }

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-30px) scale(1.05); }
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(108,99,255,0.06) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(108,99,255,0.06) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* ─── Brand Panel ─── */
.brand-panel {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 50px;
  border-right: 1px solid var(--border);
}

.brand-content {
  max-width: 460px;
}

.logo-mark {
  width: 56px; height: 56px;
  color: var(--accent);
  margin-bottom: 24px;
  animation: pulse-logo 3s ease-in-out infinite;
}
@keyframes pulse-logo {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(108,99,255,0.5)); }
  50% { filter: drop-shadow(0 0 20px rgba(108,99,255,0.9)); }
}

.brand-name {
  font-family: 'Syne', sans-serif;
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -2px;
  background: linear-gradient(135deg, #F0F2FF 0%, var(--accent) 50%, var(--accent-3) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 16px;
}

.brand-tagline {
  font-size: 1.05rem;
  color: var(--text-muted);
  font-weight: 300;
  line-height: 1.6;
  margin-bottom: 40px;
  max-width: 340px;
}

.feature-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 48px;
}

.pill {
  padding: 7px 16px;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--text-muted);
  backdrop-filter: blur(12px);
  transition: all 0.3s ease;
  cursor: default;
}
.pill:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  background: rgba(108,99,255,0.1);
}

.stats-row {
  display: flex;
  align-items: center;
  gap: 24px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-num {
  font-family: 'Syne', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-3);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-div {
  width: 1px;
  height: 40px;
  background: var(--border);
}

/* ─── Auth Panel ─── */
.auth-panel {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 50px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(108,99,255,0.1) inset;
}

/* ─── Tab Switcher ─── */
.tab-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: rgba(255,255,255,0.04);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 36px;
  position: relative;
}

.tab-indicator {
  position: absolute;
  top: 4px; bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  background: linear-gradient(135deg, var(--accent), #8B84FF);
  border-radius: 9px;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 0;
}

.tab-btn {
  position: relative;
  z-index: 1;
  border: none;
  background: none;
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 10px;
  border-radius: 9px;
  cursor: pointer;
  transition: color 0.3s ease;
}

.tab-btn.active { color: white; }

/* ─── Form ─── */
.form-header {
  margin-bottom: 28px;
}

.form-header h2 {
  font-family: 'Syne', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.form-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.85rem;
  margin-bottom: 20px;
  border-left: 3px solid;
}
.alert.success { background: rgba(67,216,201,0.1); border-color: var(--accent-3); color: var(--accent-3); }
.alert.error { background: rgba(255,101,132,0.1); border-color: var(--accent-2); color: var(--accent-2); }

.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.input-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  width: 16px; height: 16px;
  color: var(--text-muted);
  pointer-events: none;
  flex-shrink: 0;
}

.input-wrap input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px 12px 42px;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.3s ease;
}

.input-wrap input:not(:has(~ .input-icon)):not(:has(.input-icon ~ &)) { padding-left: 14px; }

.input-wrap:not(:has(.input-icon)) input { padding-left: 14px; }

.input-wrap input:focus {
  border-color: var(--accent);
  background: rgba(108,99,255,0.08);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.15);
}

.input-wrap input::placeholder { color: rgba(136,146,170,0.5); }

.toggle-pw {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  display: flex;
}
.toggle-pw svg { width: 16px; height: 16px; }

.strength-bar {
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  margin-top: 6px;
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  transition: all 0.4s ease;
}

.strength-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.form-extras {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.checkbox-label input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.terms {
  margin-bottom: 20px;
}
.terms a { color: var(--accent); text-decoration: none; }

.forgot-link {
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}
.forgot-link:hover { opacity: 0.7; }

.submit-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--accent) 0%, #8B84FF 100%);
  border: none;
  border-radius: 12px;
  color: white;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.submit-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.15) 100%);
  opacity: 0;
  transition: opacity 0.3s;
}
.submit-btn:hover::before { opacity: 1; }
.submit-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(108,99,255,0.4); }
.submit-btn:active { transform: translateY(0); }

.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.demo-creds {
  text-align: center;
}

.demo-creds p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.cred-badges {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.cred-badges span {
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.78rem;
  color: var(--accent);
  cursor: pointer;
  transition: all 0.2s;
}
.cred-badges span:hover {
  background: rgba(108,99,255,0.15);
  border-color: var(--accent);
}

.hidden { display: none !important; }

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .auth-root { grid-template-columns: 1fr; }
  .brand-panel { display: none; }
  .auth-panel { padding: 24px 20px; align-items: flex-start; padding-top: 60px; }
  .auth-card { padding: 28px 24px; }
}

@media (max-width: 400px) {
  .input-row { grid-template-columns: 1fr; }
  .auth-card { padding: 24px 18px; }
}
