/* ==========================================================
   qmaze — auth pages stylesheet
   Blueprint/schematic theme for login, register, forgot/reset password
   ========================================================== */

:root {
  --bg: #0F1B2B;
  --panel: #16233A;
  --panel-raised: #1C2C46;
  --border: rgba(143, 163, 184, 0.16);
  --border-strong: rgba(143, 163, 184, 0.30);
  --text-primary: #E7EDF3;
  --text-secondary: #8FA3B8;
  --text-muted: #5E7188;
  --accent: #4FD1C5;
  --accent-dim: rgba(79, 209, 197, 0.14);
  --success: #6EE7B7;
  --danger: #F87171;
  --danger-bg: rgba(248, 113, 113, 0.10);
  --radius: 10px;
  --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'Consolas', monospace;

  /* Optional real photo background for the visual panel.
     To use one: drop an image at public/images/auth-bg.jpg and set:
       --auth-bg-image: url('/images/auth-bg.jpg');
     Leave as none to keep the illustrated CSS/SVG background below. */
  --auth-bg-image: url('/images/banner.png');
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
}

/* ---------- shell layout ---------- */

.auth-shell {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  min-height: 100vh;
}

@media (max-width: 860px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }
  .auth-visual { display: none; }
}

/* ---------- left panel: illustrated / photo background ---------- */

.auth-visual {
  position: relative;
  overflow: hidden;
  background:
    var(--auth-bg-image),
    radial-gradient(ellipse 900px 700px at 30% 15%, rgba(79, 209, 197, 0.10), transparent 60%),
    linear-gradient(180deg, rgba(15, 27, 43, 0.2) 0%, rgba(15, 27, 43, 0.96) 85%),
    var(--bg);
  background-size: cover, cover, cover, cover;
  background-position: center, center, center, center;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.5rem;
}

/* faint drafting grid, sits above any photo, under the illustration */
.auth-visual__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.4;
  animation: grid-drift 40s linear infinite;
}

@keyframes grid-drift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 40px 40px, 40px 40px; }
}

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

/* illustrated warehouse/rack scene — pure SVG, no external asset needed */
.auth-visual__illustration {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

.auth-visual__illustration svg {
  width: 100%;
  height: auto;
  opacity: 0.9;
}

.auth-visual__glow {
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(79, 209, 197, 0.16) 0%, transparent 70%);
  pointer-events: none;
}

.auth-visual__corner {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--accent);
  opacity: 0.6;
}
.auth-visual__corner--tl { top: 24px; left: 24px; border-right: none; border-bottom: none; }
.auth-visual__corner--br { bottom: 24px; right: 24px; border-left: none; border-top: none; }

.auth-visual__brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 2;
}

.auth-visual__mark {
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--accent);
  background: rgba(15, 27, 43, 0.6);
  backdrop-filter: blur(4px);
}

.auth-visual__name {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.auth-visual__caption {
  position: relative;
  z-index: 2;
}

.auth-visual__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 6px;
}

.auth-visual__status {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--success);
  margin: 0;
}

/* ---------- right panel: form ---------- */

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-card {
  width: 100%;
  max-width: 380px;
}

.auth-card h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--text-primary);
}

.auth-card__subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 28px;
}

/* ---------- form elements ---------- */

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
input[type="email"] {
  width: 100%;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

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

input:hover {
  border-color: var(--border-strong);
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

button[type="submit"] {
  width: 100%;
  padding: 12px 14px;
  margin-top: 8px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: #0A1622;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.05s ease;
}

button[type="submit"]:hover {
  filter: brightness(1.08);
}

button[type="submit"]:active {
  transform: scale(0.99);
}

/* ---------- footer / links ---------- */

.footer-text {
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
}

.footer-text a {
  color: var(--accent);
  text-decoration: none;
}

.footer-text a:hover {
  text-decoration: underline;
}

/* ---------- messages ---------- */

.error-box {
  background: var(--danger-bg);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: var(--danger);
  font-size: 13px;
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.success-box {
  background: rgba(110, 231, 183, 0.10);
  border: 1px solid rgba(110, 231, 183, 0.3);
  color: var(--success);
  font-size: 13px;
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 16px;
}

/* ---------- MFA QR code ---------- */

.qr-container {
  display: flex;
  justify-content: center;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.qr-container img {
  border-radius: 6px;
}
