/* ============================================
   AUTH MODAL — Sign Up / Log In Overlay
   ============================================ */

/* --- Backdrop (reuses same z-index strategy as payment modal) --- */
.auth-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10010;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.auth-backdrop.active {
  opacity: 1;
  pointer-events: all;
}

/* Close */
.auth-close {
  position: fixed;
  top: 24px;
  right: 28px;
  z-index: 10012;
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.4);
  background: none;
  border: none;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.auth-close.active {
  opacity: 1;
  pointer-events: all;
}

.auth-close:hover {
  color: var(--offwhite);
  transform: scale(1.15);
}

/* --- Modal Card --- */
.auth-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 10011;
  width: 440px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  transform: translate(-50%, calc(-50% + 40px));
  opacity: 0;
  pointer-events: none;
  background: rgba(26, 26, 26, 0.9);
  border: 1.5px solid rgba(245, 200, 0, 0.2);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.7),
              -4px -4px 10px rgba(255, 255, 255, 0.03),
               4px 4px 10px rgba(0, 0, 0, 0.6);
  padding: 2.5rem;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-modal.active {
  opacity: 1;
  pointer-events: all;
  transform: translate(-50%, -50%);
}

/* --- Icon --- */
.auth-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.auth-icon svg {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--yellow);
}

/* --- Status pill --- */
.auth-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.auth-status .pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--yellow);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

.auth-status span {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--yellow);
}

/* --- Heading --- */
.auth-heading {
  font-family: var(--font-display);
  font-size: 2.4rem;
  line-height: 0.95;
  color: var(--offwhite);
  text-align: center;
  margin-bottom: 8px;
}

.auth-heading span {
  color: var(--yellow);
}

.auth-sub {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  color: rgba(247, 243, 232, 0.5);
  text-align: center;
  line-height: 1.6;
  margin-bottom: 20px;
  font-style: italic;
}

/* --- Google Sign-In Button --- */
.auth-google-btn {
  width: 100%;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.95);
  color: #333;
  border: none;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.auth-google-btn:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

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

.auth-google-btn.loading {
  opacity: 0.6;
  pointer-events: none;
}

.auth-google-btn svg {
  flex-shrink: 0;
}

/* --- Divider --- */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(245, 200, 0, 0.12);
}

.auth-divider span {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.15em;
  color: var(--muted);
  text-transform: uppercase;
  white-space: nowrap;
}

/* --- Tabs --- */
.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(245, 200, 0, 0.1);
}

.auth-tab {
  flex: 1;
  padding: 12px 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  text-align: center;
}

.auth-tab:hover {
  color: var(--offwhite);
}

.auth-tab.active {
  color: var(--yellow);
  border-bottom-color: var(--yellow);
}

/* --- Form --- */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--yellow);
}

.auth-field input {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--offwhite);
  background: rgba(13, 13, 13, 0.6);
  border: none;
  border-bottom: 2px solid rgba(245, 200, 0, 0.1);
  box-shadow: var(--neu-inset);
  transition: border-color 0.2s ease;
  outline: none;
  box-sizing: border-box;
}

.auth-field input:focus {
  border-bottom-color: var(--yellow);
}

.auth-field input::placeholder {
  color: rgba(255, 255, 255, 0.2);
}

/* --- Submit button --- */
.auth-submit {
  width: 100%;
  height: 56px;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--black);
  background: var(--yellow);
  border: none;
  box-shadow: var(--neu-shadow);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-submit:hover {
  transform: translateY(-2px);
  background: var(--accent);
}

.auth-submit:active {
  box-shadow: var(--neu-inset);
  transform: translateY(0);
}

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

/* Loading spinner */
.auth-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: var(--black);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.auth-submit.loading .auth-spinner {
  display: inline-block;
}

.auth-submit.loading .auth-submit-text {
  display: none;
}

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

/* --- Error message --- */
.auth-error {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #ff4d4d;
  text-align: center;
  min-height: 1.2em;
  margin-top: -4px;
}

/* --- Toggle link --- */
.auth-toggle {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted);
  text-align: center;
  margin-top: 8px;
}

.auth-toggle a {
  color: var(--yellow);
  text-decoration: none;
  transition: color 0.2s ease;
}

.auth-toggle a:hover {
  color: var(--accent);
}

/* --- Logged-in indicator (navbar) --- */
.auth-user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: var(--yellow);
  text-transform: uppercase;
}

.auth-user-badge__avatar {
  width: 28px;
  height: 28px;
  background: rgba(245, 200, 0, 0.12);
  border: 1px solid rgba(245, 200, 0, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--yellow);
}

.auth-logout-btn {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--muted);
  background: none;
  border: none;
  margin-left: 4px;
  transition: color 0.2s;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.auth-logout-btn:hover {
  color: #ff4d4d;
}

/* ============================================
   ADDED: Password Strength Meter
   ============================================ */
.password-strength {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.password-strength__bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}

.password-strength__fill {
  height: 100%;
  width: 0;
  border-radius: 2px;
  transition: width 0.3s ease, background 0.3s ease;
}

.password-strength__label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  min-width: 50px;
  text-align: right;
}

/* ADDED: Password Checklist */
.password-checklist {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
  list-style: none;
  padding: 0;
}

.password-check-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.05em;
  transition: color 0.2s ease;
}

.password-check-item .check-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke: var(--muted);
  transition: stroke 0.2s ease;
}

.password-check-item .check-icon--done {
  display: none;
}

.password-check-item.passed {
  color: #22c55e;
}

.password-check-item.passed .check-icon {
  display: none;
}

.password-check-item.passed .check-icon--done {
  display: block;
  stroke: #22c55e;
}

/* ============================================
   ADDED: OTP Verification Screen
   ============================================ */
.auth-otp-screen {
  text-align: center;
}

.auth-otp-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.auth-otp-icon svg {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--yellow);
}

.auth-otp-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 0.05em;
  color: var(--offwhite);
  margin-bottom: 8px;
}

.auth-otp-sub {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: 24px;
  letter-spacing: 0.05em;
}

.auth-otp-inputs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}

.otp-digit {
  width: 48px;
  height: 56px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--yellow);
  background: rgba(13, 13, 13, 0.6);
  border: 2px solid rgba(245, 200, 0, 0.15);
  border-radius: 6px;
  box-shadow: var(--neu-inset);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.otp-digit:focus {
  border-color: var(--yellow);
  box-shadow: 0 0 12px rgba(245, 200, 0, 0.15), 0 0 20px rgba(168, 85, 247, 0.1);
}

.auth-otp-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.auth-otp-resend {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--yellow);
  background: none;
  border: none;
  padding: 8px 12px;
  transition: opacity 0.2s ease;
  min-height: 44px;
}

.auth-otp-resend:hover:not(:disabled) {
  text-decoration: underline;
}

.auth-otp-timer {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.auth-otp-attempts {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--muted);
  margin-top: 8px;
  letter-spacing: 0.05em;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .auth-modal {
    padding: 1.8rem;
    width: 92vw;
  }

  .auth-heading {
    font-size: 2rem;
  }

  .otp-digit {
    width: 40px;
    height: 48px;
    font-size: 1.2rem;
  }

  .auth-otp-inputs {
    gap: 6px;
  }
}
