/* ==========================================================================
   Auth Pages - Panda Development aesthetic (split-screen w/ floating orbs)
   Used by /auth/login and /auth/register.
   ========================================================================== */

/* Hide site chrome on auth pages (full-bleed, own branding) */
body:has(.auth-split-layout) .mc-navbar,
body:has(.auth-split-layout) header,
body:has(.auth-split-layout) .mc-footer { display: none; }

/* Hide global flash alerts from blocking layout */
body:has(.auth-split-layout) > .alert { position: fixed; top: 20px; right: 20px; z-index: 1000; max-width: 420px; }

.main-content:has(.auth-split-layout) { padding: 0; margin: 0; }

body:has(.auth-split-layout) { overflow-x: hidden; }

/* ========== SPLIT LAYOUT ========== */
.auth-split-layout,
.auth-page-wrapper {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  background: var(--bg-primary);
  overflow: hidden;
  isolation: isolate;
}

.auth-page-wrapper { grid-template-columns: 1fr 1fr; padding: 0; }

/* Single-column on tablets and below */
@media (max-width: 900px) {
  .auth-split-layout,
  .auth-page-wrapper { grid-template-columns: 1fr; }
}

/* ========== FLOATING ORBS + DOT GRID (global background) ========== */
.auth-split-layout::before,
.auth-page-wrapper::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgb(148 163 184 / .15) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.3;
  pointer-events: none;
  z-index: 0;
}

[data-theme="dark"] .auth-split-layout::before,
[data-theme="dark"] .auth-page-wrapper::before { opacity: 0.25; }

.auth-orbs {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.auth-orb {
  position: absolute;
  border-radius: 9999px;
  filter: blur(72px);
  opacity: 0.8;
}

.auth-orb-amber {
  width: 500px; height: 500px;
  top: -12%; right: -10%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.28), rgba(234, 88, 12, 0.12) 55%, transparent 75%);
}

.auth-orb-blue {
  width: 420px; height: 420px;
  bottom: -8%; left: -8%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.22), rgba(6, 182, 212, 0.12) 55%, transparent 75%);
}

.auth-orb-violet {
  width: 320px; height: 320px;
  top: 40%; left: 30%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.14), transparent 70%);
}

[data-theme="dark"] .auth-orb-amber { opacity: 0.45; }
[data-theme="dark"] .auth-orb-blue  { opacity: 0.5; }
[data-theme="dark"] .auth-orb-violet { opacity: 0.35; }

/* ========== LEFT PANEL (brand / marketing) ========== */
.auth-brand-section {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 56px;
  max-width: none;
  background: transparent;
}

/* Keep markup-compat selectors harmless */
.auth-brand-bg { display: none; }
.auth-brand-content { display: contents; }

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 800;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}

.brand-logo i {
  color: #f59e0b;
  font-size: 1.375rem;
}

.brand-hero {
  max-width: 480px;
}

.brand-title {
  font-size: clamp(1.875rem, 3vw, 2.625rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.gradient-text {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.brand-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 32px;
  max-width: 440px;
}

.brand-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}

.brand-feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
}

.feature-icon-sm,
.brand-feature-item i {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgb(245 158 11 / .1);
  color: #d97706;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  flex-shrink: 0;
  border: 1px solid rgb(245 158 11 / .18);
}

.brand-footer {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.brand-footer p { margin: 0; }

/* ========== RIGHT PANEL (form) ========== */
.auth-form-section,
.auth-container {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
}

@media (max-width: 900px) {
  .auth-form-section,
  .auth-container { border-left: none; border-top: 1px solid var(--border-color); }
}

.auth-form-container,
.auth-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Mobile top logo */
.mobile-brand-logo {
  display: none;
  margin-bottom: 24px;
}

@media (max-width: 900px) {
  .mobile-brand-logo { display: block; }
  .auth-brand-section { display: none; }
  .auth-form-section { padding: 32px 24px; }
}

/* ========== HEADINGS ========== */
.auth-header,
.auth-form-header {
  margin-bottom: 28px;
}

.auth-header .auth-brand {
  display: none;
}

.auth-title,
.auth-form-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0 0 6px;
}

.auth-subtitle,
.auth-form-header p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin: 0;
}

/* ========== FORM ========== */
.auth-form,
.modern-auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
  display: block;
}

/* Input wrapper (supports both legacy .input-wrapper and new .input-group) */
.input-wrapper,
.input-group {
  position: relative;
  display: block;
}

.form-input {
  width: 100%;
  height: 42px;
  padding: 8px 12px 8px 40px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
  appearance: none;
}

.form-input::placeholder { color: var(--text-muted); }

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(59 130 246 / .18);
}

.form-input.has-icon-left { padding-left: 40px; }
.form-input.has-icon-right { padding-right: 40px; }

/* Left icon */
.input-icon,
.input-icon-left {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.875rem;
  pointer-events: none;
  transition: color var(--transition-fast);
}

.input-wrapper:focus-within .input-icon,
.input-group:focus-within .input-icon-left,
.input-group:focus-within .input-icon {
  color: var(--primary);
}

/* Password toggle */
.toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.toggle-password:hover { color: var(--text-primary); background: var(--bg-tertiary); }

/* Hint text */
.form-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ========== REMEMBER / FORGOT ROW ========== */
.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
}

