/* ════════════════════════════════════════════════════════
   StudyTrack Auth — Shared Styles
   Split layout: left brand panel | right form panel
════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700;800;900&family=DM+Sans:ital,wght@0,400;0,500;0,600;1,400&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #080812;
  --bg2:       #0e0e1a;
  --bg3:       #14142a;
  --card:      #111120;
  --border:    rgba(255,255,255,.07);
  --border2:   rgba(255,255,255,.12);
  --ink:       #f0f0ff;
  --ink2:      #a0a0c8;
  --ink3:      #5a5a80;
  --accent:    #6366f1;
  --accent2:   #8b5cf6;
  --accent3:   #06b6d4;
  --glow:      rgba(99,102,241,.3);
  --glow2:     rgba(139,92,246,.2);
  --success:   #10b981;
  --danger:    #ef4444;
  --warn:      #f59e0b;
}

html, body { height: 100%; overflow: hidden; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  height: 100vh;
  overflow: hidden;
}

a { text-decoration: none; color: inherit; }

/* ── Split layout ─────────────────────────────────── */
.auth-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ── LEFT PANEL ───────────────────────────────────── */
.auth-left {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 52px;
  overflow: hidden;
  background: var(--bg2);
  border-right: 1px solid var(--border);
}

/* animated gradient blobs */
.auth-left::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,.18) 0%, transparent 65%);
  top: -150px; left: -150px;
  animation: blobFloat 8s ease-in-out infinite;
  pointer-events: none;
}
.auth-left::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(6,182,212,.12) 0%, transparent 65%);
  bottom: -80px; right: -80px;
  animation: blobFloat 10s ease-in-out infinite reverse;
  pointer-events: none;
}
@keyframes blobFloat {
  0%,100% { transform: translate(0,0) scale(1); }
  33%      { transform: translate(30px,-20px) scale(1.05); }
  66%      { transform: translate(-15px,25px) scale(.97); }
}

/* grid dots texture */
.auth-left-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(99,102,241,.3) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: .18;
  pointer-events: none;
}

/* left content */
.auth-left-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 40px;
}

/* logo */
.auth-logo {
  display: flex;
  align-items: center;
  gap: 13px;
}
.auth-logo-img {
  width: 44px; height: 44px;
  border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 8px 24px rgba(99,102,241,.25);
}
.auth-logo-name {
  font-family: 'Sora', sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.4px;
  background: linear-gradient(135deg, #e0e7ff, #a5b4fc, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth-logo-tag {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink3);
  letter-spacing: .8px;
  text-transform: uppercase;
  margin-top: -2px;
}

/* hero area */
.auth-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-hero-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent3);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.auth-hero-label::before {
  content: '';
  display: inline-block;
  width: 20px; height: 2px;
  background: var(--accent3);
  border-radius: 1px;
}
.auth-hero-title {
  font-family: 'Sora', sans-serif;
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -.5px;
  color: var(--ink);
  margin-bottom: 18px;
}
.auth-hero-title span {
  background: linear-gradient(135deg, var(--accent), var(--accent2), var(--accent3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth-hero-sub {
  font-size: 14px;
  color: var(--ink3);
  line-height: 1.7;
  max-width: 340px;
  margin-bottom: 36px;
}

/* feature pills */
.auth-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--ink2);
}
.auth-feature-icon {
  width: 32px; height: 32px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

/* testimonial / quote card */
.auth-quote {
  position: relative;
  z-index: 2;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border2);
  border-radius: 16px;
  padding: 20px 22px;
  margin-top: auto;
}
.auth-quote-text {
  font-size: 13px;
  color: var(--ink2);
  line-height: 1.6;
  font-style: italic;
  margin-bottom: 12px;
}
.auth-quote-author {
  display: flex;
  align-items: center;
  gap: 10px;
}
.auth-quote-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.auth-quote-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink2);
}
.auth-quote-role {
  font-size: 11px;
  color: var(--ink3);
}

/* ── RIGHT PANEL ──────────────────────────────────── */
.auth-right {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 40px;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(99,102,241,.3) transparent;
}
.auth-right::-webkit-scrollbar { width: 5px; }
.auth-right::-webkit-scrollbar-track { background: transparent; }
.auth-right::-webkit-scrollbar-thumb { background: rgba(99,102,241,.3); border-radius: 99px; }

/* vertically center form when it fits, scroll when it doesn't */
.auth-right::before {
  content: '';
  min-height: calc((100% - 700px) / 2);
  display: block;
}
.auth-form-wrap {
  width: 100%;
  max-width: 420px;
}

