/* ========================================
   MOLFORGE AUTH PAGE - STYLES
   Split-screen: Brand panel + Auth form
   Variables defined in theme.css
   ======================================== */

/* ========================================
   BASE
   ======================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--background);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ========================================
   SPLIT-SCREEN CONTAINER
   ======================================== */
.auth-container {
  display: flex;
  min-height: 100vh;
}

/* ========================================
   LEFT PANEL — BRAND
   ======================================== */
.auth-brand {
  display: none;
  width: 45%;
  background: var(--background);
  position: relative;
  overflow: hidden;
  padding: 3rem;
  align-items: center;
  justify-content: center;
}

.brand-content {
  position: relative;
  z-index: 2;
  max-width: 480px;
}

.brand-logo {
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}

.brand-logo i {
  color: var(--primary);
  -webkit-text-fill-color: var(--primary);
  font-size: 1.75rem;
}

.auth-brand h1 {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--text) 0%, var(--primary) 50%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.25rem;
}

.auth-brand p {
  color: var(--text-light);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 2.5rem;
}

.brand-stats {
  display: flex;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-size: 1.75rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.15rem;
}

.brand-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.brand-feature {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-light);
}

.brand-feature i {
  color: var(--primary);
  font-size: 0.85rem;
}

/* Decorative orbs */
.brand-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  z-index: 1;
}

.brand-orb-1 {
  width: 400px;
  height: 400px;
  background: var(--glow-orb-1);
  top: -100px;
  right: -100px;
  animation: float1 12s ease-in-out infinite;
}

.brand-orb-2 {
  width: 300px;
  height: 300px;
  background: var(--glow-orb-2);
  bottom: -50px;
  left: -50px;
  animation: float2 15s ease-in-out infinite;
}

.brand-orb-3 {
  width: 200px;
  height: 200px;
  background: var(--glow-orb-1);
  top: 50%;
  left: 50%;
  animation: float3 10s ease-in-out infinite;
}

@keyframes float1 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-30px, 40px); } }
@keyframes float2 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(20px, -30px); } }
@keyframes float3 { 0%, 100% { transform: translate(-50%, -50%); } 50% { transform: translate(-50%, -60%); } }

/* ========================================
   RIGHT PANEL — FORM
   ======================================== */
.auth-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  position: relative;
  background: var(--form-panel-bg);
}

.auth-form-wrapper {
  width: 100%;
  max-width: 420px;
}

/* Mobile logo (visible on mobile) */
.auth-mobile-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  margin-bottom: 2rem;
  justify-content: center;
}

.auth-mobile-logo i {
  color: var(--primary);
  -webkit-text-fill-color: var(--primary);
  font-size: 1.75rem;
}

/* ========================================
   TABS
   ======================================== */
.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.75rem;
  border-bottom: 2px solid var(--card-border);
}

.auth-tab {
  flex: 1;
  padding: 0.75rem 1rem;
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
  font-family: inherit;
}

.auth-tab::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  transition: background 0.2s;
}

.auth-tab.active {
  color: var(--primary);
}

.auth-tab.active::after {
  background: var(--gradient);
}

.auth-tab:hover:not(.active) {
  color: var(--text);
}

/* ========================================
   GOOGLE BUTTON
   ======================================== */
.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--google-bg);
  color: var(--google-text);
  border: 1px solid var(--google-border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-google:hover {
  background: var(--google-hover);
  box-shadow: var(--shadow);
}

.btn-google:active {
  transform: scale(0.98);
}

.google-icon {
  flex-shrink: 0;
}

/* ========================================
   DIVIDER
   ======================================== */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.25rem 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--card-border);
}

.auth-divider span {
  font-size: 0.8rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ========================================
   FORM STYLES
   ======================================== */
.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 0.875rem;
  color: var(--text-light);
  font-size: 0.85rem;
  pointer-events: none;
  z-index: 1;
}

.input-wrapper input {
  width: 100%;
  padding: 0.75rem 0.875rem 0.75rem 2.5rem;
  background: var(--input-bg);
  border: 1.5px solid var(--card-border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.2s;
}

.input-wrapper input::placeholder {
  color: var(--text-light);
  opacity: 0.6;
}

.input-wrapper input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--input-focus-bg);
  box-shadow: 0 0 0 3px var(--glow-orb-1);
}

.input-wrapper input.error {
  border-color: var(--error);
}

.toggle-password {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 0.25rem;
  font-size: 0.85rem;
  transition: color 0.2s;
}

