/* Shared by templates/login.html and templates/login_2fa.html */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f0f4f8;
  color: #1e293b;
}

/* ── Subtle grid background ─────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(148,163,184,.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148,163,184,.12) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

/* ── Glow orb ───────────────────────────────── */
body::after {
  content: '';
  position: fixed;
  top: -200px; left: 50%;
  transform: translateX(-50%);
  width: 700px; height: 500px;
  background: radial-gradient(ellipse, rgba(59,130,246,.10) 0%, transparent 70%);
  pointer-events: none;
}

/* ── Centered wrapper ───────────────────────── */
.login-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  z-index: 1;
}

/* ── Brand header ───────────────────────────── */
.brand-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}
.brand-logo {
  width: 52px; height: 52px;
  background: #1d4ed8;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(29,78,216,.25);
}
.brand-logo img { height: 32px; filter: brightness(0) invert(1); }
.brand-name {
  font-size: 24px; font-weight: 700;
  color: #1e293b; letter-spacing: -.4px;
}
.brand-tag {
  font-size: 12px; color: #64748b;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: .04em;
}

/* ── Card ───────────────────────────────────── */
.login-card {
  width: 100%;
  max-width: 380px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: 0 8px 32px rgba(148,163,184,.18);
}
.card-title {
  font-size: 15px; font-weight: 600;
  color: #1e293b; margin-bottom: 6px;
}
.card-sub {
  font-size: 12px; color: #94a3b8;
  margin-bottom: 24px;
}

/* ── Form fields ────────────────────────────── */
.field { margin-bottom: 16px; }
.forgot-link {
  color: #2563eb;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
}
.forgot-link:hover { text-decoration: underline; }
.forgot-link-below {
  display: block;
  width: max-content;
  margin: 7px 0 0 auto;
}
label {
  display: block;
  font-size: 11px; font-weight: 600;
  color: #64748b;
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 6px;
}
.input-wrap {
  position: relative;
}
.input-wrap > i {
  position: absolute; left: 11px; top: 50%;
  transform: translateY(-50%);
  font-size: 14px; color: #94a3b8;
  pointer-events: none;
}
input[type="text"], input[type="password"], input[type="email"] {
  width: 100%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px 10px 36px;
  font-size: 13.5px;
  font-family: 'DM Sans', sans-serif;
  color: #1e293b;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
input[type="text"]::placeholder,
input[type="password"]::placeholder,
input[type="email"]::placeholder { color: #cbd5e1; }
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
  background: #ffffff;
}

/* ── Password toggle ────────────────────────── */
.toggle-pw {
  position: absolute; right: 11px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: #94a3b8; font-size: 14px; padding: 2px;
  transition: color .15s;
}
.toggle-pw:hover { color: #64748b; }

/* ── Error message ──────────────────────────── */
.error-msg {
  display: flex; align-items: center; gap: 8px;
  background: rgba(254,226,226,.6);
  border: 1px solid rgba(252,165,165,.5);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12.5px;
  color: #dc2626;
  margin-bottom: 16px;
}
.error-msg i { font-size: 14px; color: #ef4444; flex-shrink: 0; }

.success-msg {
  display: flex; align-items: center; gap: 8px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12.5px;
  color: #047857;
  margin-bottom: 18px;
}
.success-msg i { font-size: 14px; color: #10b981; flex-shrink: 0; }

/* ── Submit button ──────────────────────────── */
.login-btn {
  width: 100%;
  padding: 11px;
  background: #1d4ed8;
  color: #fff;
  border: none; border-radius: 9px;
  font-size: 14px; font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: background .2s, transform .1s, box-shadow .2s;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  margin-top: 8px;
  box-shadow: 0 4px 14px rgba(29,78,216,.35);
}
.login-btn:hover {
  background: #1e40af;
  box-shadow: 0 6px 20px rgba(29,78,216,.45);
}
.login-btn:active { transform: scale(.98); }
.login-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* Password reset */
.reset-wrapper { justify-content: flex-start; padding-top: 38px; }
.brand-link { color: inherit; text-decoration: none; }
.reset-card { max-width: 760px; }
.reset-card-single { max-width: 420px; }
.reset-section { padding: 0; }
.reset-step {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #1e293b;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 7px;
}
.reset-step span {
  width: 23px;
  height: 23px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #dbeafe;
  color: #1d4ed8;
  font: 600 11px 'IBM Plex Mono', monospace;
}
.reset-help {
  color: #64748b;
  font-size: 11.5px;
  line-height: 1.45;
  margin-bottom: 17px;
}
.code-input {
  font-family: 'IBM Plex Mono', monospace !important;
  letter-spacing: .18em;
}
.back-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: max-content;
  margin: 24px auto 0;
  color: #64748b;
  font-size: 12px;
  text-decoration: none;
}
.back-link:hover { color: #1d4ed8; }

@media (max-width: 700px) {
  .reset-wrapper { padding: 24px 16px; }
  .brand-header { margin-bottom: 24px; }
  .reset-card { padding: 28px 22px; }
}

/* ── Footer ─────────────────────────────────── */
.page-footer {
  text-align: center;
  font-size: 11px;
  color: #94a3b8;
  padding: 20px;
  position: relative; z-index: 1;
}
