/* ============================================================
   AUTH.CSS — Authentication Modal Styles
   ============================================================
   
   The auth modal is a full-screen overlay with a centered card.
   It contains login/signup tabs, form fields, Google sign-in
   button, and error messages.
   ============================================================ */


/* ── Modal Overlay ──────────────────────────────────────────── */

.auth-modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  padding: var(--space-md);
}

.auth-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}


/* ── Modal Card ─────────────────────────────────────────────── */

.auth-modal-card {
  background: var(--color-surface-solid);
  border-radius: var(--border-radius);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 440px;
  position: relative;
  transform: translateY(20px) scale(0.97);
  transition: transform var(--transition-normal);
  overflow: hidden;
}

.auth-modal-overlay.active .auth-modal-card {
  transform: translateY(0) scale(1);
}

/* Close button */
.auth-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
  z-index: 1;
  font-size: 1.2rem;
  cursor: pointer;
}

.auth-modal-close:hover {
  background: var(--color-border);
  color: var(--color-text);
}


/* ── Header with gradient ───────────────────────────────────── */

.auth-header {
  background: var(--gradient-primary);
  padding: var(--space-xl) var(--space-xl) var(--space-lg);
  text-align: center;
  color: white;
}

.auth-header .auth-logo {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-sm);
}

.auth-header .auth-logo svg {
  width: 26px;
  height: 26px;
  stroke: white;
  fill: none;
  stroke-width: 2;
}

.auth-header h2 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.auth-header p {
  font-size: 0.82rem;
  opacity: 0.85;
}


/* ── Tabs (Login / Sign Up) ─────────────────────────────────── */

.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--color-border);
}

.auth-tab {
  flex: 1;
  padding: 14px;
  text-align: center;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  background: none;
  border: none;
}

.auth-tab:hover {
  color: var(--color-text);
  background: rgba(79, 70, 229, 0.04);
}

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

.auth-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 20%;
  right: 20%;
  height: 3px;
  background: var(--gradient-primary);
  border-radius: 3px 3px 0 0;
}


/* ── Form Body ──────────────────────────────────────────────── */

.auth-body {
  padding: var(--space-lg) var(--space-xl) var(--space-xl);
}


/* ── Form Fields ────────────────────────────────────────────── */

.auth-field {
  margin-bottom: var(--space-md);
}

.auth-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

.auth-field input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--color-border);
  border-radius: var(--border-radius-xs);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 0.9rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.auth-field input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

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


/* ── Error Message ──────────────────────────────────────────── */

.auth-error {
  display: none;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--color-danger);
  padding: 10px 14px;
  border-radius: var(--border-radius-xs);
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: var(--space-md);
  line-height: 1.5;
}


/* ── Submit Button ──────────────────────────────────────────── */

.auth-submit-btn {
  width: 100%;
  padding: 13px;
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: var(--border-radius-xs);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

.auth-submit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.auth-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}


/* ── Divider ────────────────────────────────────────────────── */

.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  font-weight: 500;
}

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


/* ── Google Button ──────────────────────────────────────────── */

.google-btn {
  width: 100%;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: var(--border-radius-xs);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.google-btn:hover:not(:disabled) {
  border-color: var(--color-text-muted);
  background: var(--color-surface);
}

.google-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.google-btn .google-icon {
  width: 20px;
  height: 20px;
}


/* ── Sidebar Profile Section ────────────────────────────────── */

.sidebar-profile {
  display: none;  /* hidden until auth state says logged in */
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-top: var(--glass-border);
}

.sidebar-profile .profile-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-profile .profile-info {
  flex: 1;
  min-width: 0;
}

.sidebar-profile .profile-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-profile .profile-email {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-logout-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--border-radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
  flex-shrink: 0;
  cursor: pointer;
}

.sidebar-logout-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-danger);
}

.sidebar-logout-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}


/* ── Sidebar Login Button ───────────────────────────────────── */

.sidebar-login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  width: calc(100% - 2 * var(--space-lg));
  margin: 0 var(--space-lg) var(--space-md);
  padding: 10px;
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
}

.sidebar-login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.35);
}

.sidebar-login-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}


/* ============================================================
   WELCOME GATE MODAL — Shown on First Visit
   ============================================================ */

.welcome-modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2500;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  padding: var(--space-md);
}

.welcome-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.welcome-modal-card {
  background: var(--color-surface-solid);
  border-radius: var(--border-radius);
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 460px;
  transform: translateY(30px) scale(0.95);
  transition: transform var(--transition-normal);
  overflow: hidden;
  text-align: center;
}

.welcome-modal-overlay.active .welcome-modal-card {
  transform: translateY(0) scale(1);
}

/* ── Welcome Header ─────────────────────────────────────────── */

