:root {
  --primary: #15d18a;
  --primary-rgb: 21,209,138;
  --bg: #090d13;
  --surface: #0d1117;
  --card: #111820;
  --border: #1e2736;
  --muted: #7a8a9e;
  --text: #c9d3df;
  --destructive: #ef4444;
}

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

body.auth-page {
  min-height: 100vh;
  background: var(--bg);
  font-family: 'Inter', -apple-system, sans-serif;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
}

.auth-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.auth-bg-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
}
.auth-bg-glow {
  position: absolute; border-radius: 50%; filter: blur(120px); opacity: 0.15;
}
.auth-bg-glow-1 { width: 500px; height: 500px; background: var(--primary); top: -150px; right: -100px; }
.auth-bg-glow-2 { width: 400px; height: 400px; background: #6366f1; bottom: -100px; left: -100px; }

.auth-container {
  position: relative; z-index: 1;
  display: flex; align-items: stretch; gap: 0;
  max-width: 960px; width: 100%; min-height: 600px;
  margin: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.auth-card {
  flex: 1; padding: 40px 36px;
  display: flex; flex-direction: column; justify-content: center;
}
.auth-card-register { padding: 32px 36px; }

.auth-side {
  width: 340px; flex-shrink: 0;
  background: linear-gradient(160deg, rgba(var(--primary-rgb),0.06), rgba(99,102,241,0.04));
  border-left: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 28px;
}

.auth-side-content { display: flex; flex-direction: column; gap: 24px; }

.auth-side-stat { text-align: center; }
.auth-side-stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.6rem; font-weight: 700; color: var(--primary);
}
.auth-side-stat-label { font-size: 0.75rem; color: var(--muted); margin-top: 4px; }

.auth-side-quote {
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px; padding: 16px;
}
.auth-side-quote p { font-size: 0.8rem; color: var(--text); line-height: 1.6; font-style: italic; margin-bottom: 12px; }
.auth-side-quote-author strong { font-size: 0.75rem; color: white; display: block; }
.auth-side-quote-author span { font-size: 0.7rem; color: var(--muted); }

.auth-side-feature {
  display: flex; gap: 14px; align-items: flex-start;
}
.auth-side-feature svg { flex-shrink: 0; margin-top: 2px; }
.auth-side-feature strong { font-size: 0.85rem; color: white; display: block; margin-bottom: 2px; }
.auth-side-feature p { font-size: 0.75rem; color: var(--muted); line-height: 1.4; }

.auth-header { margin-bottom: 28px; }
.auth-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; margin-bottom: 24px;
  font-family: 'Outfit', sans-serif; font-size: 1.2rem; font-weight: 700; color: white;
}
.auth-logo .text-primary { color: var(--primary); }
.auth-title { font-family: 'Outfit', sans-serif; font-size: 1.5rem; font-weight: 700; color: white; margin-bottom: 6px; }
.auth-subtitle { font-size: 0.85rem; color: var(--muted); }

.auth-form { display: flex; flex-direction: column; gap: 18px; }

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

.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field label { font-size: 0.8rem; font-weight: 600; color: #e2e8f0; }

.auth-label-row { display: flex; justify-content: space-between; align-items: center; }
.auth-forgot { font-size: 0.75rem; color: var(--primary); text-decoration: none; }
.auth-forgot:hover { color: white; }

.auth-input-wrap {
  position: relative; display: flex; align-items: center;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  transition: border-color .2s, box-shadow .2s;
}
.auth-input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb),0.12);
}
.auth-input-wrap.auth-input-error {
  border-color: var(--destructive);
}

.auth-input-icon { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.auth-input {
  width: 100%; padding: 11px 12px 11px 38px;
  background: transparent; border: none; outline: none;
  color: white; font-size: 0.9rem; font-family: inherit;
}
.auth-input::placeholder { color: rgba(122,138,158,0.6); }

.auth-toggle-pw {
  position: absolute; right: 10px; background: none; border: none;
  color: var(--muted); cursor: pointer; padding: 4px;
  display: flex; align-items: center;
}
.auth-toggle-pw:hover { color: white; }

.auth-phone-row { display: flex; gap: 8px; position: relative; }
.auth-country-btn {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.04); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 0 12px; color: white;
  font-size: 0.85rem; cursor: pointer; white-space: nowrap;
  transition: border-color .2s;
}
.auth-country-btn:hover { border-color: rgba(255,255,255,0.2); }
.auth-country-dropdown {
  position: absolute; top: 100%; left: 0; margin-top: 4px; z-index: 50;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 6px; min-width: 200px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  max-height: 200px; overflow-y: auto;
}
.auth-country-option {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 6px; cursor: pointer;
  font-size: 0.85rem; color: var(--text);
}
.auth-country-option:hover { background: rgba(var(--primary-rgb),0.08); color: white; }

