﻿
/* ═══════════════════════════════════════════
   TOKENS
═══════════════════════════════════════════ */
:root {
  --blue:        #1D4ED8;
  --blue-dark:   #1E3A8A;
  --blue-light:  #3B82F6;
  --green:       var(--blue);
  --green-dark:  var(--blue-dark);
  --green-light: var(--blue-light);
  --black:       #0A0A08;
  --surface:     #111110;
  --surface2:    #1A1A18;
  --surface3:    #242422;
  --text:        #FFFFFF;
  --muted:       #A0A09A;
  --border:      rgba(240,237,228,0.08);
  --border-h:    rgba(29,78,216,0.4);
  --red:         #E5534B;
  --radius:      4px;
  --ease:        0.22s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; height: 100%; }
body {
  background: var(--black);
  color: var(--text);
  font-family: 'Nunito Sans', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100%;
  display: flex;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font-family: 'Nunito Sans', sans-serif; cursor: pointer; }
input, select, textarea { font-family: 'Nunito Sans', sans-serif; }

/* ═══════════════════════════════════════════
   LAYOUT — SPLIT SCREEN
═══════════════════════════════════════════ */
.auth-shell {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* ── LEFT PANEL ── */
.auth-left {
  width: 50%;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

/* Grid texture */
.left-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(240,237,228,.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(240,237,228,.022) 1px, transparent 1px);
  background-size: 52px 52px;
  pointer-events: none;
}

/* Glow orbs */
.left-glow-1 {
  position: absolute; top: -15%; left: -15%;
  width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle, rgba(29,78,216,.1) 0%, transparent 70%);
  pointer-events: none;
}
.left-glow-2 {
  position: absolute; bottom: -10%; right: -10%;
  width: 360px; height: 360px; border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,.08) 0%, transparent 70%);
  pointer-events: none;
}

/* Left content */
.left-inner {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  height: 100%; padding: 3rem;
}

/* Logo */
.auth-logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.6rem; letter-spacing: .05em;
  display: inline-block; margin-bottom: auto;
}
.auth-logo span { color: var(--green); }

/* Hero text */
.left-hero { margin: auto 0; }

.left-tag {
  font-family: 'Space Mono', monospace;
  font-size: .65rem; color: var(--green);
  letter-spacing: .25em; text-transform: uppercase;
  display: flex; align-items: center; gap: .6rem;
  margin-bottom: 1.5rem;
}
.left-tag::before {
  content: ''; display: block;
  width: 28px; height: 1px; background: var(--green);
}

.left-headline {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(3.5rem, 7vw, 6.5rem);
  line-height: .92; letter-spacing: .02em;
  margin-bottom: 1.6rem;
}
.left-headline em { color: var(--green); font-style: normal; }

.left-sub {
  font-size: .92rem; color: var(--muted);
  max-width: 380px; line-height: 1.75;
  font-weight: 300; margin-bottom: 2.5rem;
}

/* Feature list */
.feature-list {
  display: flex; flex-direction: column; gap: .8rem;
  list-style: none;
}
.feature-list li {
  display: flex; align-items: center; gap: .8rem;
  font-size: .82rem; color: var(--muted);
}
.feature-list li span { color: var(--text); }
.feature-dot {
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(29,78,216,.12);
  border: 1px solid rgba(59,130,246,.25);
  display: flex; align-items: center; justify-content: center;
  color: var(--green); flex-shrink: 0; font-size: .7rem;
}

/* Stats row at bottom */
.left-stats {
  display: flex; gap: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.left-stat-val {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.8rem; line-height: 1;
  margin-bottom: .15rem;
}
.left-stat-val span { color: var(--green); }
.left-stat-lbl {
  font-family: 'Space Mono', monospace;
  font-size: .58rem; color: var(--muted);
  letter-spacing: .14em; text-transform: uppercase;
}

/* ── RIGHT PANEL ── */
.auth-right {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 3rem 2rem;
  background: var(--black);
  position: relative;
  overflow: hidden;
}

/* Subtle bg */
.right-bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 60% at 80% 50%, rgba(29,78,216,.05) 0%, transparent 70%);
  pointer-events: none;
}

