/* ============================================================
   M3U-EDIT.COM v2 — Premium Authentication Pages
   Location: assets/css/auth.css

   Split-screen design: Left = animated brand panel, Right = form
   Inspired by Stripe, Linear, Vercel signup pages.
   ============================================================ */

/* ============================================================
   LAYOUT — Hide site header on auth pages, full-bleed
   ============================================================ */
body {
  background: var(--bg);
}

.site-header { display: none !important; }
.site-footer { display: none !important; }
main { display: contents; }

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
}

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
}

/* ============================================================
   LEFT PANEL — Animated brand showcase (desktop only)
   ============================================================ */
.auth-brand-panel {
  position: relative;
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 35%, #8b5cf6 70%, #ec4899 100%);
  padding: 60px 50px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}

@media (max-width: 900px) {
  .auth-brand-panel { display: none; }
}

/* Animated background orbs */
.auth-brand-panel::before,
.auth-brand-panel::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  z-index: -1;
}
.auth-brand-panel::before {
  top: -50px;
  left: -50px;
  width: 320px;
  height: 320px;
  background: rgba(255, 255, 255, 0.18);
  animation: orb-drift 18s ease-in-out infinite;
}
.auth-brand-panel::after {
  bottom: -100px;
  right: -80px;
  width: 400px;
  height: 400px;
  background: rgba(236, 72, 153, 0.3);
  animation: orb-drift 22s ease-in-out infinite reverse;
}

@keyframes orb-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.05); }
  66% { transform: translate(-30px, 40px) scale(0.95); }
}

/* Subtle grid pattern */
.auth-brand-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  pointer-events: none;
}

.auth-brand-content {
  position: relative;
  z-index: 1;
  max-width: 460px;
  margin: 0 auto;
  width: 100%;
}

.auth-brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  margin-bottom: 60px;
}
.auth-brand-logo:hover { color: #fff; }

.auth-brand-logo .logo-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 22px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.auth-brand-headline {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 18px;
  letter-spacing: -0.02em;
}

.auth-brand-tagline {
  font-size: 16px;
  opacity: 0.9;
  line-height: 1.65;
  margin-bottom: 36px;
  max-width: 400px;
}

/* Feature list */
.auth-brand-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-brand-features li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  opacity: 0.95;
  line-height: 1.5;
}

.auth-brand-features .feat-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
}

.auth-brand-features li strong { font-weight: 700; }

/* Bottom: Trust signals */
.auth-brand-trust {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  font-size: 13px;
  opacity: 0.85;
}

.auth-brand-trust .trust-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ============================================================
   RIGHT PANEL — Form
   ============================================================ */
.auth-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: var(--bg);
  position: relative;
}

.auth-form-card {
  width: 100%;
  max-width: 420px;
}

/* Mobile: show small logo at top */
.auth-mobile-logo {
  display: none;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 19px;
  color: var(--text);
  text-decoration: none;
  margin-bottom: 32px;
  justify-content: center;
}
.auth-mobile-logo .logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
}
.auth-mobile-logo .logo-text {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
@media (max-width: 900px) {
  .auth-mobile-logo { display: inline-flex; }
}

/* Form header */
.auth-form-header {
  margin-bottom: 32px;
  text-align: center;
}

.auth-form-title {
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.auth-form-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.6;
}

.auth-form-subtitle a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}
.auth-form-subtitle a:hover { text-decoration: underline; }

/* Social login (placeholder for future) */
.auth-social {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.auth-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--t-base);
  font-family: inherit;
}
.auth-social-btn:hover {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb), 0.04);
  transform: translateY(-1px);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Form */
.auth-form .form-group {
  margin-bottom: 16px;
}

.auth-form .form-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--text);
}

.auth-form .form-label .form-label-meta {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.auth-form .form-label a {
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.auth-form .form-label a:hover { text-decoration: underline; }

.auth-form .form-input {
  padding: 12px 14px;
  font-size: 14px;
  border-radius: var(--radius);
}

.auth-form .form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12);
}

