/* =========================================================
   IMOBI — Auth Page Stylesheet
   Dark Neon Theme | Login + Register
   ========================================================= */

/* ---------- RESET & VARIABLES ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Background */
  --bg-primary: #0a0a0f;
  --bg-secondary: #0f0f1a;
  --bg-tertiary: #141425;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);

  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(255, 255, 255, 0.15);

  /* Text */
  --text-primary: #f0f0f5;
  --text-secondary: #a0a0b8;
  --text-muted: #6a6a80;

  /* Accent Colors */
  --neon-purple: #a855f7;
  --neon-purple-glow: rgba(168, 85, 247, 0.3);
  --neon-cyan: #00d4ff;
  --neon-cyan-glow: rgba(0, 212, 255, 0.3);
  --neon-green: #06d6a0;
  --neon-green-glow: rgba(6, 214, 160, 0.3);
  --neon-pink: #f472b6;
  --neon-orange: #fb923c;
  --neon-red: #ef4444;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, var(--neon-purple), var(--neon-cyan));

  /* Typography */
  --font-display: 'Syne', sans-serif;
  --font-body: 'Outfit', sans-serif;

  /* Borders */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 100px;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  color: var(--neon-cyan);
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--neon-purple);
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ---------- UTILITIES ---------- */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.95rem;
  font-family: var(--font-body);
  transition: all var(--transition-base);
  cursor: pointer;
  border: none;
  white-space: nowrap;
}

.btn--primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 0 20px var(--neon-purple-glow), 0 0 40px rgba(168, 85, 247, 0.1);
}

.btn--primary:hover {
  box-shadow: 0 0 30px var(--neon-purple-glow), 0 0 60px rgba(168, 85, 247, 0.2);
  transform: translateY(-2px);
}

.btn--primary:active {
  transform: translateY(0);
}

.btn--lg {
  padding: 0.9rem 2rem;
  font-size: 1rem;
}

.btn--full {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ---------- BACKGROUND EFFECTS ---------- */
.auth-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.auth-bg__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
}

.auth-bg__orb--1 {
  width: 500px;
  height: 500px;
  background: var(--neon-purple);
  top: -15%;
  left: -10%;
  animation: orbFloat 12s ease-in-out infinite;
}

.auth-bg__orb--2 {
  width: 400px;
  height: 400px;
  background: var(--neon-cyan);
  bottom: -10%;
  right: -10%;
  animation: orbFloat 15s ease-in-out infinite reverse;
}

.auth-bg__orb--3 {
  width: 300px;
  height: 300px;
  background: var(--neon-green);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.15;
  animation: orbFloat 10s ease-in-out infinite;
}

.auth-bg__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(30px, -20px); }
  66% { transform: translate(-20px, 20px); }
}

/* ---------- AUTH PAGE LAYOUT ---------- */
.auth-page {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* ---------- LEFT PANEL — BRANDING ---------- */
.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  position: relative;
}

.auth-brand__inner {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100%;
  max-width: 480px;
}

.auth-brand__logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: inherit;
  margin-bottom: 3rem;
}

.logo__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: var(--radius-md);
  background: var(--gradient-primary);
  font-size: 1.2rem;
  color: #fff;
}

.logo__text {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.auth-brand__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-brand__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.2rem;
}

.auth-brand__desc {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 2.5rem;
}

.auth-brand__features {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.auth-brand__feature {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.auth-brand__feature i {
  color: var(--neon-green);
  font-size: 1.2rem;
  flex-shrink: 0;
}

.auth-brand__footer {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 3rem;
}

/* ---------- RIGHT PANEL — FORMS ---------- */
.auth-form-section {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  overflow-y: auto;
}

.auth-form-wrapper {
  width: 100%;
  max-width: 440px;
  position: relative;
}

/* Mobile Logo (hidden on desktop) */
.auth-mobile-logo {
  display: none;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: inherit;
  margin-bottom: 2rem;
  justify-content: center;
}

/* ---------- AUTH TABS ---------- */
.auth-tabs {
  display: flex;
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  padding: 4px;
  margin-bottom: 2rem;
}

.auth-tab {
  flex: 1;
  padding: 0.65rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-family: var(--font-body);
  transition: color var(--transition-base);
  position: relative;
  z-index: 2;
}

.auth-tab--active {
  color: var(--text-primary);
}

.auth-tabs__indicator {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  border: 1px solid var(--glass-border-hover);
  transition: transform var(--transition-base);
  z-index: 1;
}

.auth-tabs[data-active="register"] .auth-tabs__indicator {
  transform: translateX(100%);
}

/* ---------- AUTH PANELS ---------- */
.auth-panel {
  display: none;
  animation: panelFadeIn 0.35s ease;
}

.auth-panel--active {
  display: block;
}

@keyframes panelFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- AUTH HEADER ---------- */
.auth-header {
  margin-bottom: 1.5rem;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 0.3rem;
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

/* ---------- SOCIAL BUTTON ---------- */
.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.8rem 1.5rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.92rem;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition-base);
}

.btn-social:hover {
  background: var(--bg-card-hover);
  border-color: var(--glass-border-hover);
  transform: translateY(-1px);
}

.btn-social:active {
  transform: translateY(0);
}

/* ---------- DIVIDER ---------- */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
}

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