/* ── FORM CARD ── */
.auth-card {
  width: 100%; max-width: 420px;
  position: relative; z-index: 1;
}

/* State switcher — Sign In / Sign Up tabs */
.mode-tabs {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .3rem;
  margin-bottom: 2rem;
}
.mode-tab {
  flex: 1; padding: .6rem;
  text-align: center;
  font-size: .75rem; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); background: none; border: none;
  border-radius: 2px;
  transition: all var(--ease); cursor: pointer;
}
.mode-tab.active {
  background: var(--surface2);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}

/* Card heading */
.card-heading { margin-bottom: 1.8rem; }
.card-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.2rem; line-height: .93; letter-spacing: .02em;
  margin-bottom: .4rem;
}
.card-title em { color: var(--green); font-style: normal; }
.card-sub { font-size: .82rem; color: var(--muted); }

/* ── USER TYPE SELECTOR ── */
.type-selector {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: .75rem; margin-bottom: 1.6rem;
}
.type-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  cursor: pointer;
  transition: all var(--ease);
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: .5rem;
}
.type-card:hover { border-color: rgba(59,130,246,.35); }
.type-card.selected {
  border-color: var(--green);
  background: rgba(29,78,216,.08);
}
.type-card.selected::after {
  content: '✓';
  position: absolute; top: .5rem; right: .65rem;
  font-size: .7rem; color: var(--green);
  font-weight: 700;
}
.type-icon {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.6rem; color: rgba(59,130,246,.35);
  line-height: 1; transition: color var(--ease);
}
.type-card.selected .type-icon { color: var(--green); }
.type-name {
  font-size: .82rem; font-weight: 600;
  margin-bottom: .05rem;
}
.type-desc {
  font-size: .7rem; color: var(--muted); line-height: 1.45;
}

/* ── FORM FIELDS ── */
.form-fields { display: flex; flex-direction: column; gap: 1rem; }

.field-group { display: flex; flex-direction: column; gap: .35rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }

.field-label {
  font-family: 'Space Mono', monospace;
  font-size: .58rem; color: var(--muted);
  letter-spacing: .15em; text-transform: uppercase;
  display: flex; align-items: center; justify-content: space-between;
}
.field-label a { color: var(--green); font-size: .58rem; }

.field-input-wrap {
  position: relative;
}
.field-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .72rem 2.4rem .72rem .9rem;
  font-size: .85rem; color: var(--text); outline: none;
  transition: border-color var(--ease), box-shadow var(--ease);
}
.field-input::placeholder { color: var(--muted); }
.field-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(29,78,216,.1);
}
.field-input.error { border-color: var(--red); }
.field-input.error:focus { box-shadow: 0 0 0 3px rgba(229,83,75,.08); }

.field-icon {
  position: absolute; right: .8rem; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
}
.field-icon svg { width: 15px; height: 15px; }
.field-toggle-btn {
  position: absolute; right: .8rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--muted);
  cursor: pointer; padding: 0; transition: color var(--ease);
  display: flex; align-items: center;
}
.field-toggle-btn:hover { color: var(--green); }
.field-toggle-btn svg { width: 15px; height: 15px; }

.field-error {
  font-size: .68rem; color: var(--red);
  display: flex; align-items: center; gap: .3rem;
  display: none;
}
.field-error.show { display: flex; }
.field-error svg { width: 11px; height: 11px; }

/* Strength meter */
.strength-wrap { display: none; }
.strength-wrap.show { display: block; }
.strength-bar {
  height: 3px; background: var(--surface3);
  border-radius: 2px; overflow: hidden; margin-bottom: .3rem;
}
.strength-fill {
  height: 100%; border-radius: 2px;
  transition: width .3s ease, background .3s ease;
  width: 0%;
}
.strength-label {
  font-family: 'Space Mono', monospace;
  font-size: .58rem; letter-spacing: .1em;
  text-transform: uppercase;
}

