/* ========================================
   Auth Modal — Login / Register / Reset
   ======================================== */

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-overlay.open { display: flex; }

.auth-modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  overflow: hidden;
  animation: authSlideUp 0.3s ease;
}

@keyframes authSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-modal__header {
  padding: 28px 28px 0;
  text-align: center;
}

.auth-modal__logo {
  width: 180px;
  height: auto;
  margin-bottom: 8px;
}

.auth-modal__title {
  font-family: var(--font-display, 'Bebas Neue', sans-serif);
  font-size: 1.5rem;
  letter-spacing: 2px;
  margin: 0;
}

.auth-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px;
  margin: 0;
  border: none;
  border-radius: 8px;
  background: #1a1a1a;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s;
}
.auth-google-btn:hover {
  background: #333;
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 12px 0;
  color: #999;
  font-size: 0.8rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #ddd;
}
.auth-divider span {
  padding: 0 12px;
}

.auth-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  cursor: pointer;
  color: #999;
  padding: 4px;
}
.auth-modal__close:hover { color: #333; }

/* Tabs */
.auth-tabs {
  display: flex;
  border-bottom: 2px solid #f0f0f0;
  margin: 20px 28px 0;
}

.auth-tab {
  flex: 1;
  background: none;
  border: none;
  padding: 10px 0;
  font-size: 13px;
  font-weight: 600;
  color: #999;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
  font-family: inherit;
}

.auth-tab.active {
  color: #212121;
  border-bottom-color: #212121;
}

/* Form */
.auth-form {
  padding: 24px 28px 28px;
  display: none;
}
.auth-form.active { display: block; }

.auth-field {
  margin-bottom: 16px;
}

.auth-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #757575;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.auth-field input {
  width: 100%;
  height: 44px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  padding: 0 14px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.auth-field input:focus {
  border-color: #212121;
}

.auth-field input.error {
  border-color: #C62828;
}

.auth-error {
  display: none;
  color: #C62828;
  font-size: 12px;
  margin-top: 6px;
}
.auth-error.visible { display: block; }

.auth-submit {
  width: 100%;
  height: 48px;
  background: #212121;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
  margin-top: 4px;
}
.auth-submit:hover { background: #000; }
.auth-submit:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.auth-link {
  display: block;
  text-align: center;
  margin-top: 14px;
  font-size: 12px;
  color: #757575;
  text-decoration: none;
  cursor: pointer;
}
.auth-link:hover { color: #212121; }

.auth-success {
  display: none;
  text-align: center;
  padding: 24px 28px 28px;
}
.auth-success.active { display: block; }

.auth-success svg {
  margin-bottom: 12px;
}

.auth-success h3 {
  font-family: var(--font-display, 'Bebas Neue', sans-serif);
  font-size: 1.2rem;
  letter-spacing: 1px;
  margin: 0 0 8px;
}

.auth-success p {
  font-size: 13px;
  color: #757575;
  margin: 0;
}

/* Profile button states */
.navbar__icon-btn .auth-initial {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #212121;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}

/* Loading spinner */
.auth-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: authSpin 0.6s linear infinite;
  vertical-align: middle;
}

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

/* Mobile */
@media (max-width: 600px) {
  .auth-modal {
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    max-height: 90vh;
    overflow-y: auto;
  }
  .auth-overlay {
    align-items: flex-end;
    padding: 0;
  }
}