.toggle-password:hover {
  color: var(--primary);
}

.field-error {
  display: block;
  font-size: 0.8rem;
  color: var(--error);
  margin-top: 0.3rem;
  min-height: 0;
}

.forgot-link {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.8rem;
  cursor: pointer;
  font-weight: 500;
  font-family: inherit;
  transition: opacity 0.2s;
}

.forgot-link:hover {
  opacity: 0.8;
}

/* ========================================
   PASSWORD STRENGTH
   ======================================== */
.password-strength {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.strength-bar {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--card-border);
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: all 0.3s;
}

.strength-text {
  font-size: 0.75rem;
  font-weight: 600;
  min-width: 50px;
  text-align: right;
}

/* ========================================
   SUBMIT BUTTON
   ======================================== */
.btn-submit {
  width: 100%;
  padding: 0.8rem 1.5rem;
  background: var(--gradient);
  color: var(--text-on-gradient);
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  box-shadow: var(--cta-glow);
  margin-top: 0.5rem;
  position: relative;
  overflow: hidden;
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--cta-glow-hover);
}

.btn-submit:active:not(:disabled) {
  transform: translateY(0);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ========================================
   AUTH SWITCH LINKS
   ======================================== */
.auth-switch {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.9rem;
  color: var(--text-light);
}

.switch-link {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  transition: opacity 0.2s;
}

.switch-link:hover {
  opacity: 0.8;
}

/* ========================================
   FORGOT PASSWORD
   ======================================== */
.forgot-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.forgot-desc {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* ========================================
   TOAST
   ======================================== */
.auth-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 1000;
  animation: toastIn 0.3s ease;
  max-width: 90%;
}

.auth-toast.success {
  background: var(--success);
  color: #fff;
}

.auth-toast.error {
  background: var(--error);
  color: #fff;
}

.auth-toast.info {
  background: var(--primary);
  color: #fff;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ========================================
   REFERRAL BADGE
   ======================================== */
.referral-badge {
  margin-top: 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--cta-section-bg);
  border: 1px solid var(--accent-border);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.referral-badge i {
  color: var(--primary);
  font-size: 1.1rem;
}

/* ========================================
   THEME TOGGLE
   ======================================== */
.auth-theme-toggle {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s;
}

.auth-theme-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.auth-theme-toggle .fa-moon { display: inline-block; }
.auth-theme-toggle .fa-sun { display: none; }

:root.light-theme .auth-theme-toggle .fa-moon { display: none; }
:root.light-theme .auth-theme-toggle .fa-sun { display: inline-block; }

@media (prefers-color-scheme: light) {
  :root:not(.dark-theme) .auth-theme-toggle .fa-moon { display: none; }
  :root:not(.dark-theme) .auth-theme-toggle .fa-sun { display: inline-block; }
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (min-width: 768px) {
  .auth-brand {
    display: flex;
  }

  .auth-mobile-logo {
    display: none;
  }

  .auth-form-panel {
    width: 55%;
    flex: none;
  }
}

@media (min-width: 992px) {
  .auth-brand {
    width: 50%;
    padding: 4rem;
  }

  .auth-form-panel {
    width: 50%;
  }

  .auth-brand h1 {
    font-size: 3rem;
  }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ========================================
   NAV AUTH STYLES (shared across pages)
   ======================================== */
.nav-auth-slot {
  display: flex;
  align-items: center;
}

.nav-user-menu {
  position: relative;
}

.nav-user-btn {
  background: none;
  border: 2px solid var(--card-border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: border-color 0.2s;
  padding: 0;
}

.nav-user-btn:hover {
  border-color: var(--primary);
}

.nav-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.nav-avatar-initials {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-on-gradient);
  background: var(--gradient);
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.nav-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 0.75rem 0;
  z-index: 100;
}

.nav-dropdown-name {
  padding: 0.25rem 1rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.nav-dropdown-email {
  padding: 0 1rem 0.5rem;
  font-size: 0.8rem;
  color: var(--text-light);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-dropdown-divider {
  border: none;
  border-top: 1px solid var(--card-border);
  margin: 0.35rem 0;
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
  transition: background 0.15s;
  cursor: pointer;
  width: 100%;
  background: none;
  border: none;
  font-family: inherit;
}

.nav-dropdown-item:hover {
  background: var(--card-bg);
  color: var(--primary);
}

.nav-dropdown-signout {
  color: var(--error);
}

.nav-dropdown-signout:hover {
  color: var(--error);
}
