/* ============================================
   LearnX — Global Design System
   Palette: Indigo Ink + Volcanic Glass hybrid
   Fonts: Clash Display + Plus Jakarta Sans
============================================ */

:root {
  --primary: #7C3AED;
  --primary-light: #A78BFA;
  --primary-dark: #5B21B6;
  --accent: #F59E0B;
  --accent-2: #10B981;
  --bg-dark: #0D0B1A;
  --bg-card: #13102A;
  --bg-card-2: #1A1635;
  --border: rgba(124, 58, 237, 0.2);
  --border-light: rgba(255,255,255,0.08);
  --text-primary: #F0EEFF;
  --text-secondary: #9B8EC4;
  --text-muted: #5C5480;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #3B82F6;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 40px rgba(124,58,237,0.25);
  --font-display: 'Clash Display', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

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

/* ── Background ── */
.bg-mesh {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(124,58,237,0.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(16,185,129,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 60% 30%, rgba(245,158,11,0.06) 0%, transparent 50%);
  pointer-events: none;
}

.bg-orb {
  position: fixed; border-radius: 50%; filter: blur(80px);
  pointer-events: none; z-index: 0; animation: orbFloat 8s ease-in-out infinite;
}
.orb-1 { width: 500px; height: 500px; background: rgba(124,58,237,0.12); top: -150px; left: -100px; animation-delay: 0s; }
.orb-2 { width: 400px; height: 400px; background: rgba(16,185,129,0.08); bottom: -100px; right: -100px; animation-delay: 3s; }
.orb-3 { width: 300px; height: 300px; background: rgba(245,158,11,0.07); top: 40%; left: 40%; animation-delay: 6s; }

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -20px) scale(1.05); }
  66% { transform: translate(-15px, 15px) scale(0.95); }
}

/* ── Auth Layout ── */
.auth-wrapper {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* ── Auth Left ── */
.auth-left {
  padding: 48px;
  display: flex; flex-direction: column;
  justify-content: space-between;
  position: relative; overflow: hidden;
}

.brand {
  display: flex; align-items: center; gap: 12px;
}
.brand-name {
  font-family: var(--font-display);
  font-size: 24px; font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.hero-content { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 40px 0; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(124,58,237,0.15);
  border: 1px solid rgba(124,58,237,0.3);
  color: var(--primary-light);
  padding: 8px 16px; border-radius: 100px;
  font-size: 13px; font-weight: 500;
  width: fit-content; margin-bottom: 24px;
  animation: fadeInUp 0.6s ease both;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(42px, 5vw, 64px);
  font-weight: 700; line-height: 1.05;
  letter-spacing: -2px;
  margin-bottom: 20px;
  animation: fadeInUp 0.6s 0.1s ease both;
}

.gradient-text {
  background: linear-gradient(135deg, #A78BFA 0%, #7C3AED 40%, #10B981 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 17px; color: var(--text-secondary); line-height: 1.7;
  max-width: 440px; margin-bottom: 32px;
  animation: fadeInUp 0.6s 0.2s ease both;
}

.feature-pills {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-bottom: 40px;
  animation: fadeInUp 0.6s 0.3s ease both;
}

.pill {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-light);
  padding: 8px 14px; border-radius: 100px;
  font-size: 13px; color: var(--text-secondary);
  transition: var(--transition);
}
.pill:hover { background: rgba(124,58,237,0.15); border-color: var(--border); color: var(--primary-light); }
.pill-icon { font-size: 14px; }

.stats-row {
  display: flex; align-items: center; gap: 24px;
  animation: fadeInUp 0.6s 0.4s ease both;
}
.stat-item { display: flex; flex-direction: column; gap: 2px; }
.stat-num { font-family: var(--font-display); font-size: 28px; font-weight: 700; color: var(--text-primary); }
.stat-label { font-size: 13px; color: var(--text-muted); }
.stat-divider { width: 1px; height: 40px; background: var(--border-light); }

/* Floating Cards */
.float-card {
  position: absolute;
  background: rgba(26,22,53,0.9);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow);
  animation: floatCard 4s ease-in-out infinite;
}
.card-a { bottom: 120px; left: 48px; min-width: 220px; animation-delay: 0s; }
.card-b { bottom: 60px; right: 20px; animation-delay: 2s; }

@keyframes floatCard {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.fc-avatar {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: white;
}
.fc-emoji { font-size: 24px; }
.fc-info { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.fc-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.fc-sub { font-size: 11px; color: var(--text-muted); }
.fc-bar { height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; }
.fc-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-light)); border-radius: 2px; }
.fc-pct { font-size: 13px; font-weight: 700; color: var(--primary-light); }

/* ── Auth Right ── */
.auth-right {
  display: flex; align-items: center; justify-content: center;
  padding: 48px 40px;
  background: rgba(13,11,26,0.5);
  border-left: 1px solid var(--border-light);
}