.remember-me {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.remember-me input { display: none; }

.checkbox-box {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: transparent;
  font-size: 0.625rem;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.remember-me input:checked + .checkbox-box,
.custom-checkbox input:checked + .checkmark {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.checkbox-label {
  font-size: 0.875rem;
  color: var(--text-primary);
}

.forgot-password-link,
.auth-link,
.link-primary {
  font-size: 0.875rem;
  color: #d97706;
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.forgot-password-link:hover,
.auth-link:hover,
.link-primary:hover { color: #b45309; text-decoration: none; }

[data-theme="dark"] .forgot-password-link,
[data-theme="dark"] .auth-link,
[data-theme="dark"] .link-primary { color: #fbbf24; }

[data-theme="dark"] .forgot-password-link:hover,
[data-theme="dark"] .auth-link:hover,
[data-theme="dark"] .link-primary:hover { color: #fcd34d; }

/* ========== PRIMARY BUTTON (amber gradient) ========== */
.auth-form .btn-primary,
.modern-auth-form .btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 44px;
  padding: 10px 20px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border: 1px solid #d97706;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 1px 2px rgb(0 0 0 / .08);
  margin-top: 6px;
}

.auth-form .btn-primary:hover,
.modern-auth-form .btn-primary:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  box-shadow: 0 4px 12px rgb(245 158 11 / .28);
  transform: translateY(-1px);
}

.auth-form .btn-primary:disabled,
.modern-auth-form .btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.auth-form .btn-primary i,
.modern-auth-form .btn-primary i { font-size: 0.8125rem; }

.btn-block { width: 100%; }
.btn-lg { height: 44px; }

/* ========== DIVIDER ========== */
.auth-divider {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 4px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.auth-divider span {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 500;
}

/* ========== OAUTH BUTTONS ========== */
.oauth-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-oauth {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 44px;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-oauth:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-hover);
  color: var(--text-primary);
  transform: none;
}

.btn-google i { color: #ea4335; font-size: 1rem; }

/* ========== REGISTER / SIGNUP PROMPT ========== */
.register-prompt,
.auth-footer-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 4px;
}

/* ========== CUSTOM CHECKBOX (terms) ========== */
.custom-checkbox {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.custom-checkbox input { display: none; }

.checkmark {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: transparent;
  font-size: 0.625rem;
  margin-top: 1px;
  transition: all var(--transition-fast);
}

.checkbox-text {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.checkbox-text a {
  color: #d97706;
  font-weight: 500;
  text-decoration: none;
}

.checkbox-text a:hover { color: #b45309; }
[data-theme="dark"] .checkbox-text a { color: #fbbf24; }

/* ========== PASSWORD STRENGTH METER ========== */
.password-strength-meter {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.strength-bar {
  flex: 1;
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  width: 0%;
  background: var(--error);
  transition: width 0.25s ease, background-color 0.25s ease;
  border-radius: 2px;
}

.strength-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 56px;
  text-align: right;
}

/* ========== ACCOUNT-TYPE SELECTOR (register) ========== */
.account-type-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.account-type-option { cursor: pointer; }
.account-type-option input[type="radio"] { display: none; }

.account-type-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.account-type-option input[type="radio"]:checked + .account-type-card {
  border-color: var(--primary);
  background: rgb(37 99 235 / .06);
  box-shadow: 0 0 0 3px rgb(37 99 235 / .14);
}

.account-type-card:hover { border-color: var(--border-hover); }

.account-type-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgb(37 99 235 / .1);
  color: var(--primary);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.account-type-option input[type="radio"]:checked + .account-type-card .account-type-icon {
  background: var(--primary);
  color: #fff;
}

.account-type-info { display: flex; flex-direction: column; min-width: 0; }
.account-type-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.875rem;
  line-height: 1.2;
}
.account-type-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 480px) {
  .account-type-selector { grid-template-columns: 1fr; }
}

/* ========== BETA MODAL (keep — update tokens) ========== */
.beta-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.25s ease;
  align-items: center;
  justify-content: center;
}

.beta-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.beta-modal-content {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-2xl);
  width: 90%;
  max-width: 460px;
  padding: 28px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.beta-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.beta-modal-close:hover { background: var(--bg-tertiary); color: var(--text-primary); }

.beta-modal-header {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgb(245 158 11 / .1);
  border: 1px solid rgb(245 158 11 / .22);
  color: #d97706;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.beta-badge { font-weight: 700; }

.beta-modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px;
}

.beta-modal-text {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0 0 20px;
}

.beta-modal-links {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.beta-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.beta-link:hover { background: var(--bg-tertiary); border-color: var(--border-hover); }

.beta-link-primary { background: rgb(245 158 11 / .1); border-color: rgb(245 158 11 / .24); color: #d97706; }
.beta-link-primary:hover { background: rgb(245 158 11 / .16); }
.beta-link-discord { background: rgb(88 101 242 / .1); border-color: rgb(88 101 242 / .24); color: #5865f2; }
.beta-link-discord:hover { background: rgb(88 101 242 / .16); }

.beta-modal-dismiss {
  width: 100%;
  height: 40px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.beta-modal-dismiss:hover { background: var(--bg-tertiary); border-color: var(--border-hover); }

/* ========== RESPONSIVE TWEAKS ========== */
@media (max-width: 900px) {
  .auth-brand-section { padding: 24px; }
  .auth-form-section,
  .auth-container { padding: 32px 20px 48px; min-height: 100vh; }
  .brand-title { font-size: 1.875rem; }
  .auth-title,
  .auth-form-header h2 { font-size: 1.5rem; }
}

@media (max-width: 480px) {
  .auth-form-section,
  .auth-container { padding: 24px 16px 40px; }
  .auth-form,
  .modern-auth-form { gap: 14px; }
}
