/* Auth pages — polished, matches dashboard design system (index.html).
   Pass 6.J P6J-13/P6J-14: ports Pass 5.D contrast + focus-visible fixes
   that previously only landed in the inline CSS of index.html. */
:root {
  --bg:#0b1220;
  --bg2:#0e1626;
  --panel:#111827;
  --panel2:#1f2937;
  --text:#e5e7eb;
  /* Pass 6.J P6J-13: lifted from #9ca3af (6.83:1) to #b0b8c1 (~8.0:1)
     to pass WCAG AAA 7:1 for muted/secondary text. */
  --muted:#b0b8c1;
  --line:#374151;
  --line2:#283447;
  --accent:#38bdf8;
  --accent2:#0ea5e9;
  --amber:#f59e0b;
  --green:#22c55e;
  --pink:#f472b6;
  --red:#f87171;
  --nav-h:48px;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
/* Pass 6.J P6J-14: global :focus-visible so keyboard users can always see
   focus on auth pages (Pass 5.D shipped this for the dashboard only). */
:focus-visible {
  outline: 3px solid #fde047;
  outline-offset: 2px;
  border-radius: 4px;
}
/* Pass 6.J P6J-15: respect prefers-reduced-motion on auth pages too. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Centered auth layout with ambient background ────────────────────────── */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(900px 500px at 20% -10%, rgba(56,189,248,0.12), transparent 60%),
    radial-gradient(700px 500px at 100% 110%, rgba(244,114,182,0.08), transparent 55%),
    linear-gradient(180deg, var(--bg2), var(--bg));
}
/* Subtle moving sheen behind the card */
.auth-shell::before {
  content: "";
  position: absolute;
  inset: -20%;
  background: conic-gradient(from 0deg at 50% 50%, transparent 0deg, rgba(56,189,248,0.05) 90deg, transparent 180deg, rgba(244,114,182,0.04) 270deg, transparent 360deg);
  filter: blur(40px);
  animation: spin 40s linear infinite;
  z-index: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, rgba(31,41,55,0.55), rgba(17,24,39,0.85));
  border: 1px solid var(--line2);
  border-radius: 20px;
  padding: 36px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.04);
  backdrop-filter: blur(12px);
}

/* Brand mark */
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.auth-logo {
  width: 38px; height: 38px;
  border-radius: 11px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 13px; letter-spacing: 0.5px;
  color: #062033;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 4px 14px rgba(56,189,248,0.35);
}
.auth-brand-text { line-height: 1.2; }
.auth-brand-text .t1 { font-size: 14px; font-weight: 700; letter-spacing: 0.4px; }
.auth-brand-text .t2 { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }

.auth-card h1 { font-size: 24px; margin: 0 0 6px; font-weight: 700; }
.auth-card .sub { color: var(--muted); font-size: 14px; margin-bottom: 22px; }

label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 7px;
  margin-top: 18px;
}
.auth-card label:first-of-type { margin-top: 0; }

.input-wrap { position: relative; }
input[type="email"], input[type="password"], input[type="text"], select {
  width: 100%;
  background: rgba(11,18,32,0.6);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input::placeholder { color: #5b6677; }
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56,189,248,0.15);
  background: rgba(11,18,32,0.85);
}

button {
  width: 100%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #042231;
  border: none;
  border-radius: 11px;
  padding: 12px 16px;
  margin-top: 24px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.2px;
  transition: filter .15s, transform .05s, box-shadow .15s;
  box-shadow: 0 8px 24px rgba(56,189,248,0.25);
}
button:hover { filter: brightness(1.08); box-shadow: 0 10px 28px rgba(56,189,248,0.35); }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}
button.secondary:hover { border-color: var(--accent); filter: none; }

.msg {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 11px;
  font-size: 13px;
  display: none;
  border: 1px solid transparent;
  line-height: 1.45;
}
.msg.error   { background: rgba(248,113,113,0.10); border-color: rgba(248,113,113,0.32); color: var(--red); display: block; }
.msg.success { background: rgba(34,197,94,0.10);   border-color: rgba(34,197,94,0.32);   color: var(--green); display: block; }
.msg.info    { background: rgba(56,189,248,0.10);  border-color: rgba(56,189,248,0.32);  color: var(--accent); display: block; }

.row-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 22px;
  font-size: 13px;
  color: var(--muted);
}
.row-links a { color: var(--accent); text-decoration: none; font-weight: 500; }
.row-links a:hover { text-decoration: underline; }

.auth-footer {
  position: relative; z-index: 1;
  margin-top: 22px;
  font-size: 12px;
  color: #5b6677;
  text-align: center;
}

/* ── Shared nav (used by /admin) ─────────────────────────────────────────── */
nav.dash-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(11,18,32,.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; height: var(--nav-h);
  padding: 0 24px; gap: 2px;
}
nav.dash-nav .brand {
  color: var(--text); font-weight: 700; font-size: 14px;
  letter-spacing: 0.5px; text-transform: uppercase;
  padding: 12px 0;
}
nav.dash-nav a {
  color: var(--muted); text-decoration: none;
  padding: 12px 14px; font-size: 13px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 2px solid transparent;
}
nav.dash-nav a:hover { color: var(--text); }
nav.dash-nav .spacer { flex: 1; }

.wrap-wide { max-width: 1100px; margin: 24px auto; padding: 0 24px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 32px; }

@media (max-width: 480px) {
  .auth-card { padding: 28px 22px; border-radius: 16px; }
}
