/* ============================================================
   AUTH PAGES — auth.css
   Extends core.css for login, register, password-reset pages
   ============================================================ */

/* ---------- PAGE LAYOUT ---------- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-height) + var(--space-xl)) var(--space-md) var(--space-2xl);
}

/* ---------- AUTH CARD ---------- */
.auth-card {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(145deg, rgba(26,22,18,.95), rgba(18,16,12,.98));
  border: 1px solid var(--dark-border-warm);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-gold);
}

/* Warm inner glow (same as .card) */
.auth-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 30% 0%, rgba(201,168,76,.06) 0%, transparent 50%),
    linear-gradient(135deg, rgba(201,168,76,.04) 0%, transparent 40%);
  pointer-events: none;
}

/* ---------- AUTH HEADER ---------- */
.auth-header {
  text-align: center;
  margin-bottom: var(--space-xl);
  position: relative;
}

.auth-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-md);
  filter: drop-shadow(0 0 16px rgba(201,168,76,.35));
}

.auth-header h2 {
  font-size: 1.5rem;
  margin-bottom: var(--space-xs);
}

.auth-header h2::after {
  content: '';
  display: block;
  width: 50px;
  height: 2px;
  background: var(--gold-gradient);
  border-radius: 2px;
  margin: var(--space-sm) auto 0;
}

.auth-subtitle {
  color: var(--cream-dim);
  font-size: 0.9rem;
  margin-top: var(--space-sm);
  line-height: 1.5;
}

/* ---------- FORM FIELDS ---------- */
.auth-form .form-group {
  margin-bottom: var(--space-md);
}

.auth-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cream-soft);
  margin-bottom: var(--space-xs);
  letter-spacing: 0.3px;
}

.auth-form .form-input-v2 {
  width: 100%;
}

/* Password wrapper for toggle */
.password-wrapper {
  position: relative;
}

.password-wrapper .form-input-v2 {
  padding-right: 3rem;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--cream-dim);
  font-size: 0.8rem;
  cursor: pointer;
  transition: color var(--duration) var(--ease-out);
  background: none;
  border: none;
  padding: 4px;
}

.password-toggle:hover {
  color: var(--gold);
}

/* ---------- AUTH BUTTONS ---------- */
.auth-form .btn {
  width: 100%;
  margin-top: var(--space-sm);
}

/* ---------- DIVIDER ---------- */
.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
  color: var(--cream-dim);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

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

/* ---------- SOCIAL LOGIN BUTTONS ---------- */
.social-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  width: 100%;
  padding: 0.75rem 1.2rem;
  background: var(--dark-surface);
  border: 1px solid var(--dark-border-warm);
  border-radius: var(--radius-md);
  color: var(--cream);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration) var(--ease-out);
  text-decoration: none;
}

.social-btn:hover {
  border-color: rgba(201,168,76,.35);
  background: rgba(201,168,76,.08);
  color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}

.social-btn img {
  width: 20px;
  height: 20px;
}

/* ---------- AUTH LINKS ---------- */
.auth-links {
  text-align: center;
  margin-top: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.auth-links a {
  color: var(--cream-dim);
  font-size: 0.85rem;
  transition: color var(--duration) var(--ease-out);
}

.auth-links a:hover {
  color: var(--gold);
}

/* ---------- LOADING SPINNER ---------- */
.auth-spinner-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(12,11,9,.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.auth-spinner-overlay.active {
  display: flex;
}

.auth-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--dark-border-warm);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: authSpin 0.8s linear infinite;
}

.auth-spinner-text {
  margin-top: var(--space-md);
  color: var(--gold);
  font-weight: 600;
  font-size: 0.9rem;
}

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

/* ---------- SIGNUP MODAL (social login flow) ---------- */
.auth-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(6px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.auth-modal-overlay.active {
  display: flex;
}

.auth-modal {
  background: var(--dark-card);
  border: 1px solid var(--dark-border-warm);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  max-width: 420px;
  width: 90%;
  box-shadow: var(--shadow-gold);
  position: relative;
}

.auth-modal h3 {
  font-size: 1.2rem;
  margin-bottom: var(--space-md);
}

.auth-modal p {
  color: var(--cream-dim);
  font-size: 0.9rem;
  margin-bottom: var(--space-md);
  line-height: 1.5;
}

.auth-modal-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
  margin-top: var(--space-lg);
}

/* ---------- MODAL CLOSE BUTTON ---------- */
.modal-close-btn {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  background: none;
  border: none;
  color: var(--cream-dim);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color var(--duration) var(--ease-out), background var(--duration) var(--ease-out);
}

.modal-close-btn:hover {
  color: var(--gold);
  background: rgba(201,168,76,.1);
}

/* ---------- AUTH MODAL OVERLAY (landing page modals) ---------- */
.auth-modal-overlay {
  overflow-y: auto;
  padding: var(--space-xl) var(--space-md);
}

.auth-modal-overlay > .auth-card {
  margin: auto;
  overflow: visible;
}

/* ---------- ERROR MESSAGE ---------- */
.auth-error {
  background: rgba(231,76,60,.12);
  border: 1px solid rgba(231,76,60,.3);
  color: var(--red);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-top: var(--space-sm);
  display: none;
}

.auth-error.visible {
  display: block;
}

.auth-hint {
  color: var(--cream-dim);
  font-size: 0.8rem;
  margin-top: var(--space-xs);
  opacity: .7;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 480px) {
  .auth-card {
    padding: var(--space-xl) var(--space-lg);
    border-radius: var(--radius-md);
  }

  .auth-logo {
    width: 52px;
    height: 52px;
  }

  .auth-header h2 {
    font-size: 1.3rem;
  }
}
