/* Auth pages — login, signup, callback */

.auth-page {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-header h1 {
  font-family: "Crimson Pro", serif;
  color: var(--text);
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.auth-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* OAuth */
.oauth-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.btn-oauth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  font-family: "Sora", sans-serif;
  cursor: pointer;
  transition:
    background 0.2s,
    border-color 0.2s;
}

.btn-oauth:hover {
  background: var(--bg-card);
  border-color: var(--primary);
}

.btn-oauth:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

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

.auth-divider span {
  padding: 0 1rem;
}

/* Form */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: var(--text);
  font-size: 1rem;
  font-family: "Sora", sans-serif;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

/* Submit */
.btn-submit {
  width: 100%;
  padding: 0.75rem;
  background: var(--primary);
  color: var(--ivory);
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: "Sora", sans-serif;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.2s;
}

.btn-submit:hover {
  background: var(--primary-d);
  transform: translateY(-1px);
}

.btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

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

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

.loading-spinner {
  display: none;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--ivory);
  border-top-color: transparent;
  border-radius: 50%;
  animation: auth-spin 0.8s linear infinite;
}

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

/* Messages */
.auth-error,
.auth-success {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  display: none;
}

.auth-error.visible,
.auth-success.visible {
  display: block;
}

.auth-error {
  background: rgba(224, 85, 85, 0.1);
  border: 1px solid var(--coral);
  color: var(--coral);
}

.auth-success {
  background: rgba(74, 157, 124, 0.1);
  border: 1px solid var(--emerald);
  color: var(--emerald);
}

/* Footer link */
.auth-link {
  text-align: center;
  margin-top: 1.25rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.auth-link a {
  color: var(--gold);
  text-decoration: none;
}

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

/* Callback */
.auth-container--centered {
  text-align: center;
}

.auth-callback-title {
  font-family: "Crimson Pro", serif;
  color: var(--text);
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.auth-callback-message {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.auth-callback-link {
  color: var(--gold);
  margin-top: 1rem;
  display: inline-block;
  text-decoration: none;
}

.auth-callback-link:hover {
  text-decoration: underline;
}

.spinner {
  width: 3rem;
  height: 3rem;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: auth-spin 0.8s linear infinite;
  margin: 0 auto 1.5rem;
}

/* Nav user menu */
.nav-user-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-user-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 2rem;
  padding: 0.35rem 0.75rem;
  color: var(--text);
  font-family: "Sora", sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s;
}

.nav-user-btn:hover {
  border-color: var(--primary);
  background: var(--bg-card);
}

.nav-user-avatar {
  width: 1.5rem;
  height: 1.5rem;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ivory);
  font-size: 0.7rem;
  font-weight: 600;
}

.nav-user-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.5rem;
  min-width: 160px;
  z-index: 100;
  display: none;
}

.nav-user-menu.open .nav-user-dropdown {
  display: block;
}

.nav-user-dropdown a,
.nav-user-dropdown button {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  color: var(--text);
  font-size: 0.9rem;
  font-family: "Sora", sans-serif;
  text-decoration: none;
  background: none;
  border: none;
  border-radius: 0.35rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}

.nav-user-dropdown a:hover,
.nav-user-dropdown button:hover {
  background: var(--bg-alt);
}