/* form heading */
.auth-form-title {
  font-family: 'Sora', sans-serif;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.4px;
  color: var(--ink);
  margin-bottom: 6px;
}
.auth-form-sub {
  font-size: 14px;
  color: var(--ink3);
  margin-bottom: 32px;
  line-height: 1.5;
}

/* fields */
.f-group { margin-bottom: 18px; }
.f-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink2);
  margin-bottom: 7px;
  letter-spacing: .3px;
}
.f-input-wrap { position: relative; }
.f-input {
  width: 100%;
  padding: 12px 14px 12px 44px;
  background: var(--bg3);
  border: 1.5px solid var(--border2);
  border-radius: 12px;
  color: var(--ink);
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.f-input:focus {
  border-color: var(--accent);
  background: rgba(99,102,241,.05);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
.f-input::placeholder { color: var(--ink3); }
.f-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  pointer-events: none;
  opacity: .5;
  line-height: 1;
}
.f-eye {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  cursor: pointer; font-size: 15px;
  opacity: .4; transition: opacity .2s; padding: 4px;
  color: var(--ink2);
}
.f-eye:hover { opacity: .9; }
.f-input.no-icon { padding-left: 14px; }

/* helper / error text */
.f-help {
  font-size: 11px;
  color: var(--ink3);
  margin-top: 5px;
}
.f-error {
  font-size: 11px;
  color: #fca5a5;
  margin-top: 5px;
  display: none;
}

/* password strength bar */
.pw-bar-wrap {
  margin-top: 8px;
  height: 3px;
  background: var(--border2);
  border-radius: 99px;
  overflow: hidden;
}
.pw-bar {
  height: 100%;
  border-radius: 99px;
  width: 0;
  transition: width .3s, background .3s;
}
.pw-hint { font-size: 11px; color: var(--ink3); margin-top: 5px; }

/* checkbox */
.f-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink3);
  line-height: 1.55;
  margin-bottom: 20px;
  margin-top: 6px;
}
.f-check input {
  margin-top: 3px;
  width: 15px; height: 15px;
  accent-color: var(--accent);
  flex-shrink: 0; cursor: pointer;
  border-radius: 4px;
}
.f-check a { color: var(--accent2); font-weight: 600; }

/* forgot link */
.f-forgot {
  text-align: right;
  margin-top: -10px;
  margin-bottom: 22px;
}
.f-forgot a {
  font-size: 12px;
  color: var(--accent2);
  font-weight: 600;
  transition: color .2s;
}
.f-forgot a:hover { color: var(--ink); }

/* primary button */
.btn-auth {
  width: 100%;
  padding: 13px 20px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, opacity .2s;
  box-shadow: 0 6px 24px var(--glow), 0 2px 8px rgba(0,0,0,.3);
  letter-spacing: .2px;
  position: relative;
  overflow: hidden;
}
.btn-auth::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.15), transparent 70%);
  transform: translateX(-100%);
  transition: transform .4s;
}
.btn-auth:hover { transform: translateY(-2px); box-shadow: 0 10px 32px var(--glow); }
.btn-auth:hover::after { transform: translateX(100%); }
.btn-auth:active { transform: translateY(0); }
.btn-auth:disabled { opacity: .6; transform: none; cursor: not-allowed; }

/* social buttons */
.btn-social {
  width: 100%;
  padding: 11px 16px;
  border-radius: 12px;
  border: 1.5px solid var(--border2);
  background: rgba(255,255,255,.03);
  color: var(--ink2);
  font-size: 14px;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  transition: all .2s;
  text-decoration: none;
}
.btn-social:hover { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.2); color: var(--ink); }
.btn-social.google:hover { border-color: rgba(66,133,244,.5); background: rgba(66,133,244,.08); }
.btn-social.facebook:hover { border-color: rgba(24,119,242,.5); background: rgba(24,119,242,.08); }

/* biometric */
.btn-bio {
  width: 100%;
  padding: 11px;
  border-radius: 12px;
  border: 1.5px solid rgba(99,102,241,.35);
  background: rgba(99,102,241,.08);
  color: #a5b4fc;
  font-size: 14px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  transition: all .2s;
}
.btn-bio:hover { background: rgba(99,102,241,.16); border-color: #818cf8; }

/* divider */
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 22px 0;
}
.auth-divider span { font-size: 12px; color: var(--ink3); white-space: nowrap; }
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border2);
}

/* alert messages */
.auth-alert {
  padding: 12px 15px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 500;
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 20px;
  line-height: 1.5;
}
.auth-alert.err {
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.25);
  color: #fca5a5;
}
.auth-alert.ok {
  background: rgba(16,185,129,.1);
  border: 1px solid rgba(16,185,129,.25);
  color: #6ee7b7;
}
.auth-alert-icon { flex-shrink: 0; margin-top: 1px; }