/* Password input wrapper */
.auth-password-wrap {
  position: relative;
}
.auth-password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  transition: color var(--t-fast);
}
.auth-password-toggle:hover { color: var(--primary); }

/* Password strength meter */
.password-strength {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.password-strength-bar {
  flex: 1;
  height: 4px;
  background: var(--bg-secondary);
  border-radius: 999px;
  overflow: hidden;
}
.password-strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: all 0.3s ease;
}
.password-strength-fill.weak    { width: 25%; background: var(--danger); }
.password-strength-fill.fair    { width: 50%; background: var(--warning); }
.password-strength-fill.good    { width: 75%; background: var(--info); }
.password-strength-fill.strong  { width: 100%; background: var(--success); }

.password-strength-label {
  font-size: 11px;
  font-weight: 600;
  min-width: 50px;
  text-align: right;
}

.pw-requirements {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
}
.pw-requirements li {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pw-requirements li::before {
  content: '○';
  font-size: 10px;
  color: var(--text-muted, #cbd5e1);
}
.pw-requirements li.is-met {
  color: var(--success, #059669);
}
.pw-requirements li.is-met::before {
  content: '●';
  color: var(--success, #059669);
}

.auth-submit.is-loading {
  opacity: 0.85;
  pointer-events: none;
}

#otp-expired-msg[hidden] { display: none !important; }
.otp-expired-banner {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 13px;
  font-weight: 600;
}
[data-theme="dark"] .otp-expired-banner {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fcd34d;
}

/* Remember + Forgot row */
.auth-form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.auth-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}
.auth-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.auth-form .auth-submit {
  width: 100%;
  padding: 13px;
  font-size: 14px;
  font-weight: 700;
  margin-top: 4px;
}

/* CAPTCHA — same full-width block as login/register */
.auth-form .captcha-widget.captcha-math {
  display: block;
  width: 100%;
  margin: 12px 0 14px;
}

/* CAPTCHA — same full-width block as login/register */
.auth-form .captcha-widget.captcha-math {
  display: block;
  width: 100%;
  margin: 14px 0 10px;
}

.auth-form .captcha-math-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Terms text */
.auth-terms {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 16px;
  line-height: 1.6;
}
.auth-terms a {
  color: var(--text-secondary);
  font-weight: 600;
  text-decoration: underline;
}

/* Switch link below */
.auth-switch {
  margin-top: 24px;
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
}
.auth-switch a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}
.auth-switch a:hover { text-decoration: underline; }

/* ============================================================
   ALERTS (success/error)
   ============================================================ */
.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 20px;
  line-height: 1.5;
}
.auth-alert.error {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--danger);
}
.auth-alert.success {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--success);
}
.auth-alert .alert-icon {
  flex-shrink: 0;
  font-size: 16px;
}
.auth-alert .alert-text { flex: 1; }
.auth-alert ul {
  margin: 4px 0 0;
  padding-left: 20px;
}

/* ============================================================
   GIFT/BONUS BOX (registration page)
   ============================================================ */
.auth-bonus-box {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(16, 185, 129, 0.04));
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.auth-bonus-icon {
  font-size: 26px;
  flex-shrink: 0;
}
.auth-bonus-text {
  flex: 1;
  font-size: 13px;
}
.auth-bonus-text strong {
  display: block;
  color: var(--success);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 2px;
}

/* ============================================================
   THEME TOGGLE (top-right corner)
   ============================================================ */
.auth-theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  z-index: 100;
  transition: all var(--t-fast);
}
.auth-theme-toggle:hover {
  border-color: var(--primary);
  transform: rotate(15deg);
}
.theme-icon-light { display: none; }
.theme-icon-dark { display: inline; }
[data-theme="dark"] .theme-icon-light { display: inline; }
[data-theme="dark"] .theme-icon-dark { display: none; }

/* ============================================================
   RESPONSIVE TWEAKS
   ============================================================ */
@media (max-width: 480px) {
  .auth-form-panel { padding: 30px 20px; }
  .auth-form-title { font-size: 24px; }
  .auth-form-card { max-width: 100%; }
  .auth-theme-toggle { top: 12px; right: 12px; }
}
