/* Shared styles for signup / login / verify-email / profile pages.
   All variables come from the cosmic theme used across the rest of NOVA. */

:root {
  --bg-0: #050208;
  --bg-1: #0a0414;
  --bg-2: #120822;
  --violet-100: #f3e8ff;
  --violet-300: #d8b4fe;
  --violet-400: #c084fc;
  --violet-500: #a855ff;
  --violet-600: #9333ea;
  --violet-700: #7c2dff;
  --green: #4ade80;
  --red: #ef4444;
  --orange: #fb923c;
  --text: #f3e8ff;
  --text-mute: #9c91ad;
  --text-soft: #b9aecb;
  --text-dim: #6b6378;
  --border-soft: rgba(168, 85, 255, 0.18);
  --border-mid: rgba(168, 85, 255, 0.28);
  --card-bg: rgba(20, 12, 38, 0.55);
  --nav-bg: rgba(10, 4, 20, 0.7);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {  }
html { scroll-behavior: smooth; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--bg-0); color: var(--text);
  min-height: 100vh; overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a, button, input, select, textarea {  font-family: inherit; }
::selection { background: var(--violet-500); color: white; }

#stars { position: fixed; inset: 0; z-index: 1; }
.nebula { position: fixed; pointer-events: none; z-index: 2; mix-blend-mode: screen; opacity: 0.5; }
.nebula-l {
  left: -25%; top: 0; width: 70%; height: 80%;
  background: radial-gradient(ellipse 60% 40% at 50% 50%, rgba(168, 85, 255, 0.3), transparent 70%);
  filter: blur(40px); will-change: transform; animation: drift1 32s ease-in-out infinite;
}
.nebula-r {
  right: -25%; top: 40%; width: 70%; height: 80%;
  background: radial-gradient(ellipse 50% 50% at 50% 50%, rgba(139, 92, 246, 0.25), transparent 70%);
  filter: blur(50px); will-change: transform; animation: drift2 38s ease-in-out infinite;
}
@keyframes drift1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(40px,-30px) scale(1.05); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-50px,40px) scale(1.08); } }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

.pulse-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 8px var(--green);
  animation: blink 1.6s ease-in-out infinite; flex-shrink: 0;
}

/* ===== TOP BAR ===== */
.top-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 18px 40px;
  background: var(--nav-bg);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: space-between;
}
.top-bar .logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.top-bar .logo-icon { width: 36px; height: 36px; filter: drop-shadow(0 0 10px rgba(168,85,255,0.5)); }
.top-bar .logo-text { font-family: 'Sora', sans-serif; font-size: 22px; font-weight: 700; letter-spacing: 6px; color: white; }
.top-bar .back-link {
  color: var(--text-soft); text-decoration: none;
  font-size: 13px; font-family: 'JetBrains Mono', monospace;
  letter-spacing: 1px;
  padding: 8px 14px; border-radius: 8px;
  border: 1px solid var(--border-soft);
  transition: all 0.2s;
}
.top-bar .back-link:hover { color: white; border-color: var(--violet-500); background: rgba(168,85,255,0.06); }

/* ===== AUTH CARD ===== */
.auth-wrap {
  position: relative; z-index: 5;
  min-height: 100vh;
  padding: 110px 24px 40px;
  display: flex; align-items: center; justify-content: center;
}
.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--card-bg);
  border: 1px solid var(--border-mid);
  border-radius: 20px;
  backdrop-filter: blur(10px);
  padding: 36px 32px;
  box-shadow: 0 0 80px rgba(168,85,255,0.12);
  animation: fadeUp 0.5s ease-out;
}
.auth-card.wide { max-width: 720px; }

.auth-card h1 {
  font-family: 'Sora', sans-serif;
  font-size: 28px; font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}
.auth-card h1 .grad {
  background: linear-gradient(135deg, #d8b4fe 0%, #a855ff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.auth-card .auth-sub {
  color: var(--text-soft); font-size: 14px;
  margin-bottom: 24px;
}

/* ===== FIELDS ===== */
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 700;
  color: var(--text-mute);
  letter-spacing: 1.5px; text-transform: uppercase;
  margin-bottom: 8px;
}
.input-wrap {
  position: relative;
  display: flex; align-items: center;
  background: rgba(10, 4, 20, 0.5);
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.input-wrap:focus-within {
  border-color: var(--violet-500);
  background: rgba(168,85,255,0.06);
  box-shadow: 0 0 0 3px rgba(168,85,255,0.12);
}
.input-wrap .icon {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-mute);
  pointer-events: none;
}
.input-wrap input,
.input-wrap textarea {
  flex: 1;
  padding: 13px 14px 13px 44px;
  background: none; border: none; outline: none;
  color: white; font-size: 14px;
  width: 100%;
}
.input-wrap input::placeholder,
.input-wrap textarea::placeholder { color: var(--text-dim); }
.input-wrap textarea { padding-left: 14px; resize: vertical; min-height: 80px; }
.input-wrap.no-icon input { padding-left: 14px; }