/* Phone field with flag */
.phone-wrap { display: flex; }
.phone-prefix {
  background: var(--surface3); border: 1px solid var(--border);
  border-right: none; border-radius: var(--radius) 0 0 var(--radius);
  padding: .72rem .75rem; display: flex; align-items: center;
  gap: .35rem; font-size: .8rem; color: var(--muted); white-space: nowrap;
  font-family: 'Space Mono', monospace; font-size: .72rem;
  transition: border-color var(--ease);
}
.phone-wrap:focus-within .phone-prefix { border-color: var(--green); }
.phone-input {
  border-radius: 0 var(--radius) var(--radius) 0 !important;
  border-left: none !important;
}

/* Divider */
.divider {
  display: flex; align-items: center; gap: .75rem;
  margin: 1.2rem 0; font-size: .7rem; color: var(--muted);
  font-family: 'Space Mono', monospace; letter-spacing: .1em;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* OAuth buttons */
.oauth-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .6rem; }
.oauth-btn {
  width: 100%; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: .65rem; display: flex; align-items: center;
  justify-content: center; gap: .55rem;
  font-size: .75rem; font-weight: 500; color: var(--muted);
  transition: all var(--ease);
}
.oauth-btn:hover { border-color: rgba(59,130,246,.3); color: var(--text); }
.oauth-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Checkbox */
.check-row {
  display: flex; align-items: flex-start; gap: .7rem;
}
.check-box {
  width: 16px; height: 16px; flex-shrink: 0;
  accent-color: var(--green); cursor: pointer; margin-top: .1rem;
}
.check-label { font-size: .75rem; color: var(--muted); line-height: 1.5; }
.check-label a { color: var(--green); text-decoration: underline; text-underline-offset: 2px; }

/* Submit button */
.btn-submit {
  width: 100%; background: var(--green); color: var(--black);
  border: none; border-radius: var(--radius);
  padding: .85rem; font-size: .82rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  font-family: 'Nunito Sans', sans-serif;
  transition: background var(--ease), transform var(--ease), box-shadow var(--ease);
  display: flex; align-items: center; justify-content: center; gap: .6rem;
  margin-top: .4rem; position: relative; overflow: hidden;
}
.btn-submit:hover {
  background: var(--green-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(29,78,216,.28);
}
.btn-submit:active { transform: translateY(0); }
.btn-submit.loading { pointer-events: none; }
.btn-submit .spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(10,10,8,.3);
  border-top-color: var(--black);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: none;
}
.btn-submit.loading .spinner { display: block; }
.btn-submit.loading .btn-label { opacity: 0.7; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Ripple */
.btn-submit::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle, rgba(255,255,255,.15) 0%, transparent 70%);
  transform: scale(0); opacity: 0; border-radius: 50%;
  transition: transform .4s ease, opacity .4s ease;
}
.btn-submit:active::after { transform: scale(2.5); opacity: 1; transition: 0s; }

/* Switch link */
.switch-link {
  text-align: center; margin-top: 1.5rem;
  font-size: .78rem; color: var(--muted);
}
.switch-link a { color: var(--green); font-weight: 500; }
.switch-link a:hover { text-decoration: underline; }

/* ── PANELS (animated transitions) ── */
.auth-panel {
  display: none;
  animation: fadeUp .35s ease;
}
.auth-panel.active { display: block; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── SUCCESS STATE ── */
.success-state {
  text-align: center; padding: 1rem 0;
  display: none;
  animation: fadeUp .35s ease;
}
.success-state.active { display: block; }
.success-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(29,78,216,.12); border: 1.5px solid rgba(59,130,246,.3);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.5rem; color: var(--green);
}
.success-icon svg { width: 28px; height: 28px; }
.success-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem; line-height: .95; margin-bottom: .6rem;
}
.success-title em { color: var(--green); font-style: normal; }
.success-sub { font-size: .82rem; color: var(--muted); margin-bottom: 1.8rem; line-height: 1.7; }
.success-actions { display: flex; flex-direction: column; gap: .6rem; }
.btn-go {
  background: var(--green); color: var(--black);
  border: none; border-radius: var(--radius);
  padding: .8rem; font-size: .8rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
  font-family: 'Nunito Sans', sans-serif;
  transition: background var(--ease);
  display: flex; align-items: center; justify-content: center; gap: .5rem;
}
.btn-go:hover { background: var(--green-light); }
.btn-go svg { width: 14px; height: 14px; }
.btn-go-ghost {
  background: none; border: 1px solid var(--border); color: var(--muted);
  border-radius: var(--radius); padding: .75rem;
  font-size: .78rem; letter-spacing: .08em; text-transform: uppercase;
  transition: all var(--ease);
  display: flex; align-items: center; justify-content: center; gap: .5rem;
}
.btn-go-ghost:hover { border-color: var(--green); color: var(--green); }

