/* -------------------------------------------------------------------------- */
/* Standalone auth pages — matches dashboard design language                  */
/* -------------------------------------------------------------------------- */

/* ── Hero backdrop (login / signup pages) ──
   The wc26-hero.svg fills the full viewport behind the login card.
   It uses a deep stadium-night palette so the light card (white bg, purple
   top border) reads cleanly on top. opacity ~0.35 keeps it atmospheric
   without overwhelming the form. prefers-reduced-motion has no effect here
   (the static SVG has no animation); the glow-pulse in the TS version is
   already gated via @media (prefers-reduced-motion: no-preference).       */
.auth-hero-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.auth-hero-backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  opacity: 0.35;
  display: block;
}

/* Ensure card and footer stack above the backdrop */
.auth-page .auth-card,
.auth-page .auth-page-footer {
  position: relative;
  z-index: 1;
}

.auth-page {
  --bg-primary: #f5f3f8;
  --bg-secondary: #ffffff;
  --bg-tertiary: #ece8f2;
  --border-color: #d8d0e4;
  --border-accent: rgba(168, 84, 233, 0.2);
  --accent: #A854E9;
  --accent-hover: #9340D3;
  --accent-glow: rgba(168, 84, 233, 0.25);
  --accent-dim: rgba(168, 84, 233, 0.08);
  --text-primary: #1a1a2e;
  --text-secondary: #555570;
  --text-muted: #9090a8;
  --success: #2da44e;
  --error: #cf222e;
  --font-display: 'Montserrat', 'Segoe UI', 'Arial', sans-serif;
  --panel-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);

  min-height: 100vh;
  margin: 0;
  padding: 1.25rem 1.25rem 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display), sans-serif;
  background: radial-gradient(ellipse at 50% 0%, #ede5f5 0%, var(--bg-primary) 70%);
  color: var(--text-primary);
}

@keyframes auth-card-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-page .auth-card {
  width: 100%;
  max-width: 420px;
  padding: 2rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--accent);
  border-radius: 12px;
  box-shadow: var(--panel-shadow), 0 8px 32px rgba(0, 0, 0, 0.06);
  animation: auth-card-enter 0.5s ease-out both;
}

@media (prefers-reduced-motion: reduce) {
  .auth-page .auth-card {
    animation: none;
  }
}

.auth-page .auth-brand {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-page .auth-logo {
  display: block;
  height: auto;
  margin-inline: auto;
  margin-bottom: 0.6rem;
}

.auth-page .auth-tagline {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.3px;
  line-height: 1.45;
}

.auth-page .auth-card h1 {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
}

.auth-page .auth-sub {
  margin: 0 0 1.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.45;
}

.auth-page .auth-card form {
  text-align: left;
}

.auth-page .auth-optional {
  font-weight: 400;
  color: var(--text-muted);
}

.auth-page .auth-label {
  display: block;
  margin-bottom: 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.auth-page .auth-input {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.auth-page .auth-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.auth-page .auth-submit {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.65rem 1rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.auth-page .auth-submit:hover {
  background: var(--accent-hover);
}

.auth-page .auth-submit:active {
  transform: scale(0.97);
}

.auth-page .auth-error {
  color: var(--error);
  font-size: 0.85rem;
  margin: 0.5rem 0 0;
}

.auth-page .auth-info {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0.5rem 0 0;
}

.auth-page .auth-footer {
  margin-top: 1.25rem;
  font-size: 0.85rem;
  text-align: center;
}

.auth-page .auth-footer a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.auth-page .auth-footer a:hover {
  text-decoration: underline;
  color: var(--accent-hover);
}

/* Page footer below card */
.auth-page .auth-page-footer {
  margin-top: 1.5rem;
  padding: 0.75rem 0 1rem;
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-align: center;
}

.auth-page .auth-page-footer .footer-brand {
  color: var(--accent);
  font-weight: 700;
}

.auth-page .auth-page-footer .footer-separator {
  opacity: 0.3;
  margin: 0 0.25em;
}

.auth-page .auth-page-footer .footer-version {
  opacity: 0.5;
}

/* -------------------------------------------------------------------------- */
/* Full-screen overlay on main app (dark modal — not .auth-page)             */
/* -------------------------------------------------------------------------- */

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 17, 23, 0.92);
}

.auth-overlay.hidden {
  display: none;
}

.auth-modal {
  width: 100%;
  max-width: 420px;
  padding: 1.75rem;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 12px;
}

.auth-modal h2 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  color: #e6edf3;
}

.auth-modal p {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: #8b949e;
}

.auth-modal .auth-label {
  display: block;
  margin-bottom: 1rem;
  font-size: 0.8rem;
  color: #8b949e;
}

.auth-modal .auth-input {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid #30363d;
  border-radius: 8px;
  background: #0d1117;
  color: #e6edf3;
  font-size: 1rem;
  box-sizing: border-box;
}

.auth-modal .auth-input:focus {
  outline: none;
  border-color: #58a6ff;
}

.auth-modal .auth-submit {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.65rem 1rem;
  border: none;
  border-radius: 8px;
  background: #238636;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.auth-modal .auth-submit:hover {
  background: #2ea043;
}

.auth-modal .auth-error {
  color: #f85149;
  font-size: 0.85rem;
  margin: 0.5rem 0 0;
}