.auth-card {
  width: 100%; max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 24px;
  padding: 40px;
  box-shadow: var(--shadow), var(--shadow-glow);
  animation: fadeInUp 0.5s ease both;
}

/* Tabs */
.auth-tabs {
  display: flex; gap: 4px;
  background: rgba(255,255,255,0.05);
  border-radius: 12px; padding: 4px;
  margin-bottom: 32px;
}
.tab-btn {
  flex: 1; padding: 10px;
  background: transparent; border: none;
  border-radius: 10px; cursor: pointer;
  font-family: var(--font-body); font-size: 14px; font-weight: 600;
  color: var(--text-muted); transition: var(--transition);
}
.tab-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(124,58,237,0.4);
}

/* Form */
.form-header { margin-bottom: 24px; }
.form-header h2 {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 700;
  letter-spacing: -0.5px; margin-bottom: 6px;
}
.form-header p { font-size: 14px; color: var(--text-secondary); }

.demo-accounts { margin-bottom: 20px; }
.demo-label { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.demo-btns { display: flex; gap: 8px; }
.demo-btn {
  flex: 1; padding: 8px 10px;
  background: rgba(124,58,237,0.1);
  border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer;
  font-family: var(--font-body); font-size: 12px; font-weight: 500;
  color: var(--primary-light); transition: var(--transition);
}
.demo-btn:hover { background: rgba(124,58,237,0.2); transform: translateY(-1px); }

.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 8px;
}

.input-wrap {
  position: relative; display: flex; align-items: center;
}
.input-wrap input {
  width: 100%; padding: 12px 16px 12px 44px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body); font-size: 14px;
  transition: var(--transition); outline: none;
}
.input-wrap input:focus {
  border-color: var(--primary);
  background: rgba(124,58,237,0.08);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}
.input-wrap input::placeholder { color: var(--text-muted); }
.input-icon {
  position: absolute; left: 14px;
  color: var(--text-muted); pointer-events: none;
}
.toggle-pw {
  position: absolute; right: 12px;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 4px;
  transition: var(--transition);
}
.toggle-pw:hover { color: var(--primary-light); }

.form-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-2 .input-wrap input { padding-left: 16px; }

.checkbox-label {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; font-size: 13px; color: var(--text-secondary);
  user-select: none;
}
.checkbox-label input[type="checkbox"] { display: none; }
.checkmark {
  width: 18px; height: 18px; flex-shrink: 0;
  border: 2px solid var(--border-light);
  border-radius: 5px; transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.checkbox-label input:checked + .checkmark {
  background: var(--primary); border-color: var(--primary);
}
.checkbox-label input:checked + .checkmark::after {
  content: '✓'; color: white; font-size: 11px; font-weight: 700;
}

.forgot-link {
  font-size: 13px; color: var(--primary-light);
  text-decoration: none; transition: var(--transition);
}
.forgot-link:hover { color: var(--primary); }

.btn-primary {
  width: 100%; padding: 14px 24px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: none; border-radius: var(--radius-sm);
  color: white; font-family: var(--font-body);
  font-size: 15px; font-weight: 700;
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 20px rgba(124,58,237,0.4);
  margin-bottom: 20px;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(124,58,237,0.5);
}
.btn-primary:active { transform: translateY(0); }

.divider {
  text-align: center; position: relative; margin-bottom: 20px;
}
.divider::before {
  content: ''; position: absolute; top: 50%; left: 0; right: 0;
  height: 1px; background: var(--border-light);
}
.divider span {
  position: relative; background: var(--bg-card);
  padding: 0 12px; font-size: 12px; color: var(--text-muted);
}

.social-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.social-btn {
  padding: 11px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-body); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.social-btn:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); }

/* Role Selector */
.role-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-option { cursor: pointer; }
.role-option input { display: none; }
.role-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px; border-radius: var(--radius-sm);
  border: 2px solid var(--border-light);
  background: rgba(255,255,255,0.03);
  transition: var(--transition); font-size: 13px; font-weight: 600;
  color: var(--text-secondary);
}
.role-card.active {
  border-color: var(--primary);
  background: rgba(124,58,237,0.12);
  color: var(--primary-light);
}
.role-emoji { font-size: 24px; }

/* Password Strength */
.strength-bar {
  height: 4px; background: rgba(255,255,255,0.1);
  border-radius: 2px; margin-top: 8px; overflow: hidden;
}
.strength-fill {
  height: 100%; width: 0; border-radius: 2px;
  transition: width 0.3s ease, background 0.3s ease;
}
.strength-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; display: block; }

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

/* Toast */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  padding: 14px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  background: var(--bg-card-2); border: 1px solid var(--border-light);
  color: var(--text-primary); box-shadow: var(--shadow);
  transform: translateY(100px); opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: var(--success); color: var(--success); }
.toast.error { border-color: var(--danger); color: var(--danger); }

/* Utilities */
.hidden { display: none !important; }

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

/* ── Responsive ── */
@media (max-width: 900px) {
  .auth-wrapper { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .auth-right { padding: 24px; }
}