/* ═══════════════════════════════════════════════════════════════
   auth.css – Login / signup page styles (standalone)
   ═══════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

:root {
  --bg:      #07091a;
  --surface: #111528;
  --card-bg: #161a2e;
  --border:  #252a45;
  --accent:  #4f8ef7;
  --accent-h:#6ba3ff;
  --text:    #e8eaf0;
  --muted:   #8b90a8;
  --danger:  #e05252;
  --radius:  12px;
}

/* ── Body — deep gradient ─────────────────────────────────────── */

body {
  background:  radial-gradient(ellipse 110% 100% at 50% 40%,
                 #0f1d3a 0%,
                 #090d20 55%,
                 #07091a 100%);
  color:       var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size:   15px;
  min-height:  100vh;
  display:     flex;
  align-items: center;
  justify-content: center;
  padding:     40px 24px;
  position:    relative;
  overflow-x:  hidden;
}

/* Centre glow — subtle blue bloom behind the card */
body::after {
  content:  '';
  position: fixed;
  inset:    0;
  background: radial-gradient(ellipse 55% 50% at 50% 50%,
                rgba(79,142,247,0.08) 0%,
                transparent 70%);
  pointer-events: none;
  z-index:  0;
}

/* ── Circuit board SVG layer ──────────────────────────────────── */

#circuit-canvas {
  position:       fixed;
  inset:          0;
  width:          100%;
  height:         100%;
  pointer-events: none;
  z-index:        0;
}

/* ── Page wrapper ─────────────────────────────────────────────── */

.auth-page {
  position:        relative;
  z-index:         1;
  width:           100%;
  max-width:       460px;
  display:         flex;
  flex-direction:  column;
  align-items:     center;
  gap:             28px;
}

/* ── Hero / welcome heading ───────────────────────────────────── */

.auth-hero {
  text-align: center;
  width:      100%;
}

.auth-hero-logo {
  font-size:      0.85rem;
  font-weight:    700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color:          var(--accent);
  margin-bottom:  14px;
  opacity:        0.85;
}

.auth-hero-title {
  font-size:      clamp(1.75rem, 5vw, 2.5rem);
  font-weight:    800;
  line-height:    1.15;
  letter-spacing: -0.03em;
  /* gradient text: white → accent blue */
  background:     linear-gradient(150deg, #ffffff 20%, #a8c4ff 60%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip:         text;
  /* soft glow fallback for non-supporting browsers */
  text-shadow:    none;
  margin-bottom:  10px;
}

.auth-hero-sub {
  color:     var(--muted);
  font-size: 0.9rem;
}

/* ── Card ─────────────────────────────────────────────────────── */

.auth-card {
  width:          100%;
  background:     var(--card-bg);
  border:         1px solid var(--border);
  border-radius:  var(--radius);
  padding:        36px 32px 32px;
  display:        flex;
  flex-direction: column;
  gap:            18px;
  /* glass-like depth */
  box-shadow:     0 4px 40px rgba(0,0,0,0.5),
                  0 0 0 1px rgba(79,142,247,0.06) inset;
}

/* ── Tabs ─────────────────────────────────────────────────────── */

.auth-tabs {
  display:       flex;
  gap:           4px;
  background:    var(--surface);
  border-radius: 8px;
  padding:       4px;
}

.auth-tab {
  flex:          1;
  background:    transparent;
  border:        none;
  border-radius: 6px;
  padding:       8px 12px;
  font-size:     0.88rem;
  font-weight:   600;
  color:         var(--muted);
  cursor:        pointer;
  transition:    background 0.15s, color 0.15s;
}

.auth-tab.active {
  background: var(--card-bg);
  color:      var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
}

.auth-tab:focus-visible {
  outline:        2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Error banner ─────────────────────────────────────────────── */

.auth-error {
  background:    rgba(224,82,82,0.15);
  border:        1px solid rgba(224,82,82,0.4);
  border-radius: 8px;
  color:         #f08080;
  padding:       10px 14px;
  font-size:     0.88rem;
  line-height:   1.4;
}

/* ── Form ─────────────────────────────────────────────────────── */

.auth-form {
  display:        flex;
  flex-direction: column;
  gap:            14px;
}

.auth-field {
  display:        flex;
  flex-direction: column;
  gap:            5px;
}

.auth-field span {
  font-size:      0.82rem;
  font-weight:    600;
  color:          var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.auth-field small {
  font-size:      0.75rem;
  text-transform: none;
  letter-spacing: 0;
  font-weight:    400;
}

.auth-field input {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: 8px;
  color:         var(--text);
  font-size:     0.95rem;
  padding:       10px 14px;
  transition:    border-color 0.15s, box-shadow 0.15s;
  outline:       none;
  width:         100%;
}

.auth-field input::placeholder { color: var(--muted); opacity: 0.6; }

.auth-field input:focus {
  border-color: var(--accent);
  box-shadow:   0 0 0 3px rgba(79,142,247,0.18);
}

/* ── Submit button ────────────────────────────────────────────── */

.auth-btn {
  margin-top:    4px;
  background:    var(--accent);
  border:        none;
  border-radius: 8px;
  color:         #fff;
  font-size:     0.95rem;
  font-weight:   700;
  padding:       12px;
  cursor:        pointer;
  transition:    background 0.15s, opacity 0.15s, box-shadow 0.15s;
  width:         100%;
}

.auth-btn:hover {
  background:  var(--accent-h);
  box-shadow:  0 0 18px rgba(79,142,247,0.35);
}

.auth-btn:active  { opacity: 0.85; }
.auth-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ── Passkey divider & button ─────────────────────────────────── */

.auth-divider {
  display:     flex;
  align-items: center;
  gap:         10px;
  margin:      4px 0;
  color:       var(--muted);
  font-size:   0.8rem;
}

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

.auth-btn--passkey {
  background: transparent;
  border:     1px solid var(--border);
  color:      var(--text);
}

.auth-btn--passkey:hover {
  background: var(--surface);
  box-shadow: none;
}

/* ── Ghost button (MFA back / resend) ─────────────────────────── */

.auth-btn--ghost {
  background: transparent;
  border:     1px solid var(--border);
  color:      var(--muted);
}

.auth-btn--ghost:hover {
  background: var(--surface);
  color:      var(--text);
  box-shadow: none;
}

/* ── MFA challenge ─────────────────────────────────────────────── */

.mfa-challenge-msg {
  color:       var(--muted);
  font-size:   0.88rem;
  line-height: 1.5;
  margin-bottom: 4px;
}

.mfa-trust-row {
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

.mfa-trust-row input[type="checkbox"] {
  width: auto;
  accent-color: var(--accent);
}

/* ── Mobile ───────────────────────────────────────────────────── */

@media (max-width: 480px) {
  body { padding: 24px 16px; }

  .auth-hero-title { font-size: 1.65rem; }

  .auth-card { padding: 26px 18px 22px; }
}