/* ── FORGOT PASSWORD ── */
.forgot-back {
  display: flex; align-items: center; gap: .5rem;
  color: var(--muted); font-size: .75rem;
  letter-spacing: .08em; text-transform: uppercase;
  background: none; border: none;
  margin-bottom: 1.8rem; padding: 0;
  transition: color var(--ease);
}
.forgot-back:hover { color: var(--green); }
.forgot-back svg { width: 13px; height: 13px; }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 999;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .85rem 1.2rem;
  display: flex; align-items: center; gap: .75rem;
  font-size: .8rem; min-width: 240px;
  transform: translateY(20px); opacity: 0;
  transition: all var(--ease); pointer-events: none;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: rgba(29,78,216,.4); }
.toast.error   { border-color: rgba(229,83,75,.4); }
.toast-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.toast.success .toast-dot { background: var(--green); }
.toast.error   .toast-dot { background: var(--red); }

/* ── LEFT PANEL CONTENT SWAPS ── */
.left-content { transition: opacity .4s ease; }
.left-content.fading { opacity: 0; }

/* ── RESPONSIVE ── */
@media (max-width: 920px) {
  .auth-left { display: none; }
  .auth-right { padding: 2rem 1.5rem; }
  .auth-shell { justify-content: center; }
  .auth-card { max-width: 460px; }
}
@media (max-width: 480px) {
  .auth-right { padding: 1.5rem 1rem; align-items: flex-start; padding-top: 2rem; }
  .field-row { grid-template-columns: 1fr; }
  .oauth-btn span { display: none; }
}

/* ═══════════════════════════════════════════
   THEME TOGGLE BUTTON
═══════════════════════════════════════════ */
.theme-toggle {
  position: fixed; top: 1rem; right: 1rem; z-index: 200;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); cursor: pointer;
  transition: border-color var(--ease), color var(--ease), background var(--ease);
}
.theme-toggle:hover { border-color: var(--blue); color: var(--blue-light); }
.theme-toggle svg { width: 14px; height: 14px; flex-shrink: 0; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

/* ═══════════════════════════════════════════
   LIGHT MODE
═══════════════════════════════════════════ */
[data-theme="light"] {
  --black: #F8F8F5;
  --surface: #FFFFFF;
  --surface2: #F2F2EE;
  --surface3: #E8E8E3;
  --surface4: #DCDCD7;
  --text: #000000;
  --muted: #333330;
  --border: rgba(10,10,8,0.1);
  --border-h: rgba(29,78,216,0.35);
}
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .left-grid {
  background-image:
    linear-gradient(rgba(10,10,8,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10,10,8,.04) 1px, transparent 1px);
}
[data-theme="light"] .left-glow-1 { background: radial-gradient(circle, rgba(29,78,216,.07) 0%, transparent 70%); }
[data-theme="light"] .left-glow-2 { background: radial-gradient(circle, rgba(59,130,246,.05) 0%, transparent 70%); }
[data-theme="light"] .right-bg { background: radial-gradient(ellipse 60% 60% at 80% 50%, rgba(29,78,216,.04) 0%, transparent 70%); }
[data-theme="light"] .field-input:focus { box-shadow: 0 0 0 3px rgba(29,78,216,.1); }