/* footer link row */
.auth-foot {
  text-align: center;
  margin-top: 28px;
  font-size: 13px;
  color: var(--ink3);
}
.auth-foot a { color: var(--accent2); font-weight: 600; transition: color .2s; }
.auth-foot a:hover { color: var(--ink); }

/* back link */
.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink3);
  font-weight: 500;
  margin-bottom: 32px;
  transition: color .2s;
  cursor: pointer;
  border: none; background: none; padding: 0;
}
.auth-back:hover { color: var(--ink); }

/* spinner */
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .65s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* perks strip */
.auth-perks {
  display: flex;
  gap: 6px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}
.auth-perk {
  flex: 1;
  min-width: 90px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: rgba(99,102,241,.07);
  border: 1px solid rgba(99,102,241,.15);
  border-radius: 9px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink2);
  white-space: nowrap;
}

/* OTP inputs */
.otp-inputs {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 24px;
}
.otp-digit {
  width: 52px; height: 60px;
  background: var(--bg3);
  border: 1.5px solid var(--border2);
  border-radius: 12px;
  font-size: 24px;
  font-weight: 800;
  font-family: 'Sora', sans-serif;
  color: var(--ink);
  text-align: center;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
  caret-color: var(--accent);
}
.otp-digit:focus {
  border-color: var(--accent);
  background: rgba(99,102,241,.06);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
.otp-digit.filled {
  border-color: rgba(99,102,241,.45);
  color: #a5b4fc;
}

/* email hint pill */
.email-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(99,102,241,.1);
  border: 1px solid rgba(99,102,241,.25);
  border-radius: 99px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #a5b4fc;
  margin-bottom: 24px;
}

/* page animations */
.auth-form-wrap {
  animation: authFadeUp .4s cubic-bezier(.4,0,.2,1) both;
}
@keyframes authFadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%,60% { transform: translateX(-6px); }
  40%,80% { transform: translateX(6px); }
}


/* ── Toast Notifications ──────────────────────────── */
#auth-toast-wrap {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  width: 100%;
  max-width: 460px;
  padding: 0 16px;
}
.auth-toast {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  pointer-events: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,.4), 0 2px 8px rgba(0,0,0,.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: toastIn .35s cubic-bezier(.34,1.56,.64,1) both;
  cursor: pointer;
  border: 1px solid;
  position: relative;
  overflow: hidden;
}
.auth-toast::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  border-radius: 14px 14px 0 0;
}
.auth-toast.hiding {
  animation: toastOut .3s ease forwards;
}
.auth-toast.err {
  background: rgba(15,5,5,.92);
  border-color: rgba(239,68,68,.35);
  color: #fca5a5;
}
.auth-toast.err::before { background: linear-gradient(90deg, #ef4444, #f87171); }
.auth-toast.ok {
  background: rgba(2,12,10,.92);
  border-color: rgba(16,185,129,.35);
  color: #6ee7b7;
}
.auth-toast.ok::before { background: linear-gradient(90deg, #10b981, #34d399); }
.auth-toast-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}
.auth-toast-body { flex: 1; }
.auth-toast-close {
  flex-shrink: 0;
  opacity: .5;
  font-size: 14px;
  cursor: pointer;
  padding: 2px;
  transition: opacity .15s;
}
.auth-toast-close:hover { opacity: 1; }
.auth-toast-progress {
  position: absolute;
  bottom: 0; left: 0;
  height: 2px;
  border-radius: 0 0 14px 14px;
  animation: toastProgress linear forwards;
}
.auth-toast.err .auth-toast-progress { background: rgba(239,68,68,.5); }
.auth-toast.ok  .auth-toast-progress { background: rgba(16,185,129,.5); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-16px) scale(.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); max-height: 100px; margin-bottom: 0; }
  to   { opacity: 0; transform: translateY(-10px) scale(.94); max-height: 0; margin-bottom: -10px; }
}
@keyframes toastProgress {
  from { width: 100%; }
  to   { width: 0%; }
}

/* keep inline alert hidden (used internally but not shown) */
.auth-alert { display: none !important; }

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 900px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .auth-right { padding: 32px 24px; align-items: flex-start; }
  .auth-form-wrap { padding-top: 20px; }
}

/* mobile: show mini logo at top when left panel hidden */
.auth-mobile-logo {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
@media (max-width: 900px) {
  .auth-mobile-logo { display: flex; }
}