.eye-toggle {
  position: absolute; right: 6px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  color: var(--text-mute);
  padding: 8px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.2s, background 0.2s;
}
.eye-toggle:hover { color: var(--violet-300); background: rgba(168,85,255,0.08); }

.field-hint {
  font-size: 12px;
  color: var(--text-mute);
  margin-top: 7px;
  line-height: 1.4;
}
.field-hint.err { color: var(--orange); }
.field-hint.ok { color: var(--green); }

/* ===== TURNSTILE ===== */
.turnstile-wrap { margin-bottom: 18px; min-height: 0; }
.turnstile-wrap.hidden { display: none; }

/* ===== AUTH BUTTON ===== */
.auth-btn {
  width: 100%;
  padding: 13px 18px;
  border: none; border-radius: 11px;
  font-family: 'Sora', sans-serif;
  font-size: 14px; font-weight: 700;
  letter-spacing: 0.3px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: all 0.25s cubic-bezier(0.16,1,0.3,1);
}
.auth-btn.primary {
  background: linear-gradient(135deg, #a855ff 0%, #7c2dff 100%);
  color: white;
  box-shadow: 0 8px 24px rgba(168,85,255,0.3);
}
.auth-btn.primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(168,85,255,0.5);
}
.auth-btn.primary:disabled {
  opacity: 0.45; cursor: not-allowed;
  box-shadow: none; transform: none;
}
.auth-btn.ghost {
  background: rgba(168,85,255,0.06);
  border: 1px solid var(--border-mid);
  color: var(--text-soft);
}
.auth-btn.ghost:hover:not(:disabled) {
  border-color: var(--violet-500);
  color: white;
  background: rgba(168,85,255,0.12);
}
.auth-btn.danger {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: var(--red);
}
.auth-btn.danger:hover:not(:disabled) { background: rgba(239,68,68,0.18); border-color: var(--red); }

.auth-btn-spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== TERMS / ALT-LINK / DIVIDER ===== */
.terms {
  margin-top: 14px;
  font-size: 12px; color: var(--text-mute);
  text-align: center; line-height: 1.5;
}
.terms a { color: var(--violet-300); text-decoration: none; }
.terms a:hover { color: white; text-decoration: underline; }

.alt-link {
  margin-top: 14px;
  text-align: center;
  font-size: 13px; color: var(--text-soft);
}
.alt-link a { color: var(--violet-300); text-decoration: none; font-weight: 700; }
.alt-link a:hover { color: white; text-decoration: underline; }

/* ===== ERROR / SUCCESS ===== */
.auth-msg {
  margin-top: 16px;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 13px;
  display: none;
  align-items: center; gap: 10px;
  line-height: 1.4;
}
.auth-msg.show { display: flex; }
.auth-msg.err {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: var(--red);
}
.auth-msg.ok {
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.3);
  color: var(--green);
}
.auth-msg.warn {
  background: rgba(251,146,60,0.08);
  border: 1px solid rgba(251,146,60,0.3);
  color: var(--orange);
}
.auth-msg svg { flex-shrink: 0; }

/* ===== SETUP BANNER (when Firebase providers aren't enabled) ===== */
.setup-banner {
  background: linear-gradient(135deg, rgba(251,146,60,0.08), rgba(168,85,255,0.08));
  border: 1px solid rgba(251,146,60,0.35);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 22px;
  font-size: 13px; line-height: 1.6;
  color: var(--text-soft);
}
.setup-banner strong { color: var(--orange); }
.setup-banner code {
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  background: rgba(168,85,255,0.1); padding: 2px 6px; border-radius: 4px;
  color: var(--violet-300);
}
.setup-banner a { color: var(--violet-300); text-decoration: none; }

/* ===== CURSOR ===== */
.cursor-dot {
  position: fixed; width: 7px; height: 7px;
  border-radius: 50%; background: var(--violet-400);
  box-shadow: 0 0 14px var(--violet-500), 0 0 28px rgba(168,85,255,0.4);
  pointer-events: none; z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.25s, height 0.25s;
  mix-blend-mode: screen;
}
.cursor-ring {
  position: fixed; width: 34px; height: 34px;
  border: 1.5px solid rgba(168,85,255,0.5);
  border-radius: 50%; pointer-events: none; z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s, border-color 0.3s, background 0.3s;
}
.cursor-dot.hover { width: 12px; height: 12px; }
.cursor-ring.hover { width: 50px; height: 50px; border-color: rgba(168,85,255,0.9); background: rgba(168,85,255,0.08); }
@media (hover: none) { html, body, a, button, input, select, textarea { cursor: auto; } .cursor-dot, .cursor-ring { display: none; } }

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .top-bar { padding: 14px 18px; }
  .top-bar .back-link { display: none; }
  .auth-wrap { padding: 100px 16px 40px; }
  .auth-card { padding: 28px 22px; border-radius: 16px; }
  .auth-card h1 { font-size: 24px; }
}


  /* ===== prefers-reduced-motion ===== */
  /* Disable all our animation-based decoration for users who set the OS flag. */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.001ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.001ms !important;
    }
    .nebula { display: none !important; }
    #stars { display: none !important; }
  }

