/* ══ AUTH OVERLAY ══ */

#auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  align-items: flex-end; /* mobile: sheet from bottom */
  background: rgba(7, 9, 15, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity 0.4s ease;
  padding: 0;
}

#auth-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: clamp(28px, 6vw, 44px) clamp(20px, 6vw, 36px) clamp(24px, 5vw, 36px);
  text-align: center;
  position: relative;
  z-index: 10;
  /* mobile: full-width bottom sheet */
  border-radius: 30px 30px 0 0;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.auth-card:hover {
  transform: translateY(-4px);
}

.auth-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.auth-title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.3rem, 4vw, 1.6rem);
  font-weight: 400;
  background: linear-gradient(to bottom, #ffffff, #a1a1aa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.auth-tabs {
  display: flex;
  gap: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  padding: clamp(9px, 2.5vw, 11px);
  border: none;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.auth-tab.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

/* Inputs */
.input-group {
  position: relative;
  margin-bottom: 12px;
}

.input-group input {
  width: 100%;
  padding: clamp(12px, 3vw, 14px) 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  color: #fff;
  font-size: 1rem; /* 16px prevents iOS zoom */
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
  -webkit-appearance: none;
  appearance: none;
}

.input-group input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.input-group input:focus {
  border-color: rgba(99, 102, 241, 0.6);
  background: rgba(99, 102, 241, 0.06);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

/* Primary button */
.auth-btn-primary {
  width: 100%;
  padding: clamp(13px, 3.5vw, 15px);
  margin-top: 6px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-height: 48px;
}

.auth-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.auth-btn-primary:active {
  transform: scale(0.97);
}

.auth-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: rgba(255, 255, 255, 0.2);
  font-size: 0.75rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

/* Google button */
.auth-btn-google {
  width: 100%;
  padding: clamp(11px, 3vw, 13px);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-height: 48px;
}

.auth-btn-google:hover,
.auth-btn-google:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  outline: none;
}

/* Messages */
.auth-message {
  margin-top: 14px;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 0.78rem;
  display: none;
  text-align: left;
  line-height: 1.5;
}

.auth-message.error {
  display: block;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.auth-message.success {
  display: block;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
}

/* Spinner */
.spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto;
}

.auth-btn-primary.loading .btn-text { display: none; }
.auth-btn-primary.loading .spinner  { display: inline-block; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Desktop: centered card ── */
@media (min-width: 480px) {
  #auth-overlay {
    align-items: center;
    padding: 20px;
  }

  .auth-card {
    border-radius: 30px;
  }
}