.welcome-header {
  background: var(--gradient-primary);
  padding: var(--space-2xl) var(--space-xl) var(--space-xl);
  color: white;
  position: relative;
  overflow: hidden;
}

.welcome-header::before {
  content: '';
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  top: -60px;
  right: -40px;
}

.welcome-header::after {
  content: '';
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  bottom: -30px;
  left: -20px;
}

.welcome-logo {
  width: 64px;
  height: 64px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-md);
  backdrop-filter: blur(10px);
}

.welcome-logo svg {
  width: 34px;
  height: 34px;
  stroke: white;
  fill: none;
  stroke-width: 2;
}

.welcome-header h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.welcome-header p {
  font-size: 0.88rem;
  opacity: 0.9;
  line-height: 1.5;
  max-width: 320px;
  margin: 0 auto;
}

/* ── Welcome Actions ────────────────────────────────────────── */

.welcome-body {
  padding: var(--space-xl);
}

.welcome-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.welcome-btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: var(--border-radius-xs);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

.welcome-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.4);
}

.welcome-btn-secondary {
  width: 100%;
  padding: 14px;
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
  border-radius: var(--border-radius-xs);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

.welcome-btn-secondary:hover {
  background: rgba(79, 70, 229, 0.06);
  transform: translateY(-1px);
}

.welcome-divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-md) 0;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  font-weight: 500;
}

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

.welcome-btn-ghost {
  width: 100%;
  padding: 12px;
  background: transparent;
  color: var(--color-text-muted);
  border: none;
  border-radius: var(--border-radius-xs);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.welcome-btn-ghost:hover {
  color: var(--color-text);
  background: rgba(79, 70, 229, 0.04);
}

.welcome-btn-ghost svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  vertical-align: middle;
  margin-right: 4px;
}


/* ============================================================
   PROFILE COMPLETION MODAL — Shown After Login
   ============================================================ */

.profile-complete-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2100;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  padding: var(--space-md);
}

.profile-complete-overlay.active {
  opacity: 1;
  visibility: visible;
}

.profile-complete-card {
  background: var(--color-surface-solid);
  border-radius: var(--border-radius);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 460px;
  transform: translateY(20px) scale(0.97);
  transition: transform var(--transition-normal);
  overflow: hidden;
}

.profile-complete-overlay.active .profile-complete-card {
  transform: translateY(0) scale(1);
}

/* ── Profile Modal Header ───────────────────────────────────── */

.profile-complete-header {
  background: var(--gradient-primary);
  padding: var(--space-xl);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  color: white;
}

.profile-modal-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  border: 3px solid rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
}

.profile-complete-header .header-text h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.profile-complete-header .header-text p {
  font-size: 0.82rem;
  opacity: 0.85;
}

/* ── Profile Modal Body ─────────────────────────────────────── */

.profile-complete-body {
  padding: var(--space-lg) var(--space-xl) var(--space-xl);
}

.profile-complete-body .profile-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.profile-complete-body .profile-modal-grid .auth-field:last-child {
  grid-column: 1 / -1;
}

/* ── Profile Modal Actions ──────────────────────────────────── */

.profile-complete-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.profile-complete-actions .auth-submit-btn {
  flex: 1;
}

.profile-skip-btn {
  padding: 13px 20px;
  background: transparent;
  color: var(--color-text-muted);
  border: 2px solid var(--color-border);
  border-radius: var(--border-radius-xs);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.profile-skip-btn:hover {
  border-color: var(--color-text-muted);
  color: var(--color-text);
  background: rgba(79, 70, 229, 0.04);
}

/* ── Profile Save Toast ─────────────────────────────────────── */

.profile-save-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--color-success);
  color: white;
  padding: 12px 24px;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  font-size: 0.88rem;
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  z-index: 3000;
}

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


/* ── Responsive ─────────────────────────────────────────────── */

@media (max-width: 480px) {
  .auth-modal-card {
    max-width: 100%;
    border-radius: var(--border-radius-sm);
  }

  .auth-body {
    padding: var(--space-md);
  }

  .auth-header {
    padding: var(--space-lg) var(--space-md);
  }

  .welcome-modal-card {
    max-width: 100%;
    border-radius: var(--border-radius-sm);
  }

  .welcome-body {
    padding: var(--space-md);
  }

  .welcome-header {
    padding: var(--space-xl) var(--space-md) var(--space-lg);
  }

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

  .profile-complete-card {
    max-width: 100%;
    border-radius: var(--border-radius-sm);
  }

  .profile-complete-body {
    padding: var(--space-md);
  }

  .profile-complete-body .profile-modal-grid {
    grid-template-columns: 1fr;
  }

  .profile-complete-actions {
    flex-direction: column-reverse;
  }

  .profile-skip-btn {
    width: 100%;
    text-align: center;
  }
}
