.auth-page-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.auth-page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  padding: 0;
}

.auth-card {
  padding: 32px;
  backdrop-filter: blur(20px);
}

.auth-tabs {
  display: flex;
  background: var(--bg);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 28px;
  gap: 4px;
}

.auth-tab {
  flex: 1;
  padding: 9px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
}

.auth-tab.active {
  background: var(--surface2);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.form-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
}

.form-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.auth-submit {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  margin-top: 8px;
}

.auth-meta {
  display: flex;
  justify-content: flex-end;
  margin: -2px 0 4px;
}

.text-button {
  padding: 0;
  border: none;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}

.text-button:hover {
  text-decoration: underline;
}

.forgot-password-box {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface2) 82%, transparent);
}

.forgot-password-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
}

.forgot-password-subtitle {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--text-muted);
}

.forgot-password-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.forgot-password-back {
  display: flex;
  justify-content: flex-end;
  margin: -2px 0 10px;
}

.forgot-password-back .text-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.forgot-submit {
  margin-top: 0;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 12px;
}

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

.btn-google {
  width: 100%;
  padding: 11px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.btn-google:hover {
  background: var(--card-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.btn-google svg {
  width: 18px;
  height: 18px;
}

.alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

.alert.error {
  background: rgba(255, 85, 85, 0.12);
  border: 1px solid rgba(255, 85, 85, 0.3);
  color: #ff8888;
  display: block;
}

.alert.success {
  background: rgba(80, 250, 123, 0.12);
  border: 1px solid rgba(80, 250, 123, 0.3);
  color: #50fa7b;
  display: block;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.anon-link {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-muted);
}

.anon-link a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.anon-link a:hover {
  text-decoration: underline;
}

.global-alert {
  display: none;
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  background: rgba(255, 85, 85, 0.15);
  border: 1px solid rgba(255, 85, 85, 0.4);
  color: #ff8888;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 13px;
  max-width: 400px;
  text-align: center;
}

.firebase-missing {
  text-align: center;
  padding: 24px;
}

.firebase-missing-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.spin-loader {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: login-spin 0.8s linear infinite;
}

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

@media (max-width: 640px) {
  .forgot-password-actions {
    flex-direction: column;
  }

  .forgot-submit,
  .forgot-cancel {
    width: 100%;
  }

  .auth-page-wrap {
    align-items: flex-start;
    padding-top: 32px;
  }
}
