/* =============================================
   AUTH PAGES - LOGIN / REGISTER
   ============================================= */

:root {
  --primary: #667eea;
  --primary-hover: #5a6fd6;
  --secondary: #764ba2;
  --success: #48bb78;
  --danger: #f56565;
  --warning: #ed8936;

  --bg: #0b0b1e;
  --bg-card: #131332;
  --bg-input: rgba(255,255,255,0.04);
  --bg-hover: rgba(255,255,255,0.04);

  --text: #e2e8f0;
  --text-muted: #717da0;
  --border: rgba(255,255,255,0.07);

  --gradient-purple: linear-gradient(135deg, #667eea, #764ba2);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0,0,0,0.25);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== BACKGROUND EFFECTS ===== */
.auth-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.15;
  animation: orbFloat 20s ease-in-out infinite;
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: #667eea;
  top: -200px;
  left: -100px;
  animation-delay: 0s;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: #764ba2;
  bottom: -150px;
  right: -100px;
  animation-delay: -7s;
}

.orb-3 {
  width: 300px;
  height: 300px;
  background: #4facfe;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -40px) scale(1.05); }
  50% { transform: translate(-20px, 30px) scale(0.95); }
  75% { transform: translate(40px, 20px) scale(1.02); }
}

.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;
}

/* ===== LAYOUT ===== */
.auth-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
}

/* ===== LEFT BRANDING PANEL ===== */
.auth-branding {
  width: 480px;
  min-height: 100vh;
  background: linear-gradient(180deg, rgba(19,19,50,0.9) 0%, rgba(11,11,30,0.95) 100%);
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 48px;
  position: relative;
  overflow: hidden;
}

.auth-branding::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-purple);
  opacity: 0.03;
}

.branding-content {
  position: relative;
  z-index: 1;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 32px;
}

.brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--gradient-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  box-shadow: 0 4px 20px rgba(102,126,234,0.3);
}

.branding-content h1 {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 14px;
  background: var(--gradient-purple);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.branding-content > p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 40px;
}

.brand-features {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand-feature {
  display: flex;
  align-items: center;
  gap: 14px;
}

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(102,126,234,0.1);
  border: 1px solid rgba(102,126,234,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 16px;
  flex-shrink: 0;
}

.brand-feature strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.brand-feature span {
  font-size: 12px;
  color: var(--text-muted);
}

.brand-footer {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.brand-footer p {
  color: var(--text-muted);
  font-size: 12px;
}

.brand-footer strong {
  background: var(--gradient-purple);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}

/* ===== RIGHT FORM PANEL ===== */
.auth-form-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  position: relative;
}

.auth-form-container {
  width: 100%;
  max-width: 440px;
}

/* ===== TABS ===== */
.auth-tabs {
  display: flex;
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 32px;
  border: 1px solid var(--border);
}

.auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s;
}

.auth-tab.active {
  background: var(--gradient-purple);
  color: #fff;
  box-shadow: 0 4px 16px rgba(102,126,234,0.3);
}

.auth-tab:not(.active):hover {
  color: var(--text);
  background: rgba(255,255,255,0.04);
}

/* ===== FORMS ===== */
.auth-form {
  display: none;
  animation: fadeSlideIn 0.3s ease;
}

.auth-form.active {
  display: block;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.form-header {
  margin-bottom: 28px;
}

.form-header h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
}

.form-header p {
  color: var(--text-muted);
  font-size: 14px;
}

/* ===== INPUTS ===== */
.input-group {
  position: relative;
  margin-bottom: 16px;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
  transition: color 0.2s;
}

.input-group input {
  width: 100%;
  padding: 14px 14px 14px 44px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  transition: all 0.2s;
  outline: none;
}

.input-group input:focus {
  border-color: var(--primary);
  background: rgba(102,126,234,0.04);
  box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

.input-group input:focus + .input-icon,
.input-group input:focus ~ .input-icon {
  color: var(--primary);
}

.input-group input::placeholder {
  color: var(--text-muted);
}

.input-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  transition: color 0.2s;
}

.input-toggle:hover {
  color: var(--text);
}

.input-row {
  display: flex;
  gap: 12px;
}

.input-row .input-group {
  flex: 1;
}

/* ===== PASSWORD STRENGTH ===== */
.password-strength {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -8px 0 16px;
}

.strength-bars {
  display: flex;
  gap: 4px;
  flex: 1;
}

.strength-bar {
  height: 4px;
  flex: 1;
  border-radius: 2px;
  background: rgba(255,255,255,0.08);
  transition: background 0.3s;
}

.strength-bar.weak { background: var(--danger); }
.strength-bar.medium { background: var(--warning); }
.strength-bar.strong { background: var(--success); }

.strength-text {
  font-size: 11px;
  font-weight: 600;
  min-width: 60px;
  text-align: right;
}

.strength-text.weak { color: var(--danger); }
.strength-text.medium { color: var(--warning); }
.strength-text.strong { color: var(--success); }

/* ===== FORM OPTIONS ===== */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  position: relative;
  transition: all 0.2s;
  flex-shrink: 0;
}

.checkbox-label input:checked + .checkmark {
  background: var(--gradient-purple);
  border-color: transparent;
}

.checkbox-label input:checked + .checkmark::after {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 10px;
  color: #fff;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.form-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.2s;
}

.form-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* ===== AUTH BUTTON ===== */
.btn-auth {
  width: 100%;
  padding: 14px;
  background: var(--gradient-purple);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s;
  box-shadow: 0 4px 20px rgba(102,126,234,0.3);
  position: relative;
  overflow: hidden;
}

.btn-auth:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(102,126,234,0.4);
}

.btn-auth:active {
  transform: translateY(0);
}

.btn-auth.loading {
  pointer-events: none;
  opacity: 0.8;
}

.btn-auth.loading::after {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== DIVIDER ===== */
.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.divider span {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

/* ===== SOCIAL LOGIN ===== */
.social-login {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 24px;
}

.btn-social {
  width: 56px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.btn-social:hover {
  border-color: var(--primary);
  background: rgba(102,126,234,0.06);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(102,126,234,0.15);
}

/* ===== FOOTER TEXT ===== */
.form-footer-text {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.form-footer-text a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.form-footer-text a:hover {
  text-decoration: underline;
}

/* ===== BACK LINK ===== */
.back-link {
  background: none;
  border: none;
  color: var(--primary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  padding: 0;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--primary-hover);
}

/* ===== AUTH CREDIT ===== */
.auth-credit {
  position: absolute;
  bottom: 24px;
  color: var(--text-muted);
  font-size: 12px;
}

.auth-credit span {
  color: var(--primary);
  font-weight: 600;
}

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 13px;
  animation: toastIn 0.3s ease;
  min-width: 280px;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--primary); }

.toast i {
  font-size: 16px;
}
.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }
.toast.info i { color: var(--primary); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .auth-branding {
    display: none;
  }

  .auth-form-panel {
    padding: 24px;
  }
}

@media (max-width: 480px) {
  .auth-form-container {
    max-width: 100%;
  }

  .input-row {
    flex-direction: column;
    gap: 0;
  }

  .form-options {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .social-login {
    gap: 8px;
  }

  .btn-social {
    flex: 1;
  }
}