.auth-phone-row .auth-input { padding-left: 12px; }

.auth-pw-strength { margin-top: -8px; }
.auth-pw-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.auth-pw-bar-fill { height: 100%; border-radius: 2px; transition: width .3s, background .3s; width: 0; }
.auth-pw-label { font-size: 0.7rem; margin-top: 4px; display: block; }

.auth-remember { display: flex; flex-direction: column; gap: 4px; }
.auth-checkbox-label {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.8rem; color: var(--muted); cursor: pointer;
  position: relative; padding-left: 28px;
}
.auth-checkbox { position: absolute; opacity: 0; width: 0; height: 0; }
.auth-checkmark {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; border: 1.5px solid var(--border);
  border-radius: 4px; background: rgba(255,255,255,0.04);
  transition: background .2s, border-color .2s;
}
.auth-checkbox:checked + .auth-checkmark {
  background: var(--primary); border-color: var(--primary);
}
.auth-checkbox:checked + .auth-checkmark::after {
  content: ''; position: absolute; left: 5px; top: 2px;
  width: 5px; height: 9px;
  border: solid white; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.auth-checkbox-label .auth-link { color: var(--primary); }

.auth-error {
  font-size: 0.75rem; color: var(--destructive); min-height: 0;
}
.auth-error:empty { display: none; }

.auth-error-box {
  background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.2);
  border-radius: 10px; padding: 12px 14px;
  font-size: 0.8rem; color: #fca5a5; line-height: 1.5;
}

.auth-submit {
  width: 100%; padding: 13px;
  background: var(--primary); color: #090d13;
  font-size: 0.95rem; font-weight: 700;
  border: none; border-radius: 10px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .2s, transform .1s;
  font-family: inherit;
}
.auth-submit:hover { background: #12b878; }
.auth-submit:active { transform: scale(0.98); }
.auth-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-submit-loader {
  width: 18px; height: 18px;
  border: 2px solid rgba(9,13,19,0.3); border-top-color: #090d13;
  border-radius: 50%; animation: authSpin .6s linear infinite;
}
@keyframes authSpin { to { transform: rotate(360deg); } }

.auth-divider {
  display: flex; align-items: center; gap: 16px;
  margin: 20px 0; color: var(--muted); font-size: 0.75rem;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

.auth-alt { text-align: center; font-size: 0.85rem; color: var(--muted); }
.auth-link { color: var(--primary); text-decoration: none; font-weight: 600; }
.auth-link:hover { color: white; }

.auth-footer-links { text-align: center; margin-top: 16px; }
.auth-footer-links a { font-size: 0.75rem; color: var(--muted); text-decoration: none; }
.auth-footer-links a:hover { color: var(--primary); }

.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-card-left {
  padding: 36px 32px;
}
.auth-eye {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--muted);
  cursor: pointer; padding: 4px; display: flex; align-items: center;
}
.auth-eye:hover { color: var(--text); }
.auth-footer {
  text-align: center; margin-top: 20px;
}
.auth-footer-link {
  font-size: 0.8rem; color: var(--muted); text-decoration: none;
}
.auth-footer-link:hover { color: var(--primary); }

.auth-btn {
  width: 100%; padding: 13px 20px;
  background: var(--primary, #15d18a); color: #090d13;
  font-size: 0.9rem; font-weight: 700;
  border: none; border-radius: 10px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .2s, transform .1s;
  font-family: inherit;
}
.auth-btn:hover { background: #12b878; }
.auth-btn:active { transform: scale(0.98); }
.auth-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-btn-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(9,13,19,0.3); border-top-color: #090d13;
  border-radius: 50%; animation: authSpin .6s linear infinite;
}
.auth-submit-actions {
  margin-top: 16px;
}

@media (max-width: 768px) {
  .auth-container { flex-direction: column; max-width: 480px; min-height: auto; }
  .auth-side { display: none; }
  .auth-card { padding: 28px 20px; }
  .auth-row { grid-template-columns: 1fr; }
}