.auth-divider span {
  color: var(--text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

/* ---------- FORM STYLES ---------- */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.form-link {
  font-size: 0.8rem;
  color: var(--neon-cyan);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.form-link:hover {
  color: var(--neon-purple);
}

.form-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input-wrapper > i:first-child {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  font-size: 1.1rem;
  pointer-events: none;
  transition: color var(--transition-fast);
}

.form-input {
  width: 100%;
  padding: 0.8rem 1rem 0.8rem 2.8rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.92rem;
  font-family: var(--font-body);
  transition: all var(--transition-base);
  outline: none;
}

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

.form-input:focus {
  border-color: var(--neon-purple);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
  background: rgba(255, 255, 255, 0.06);
}

.form-input:focus + .form-toggle-password,
.form-input:focus ~ .form-toggle-password {
  color: var(--text-secondary);
}

.form-input-wrapper:focus-within > i:first-child {
  color: var(--neon-purple);
}

/* Input Error State */
.form-input--error {
  border-color: var(--neon-red) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.form-error {
  font-size: 0.78rem;
  color: var(--neon-red);
  min-height: 0;
  overflow: hidden;
  transition: all var(--transition-fast);
}

.form-error:not(:empty) {
  min-height: 1.2rem;
}

/* Toggle Password */
.form-toggle-password {
  position: absolute;
  right: 0.8rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.3rem;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  transition: color var(--transition-fast);
}

.form-toggle-password:hover {
  color: var(--text-primary);
}

/* ---------- ACCOUNT TYPE SELECTOR ---------- */
.account-type-selector {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.account-type-option {
  cursor: pointer;
}

.account-type-option__inner {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.9rem 1rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

.account-type-option:hover .account-type-option__inner {
  border-color: var(--glass-border-hover);
  background: var(--bg-card-hover);
}

.account-type-option--active .account-type-option__inner {
  border-color: rgba(168, 85, 247, 0.4);
  background: rgba(168, 85, 247, 0.05);
}

.account-type-option__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-sm);
  background: rgba(168, 85, 247, 0.1);
  color: var(--neon-purple);
  font-size: 1.2rem;
  flex-shrink: 0;
}

.account-type-option__icon--cyan {
  background: rgba(0, 212, 255, 0.1);
  color: var(--neon-cyan);
}

.account-type-option__text {
  flex: 1;
}

.account-type-option__text strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
}

.account-type-option__text span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.account-type-option__check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 2px solid var(--glass-border);
  color: transparent;
  font-size: 0.7rem;
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.account-type-option--active .account-type-option__check {
  border-color: var(--neon-purple);
  background: var(--neon-purple);
  color: #fff;
}

/* ---------- PASSWORD STRENGTH ---------- */
.password-strength {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.3rem;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.password-strength--visible {
  opacity: 1;
}

.password-strength__bar {
  flex: 1;
  height: 3px;
  background: var(--glass-border);
  border-radius: 3px;
  overflow: hidden;
}

.password-strength__fill {
  height: 100%;
  width: 0;
  border-radius: 3px;
  transition: width var(--transition-base), background var(--transition-base);
}

.password-strength__text {
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
  min-width: 50px;
}

/* Strength levels */
.password-strength--weak .password-strength__fill {
  width: 25%;
  background: var(--neon-red);
}
.password-strength--weak .password-strength__text {
  color: var(--neon-red);
}

.password-strength--fair .password-strength__fill {
  width: 50%;
  background: var(--neon-orange);
}
.password-strength--fair .password-strength__text {
  color: var(--neon-orange);
}

.password-strength--good .password-strength__fill {
  width: 75%;
  background: var(--neon-cyan);
}
.password-strength--good .password-strength__text {
  color: var(--neon-cyan);
}

.password-strength--strong .password-strength__fill {
  width: 100%;
  background: var(--neon-green);
}
.password-strength--strong .password-strength__text {
  color: var(--neon-green);
}

/* ---------- CHECKBOX ---------- */
.form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.form-checkbox input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.form-checkbox__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  min-width: 1.25rem;
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  background: var(--glass-bg);
  color: transparent;
  font-size: 0.65rem;
  transition: all var(--transition-fast);
  margin-top: 1px;
}

.form-checkbox input:checked + .form-checkbox__mark {
  background: var(--neon-purple);
  border-color: var(--neon-purple);
  color: #fff;
}

.form-checkbox input:focus-visible + .form-checkbox__mark {
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

.form-checkbox__text a {
  color: var(--neon-cyan);
}

/* ---------- FOOTER TEXT ---------- */
.auth-footer-text {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.auth-switch {
  background: none;
  border: none;
  color: var(--neon-cyan);
  font-weight: 600;
  font-family: var(--font-body);
  font-size: 0.88rem;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.auth-switch:hover {
  color: var(--neon-purple);
}

/* ---------- TOAST NOTIFICATION ---------- */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.5rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.toast--visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.toast--success .toast__icon {
  color: var(--neon-green);
}

.toast--error .toast__icon {
  color: var(--neon-red);
}

.toast__icon {
  font-size: 1.2rem;
  display: flex;
}

.toast__message {
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
}

/* ---------- LOADING SPINNER ON BUTTON ---------- */
.btn--loading {
  pointer-events: none;
  position: relative;
  color: transparent !important;
}

.btn--loading::after {
  content: '';
  position: absolute;
  width: 1.2rem;
  height: 1.2rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    display: none;
  }

  .auth-form-section {
    padding: 2rem 1.5rem;
    min-height: 100vh;
  }

  .auth-mobile-logo {
    display: flex;
  }
}

@media (max-width: 480px) {
  .auth-form-wrapper {
    max-width: 100%;
  }

  .auth-title {
    font-size: 1.4rem;
  }

  .account-type-option__inner {
    padding: 0.75rem;
  }

  .account-type-option__text strong {
    font-size: 0.85rem;
  }
}