/* ==========================================================================
   Q EYE · TCMS — "Control Room" theme            assets/client/dist/css/qeye-auth.css
   Open and standalone pages: login, forgot password, change password, profile.
   Governed by DESIGN_DOCTRINE.md §10. Loads after Bootstrap 3 only.
   v2: single-screen layout (no page scroll on desktop) + redesigned access panel.
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
  --qe-shell: #0B1424; --qe-shell-2: #10203A; --qe-shell-3: #182B4A;
  --qe-shell-line: rgba(255, 255, 255, .08); --qe-shell-ink: #DCE6F5; --qe-shell-ink-2: #8FA3C1;
  --qe-canvas: #EEF2F7; --qe-surface: #FFFFFF; --qe-surface-2: #F6F8FB; --qe-line: #E3E8EF; --qe-line-2: #CBD5E1;
  --qe-ink: #0F172A; --qe-ink-2: #475569; --qe-ink-3: #8A97AB;
  --qe-accent: #19B5E0; --qe-accent-ink: #0B7FA3; --qe-accent-soft: rgba(25, 181, 224, .14); --qe-accent-2: #7C5CFF;
  --qe-ok: #16A34A; --qe-ok-soft: #DCFCE7; --qe-warn: #D97706; --qe-warn-soft: #FEF3C7; --qe-danger: #DC2626; --qe-danger-soft: #FEE2E2; --qe-info: #0284C7; --qe-info-soft: #E0F2FE;
  --qe-r: 16px; --qe-r-sm: 10px;
  --qe-shadow-lg: 0 30px 60px -30px rgba(15, 23, 42, .35), 0 2px 6px rgba(15, 23, 42, .04);
  --qe-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --qe-mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
}

*, *:before, *:after { box-sizing: border-box; }
html, body { height: 100%; }
body.qe-auth {
  margin: 0; font-family: var(--qe-font); font-size: 14px; line-height: 1.5; color: var(--qe-ink-2);
  background: var(--qe-canvas); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
.qe-auth a { color: var(--qe-accent-ink); font-weight: 500; }
.qe-auth a:hover, .qe-auth a:focus { color: var(--qe-accent-ink); text-decoration: underline; }
.qe-auth :focus-visible { outline: 3px solid var(--qe-accent-soft); outline-offset: 2px; }
.qe-mono { font-family: var(--qe-mono); font-variant-numeric: tabular-nums; }

/* ======================= Layout: exactly one screen ======================= */
.qe-auth__wrap { display: flex; height: 100vh; height: 100dvh; min-height: 560px; overflow: hidden; }

/* ---------- Brand panel (left) ---------- */
.qe-auth__brand {
  flex: 0 0 46%; max-width: 680px; position: relative; overflow: hidden; color: var(--qe-shell-ink);
  background: var(--qe-shell); display: flex; flex-direction: column;
  padding: clamp(20px, 4.2vh, 44px) clamp(24px, 3.4vw, 52px);
  background-image: radial-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px); background-size: 24px 24px;
}
.qe-auth__brand:before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 50% at 20% 0%, rgba(25, 181, 224, .22), transparent 70%),
              radial-gradient(50% 40% at 100% 100%, rgba(124, 92, 255, .18), transparent 70%);
}
.qe-auth__brand > * { position: relative; z-index: 1; }

.qe-auth__logo { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.qe-auth__mark {
  width: 46px; height: 46px; border-radius: 13px; flex: 0 0 46px; display: inline-flex; align-items: center; justify-content: center;
  background: radial-gradient(120% 120% at 20% 10%, #1F3B66 0%, #0F2140 60%, #0B1424 100%);
  border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 0 0 1px rgba(25, 181, 224, .18), 0 10px 26px -12px rgba(25, 181, 224, .7);
}
.qe-auth__mark img { width: 30px; height: 30px; object-fit: contain; }
.qe-auth__logo b { display: block; font-size: 17px; font-weight: 700; color: #fff; letter-spacing: -.01em; line-height: 1.1; }
.qe-auth__logo small { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--qe-shell-ink-2); margin-top: 4px; }

.qe-auth__copy { flex: 0 0 auto; margin-top: clamp(16px, 5vh, 56px); }
.qe-auth__eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #4ADE80; }
.qe-auth__eyebrow i { width: 8px; height: 8px; border-radius: 50%; background: #22C55E; animation: qe-pulse 2s ease-in-out infinite; }
.qe-auth__copy h1 { margin: clamp(8px, 1.4vh, 14px) 0 clamp(6px, 1.2vh, 12px); font-size: clamp(26px, min(3vw, 5vh), 42px); font-weight: 800; letter-spacing: -.02em; line-height: 1.08; color: #fff; }
.qe-auth__copy h1 span { color: var(--qe-accent); }
.qe-auth__copy p { margin: 0; max-width: 46ch; font-size: clamp(13px, 1.7vh, 14.5px); color: var(--qe-shell-ink-2); }

.qe-auth__points { list-style: none; padding: 0; margin: clamp(12px, 3vh, 28px) 0 0; display: grid; gap: clamp(6px, 1.3vh, 12px); }
.qe-auth__points li { display: flex; align-items: flex-start; gap: 12px; font-size: 13.5px; color: var(--qe-shell-ink); }
.qe-auth__points li i {
  flex: 0 0 30px; width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(25, 181, 224, .14); color: var(--qe-accent); font-size: 13px; border: 1px solid rgba(25, 181, 224, .2);
}
.qe-auth__points li b { display: block; color: #fff; font-weight: 600; }
.qe-auth__points li span { color: var(--qe-shell-ink-2); font-size: 12.5px; }

/* artwork takes whatever height is left and never pushes the page */
.qe-auth__art { flex: 1 1 auto; min-height: 0; display: flex; align-items: flex-end; justify-content: center; padding-top: 12px; }
.qe-auth__art svg { width: 100%; height: 100%; max-height: 280px; display: block; }
.qe-auth__foot { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; font-size: 11.5px; color: var(--qe-shell-ink-2); }

/* lane dashes */
.qe-lane { stroke-dasharray: 26 22; animation: qe-lane 6s linear infinite; }
.qe-lane--slow { animation-duration: 9s; }
@keyframes qe-lane { to { stroke-dashoffset: -480; } }
.qe-light { animation: qe-blink 3s ease-in-out infinite; }
.qe-light:nth-child(2n) { animation-delay: 1.5s; }
@keyframes qe-blink { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes qe-pulse { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); } 70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }

/* ======================= Access panel (right) ======================= */
.qe-auth__panel {
  flex: 1 1 auto; min-width: 0; position: relative; display: flex; flex-direction: column; overflow-y: auto;
  padding: clamp(14px, 2.6vh, 28px) clamp(20px, 3vw, 44px);
  background:
    radial-gradient(900px 500px at 100% 0%, rgba(25, 181, 224, .10), transparent 60%),
    radial-gradient(700px 500px at 0% 100%, rgba(124, 92, 255, .07), transparent 60%),
    var(--qe-canvas);
}
/* faint topographic lines */
.qe-auth__panel:before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .55;
  background-image:
    linear-gradient(rgba(15, 23, 42, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, .035) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
          mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
}
.qe-auth__panel > * { position: relative; z-index: 1; }

.qe-auth__topbar { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.qe-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .75); border: 1px solid var(--qe-line); color: var(--qe-ink-2);
  font-size: 12px; font-weight: 600; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.qe-pill i { color: var(--qe-accent-ink); }
.qe-pill--link { text-decoration: none !important; transition: border-color .15s ease, color .15s ease; }
.qe-pill--link:hover { border-color: var(--qe-accent); color: var(--qe-ink); }

.qe-auth__center { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; padding: clamp(10px, 2vh, 24px) 0; min-height: 0; }
.qe-auth__card { width: 100%; max-width: 440px; }
.qe-auth__card--wide { max-width: 580px; }

.qe-auth__back { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 12.5px; font-weight: 600; color: var(--qe-ink-3); text-decoration: none !important; }
.qe-auth__back:hover { color: var(--qe-ink); }

.qe-auth__box {
  position: relative; background: rgba(255, 255, 255, .92); border: 1px solid rgba(255, 255, 255, .9);
  border-radius: var(--qe-r); box-shadow: var(--qe-shadow-lg); padding: clamp(20px, 3.4vh, 34px) clamp(20px, 2.6vw, 34px);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); overflow: hidden;
}
.qe-auth__box:before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--qe-accent), var(--qe-accent-2)); }

.qe-auth__head { display: flex; align-items: center; gap: 14px; margin-bottom: clamp(14px, 2.6vh, 24px); }
.qe-auth__badge {
  flex: 0 0 48px; width: 48px; height: 48px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 19px; background: linear-gradient(135deg, var(--qe-accent), #0E8FB8);
  box-shadow: 0 12px 24px -12px rgba(25, 181, 224, .9), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.qe-auth__badge--violet { background: linear-gradient(135deg, #8B73FF, var(--qe-accent-2)); box-shadow: 0 12px 24px -12px rgba(124, 92, 255, .9); }
.qe-auth__head h2 { margin: 0; font-size: clamp(19px, 2.8vh, 23px); font-weight: 750; font-weight: 700; letter-spacing: -.02em; color: var(--qe-ink); line-height: 1.2; }
.qe-auth__head p { margin: 3px 0 0; color: var(--qe-ink-3); font-size: 13px; }

/* ---------- Fields ---------- */
.qe-field { margin-bottom: clamp(10px, 1.9vh, 16px); }
.qe-field__label { display: flex; align-items: center; justify-content: space-between; margin: 0 0 6px; }
.qe-field label { display: block; margin: 0; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--qe-ink-3); }
.qe-field__aside { font-size: 12px; font-weight: 600; }
.qe-field__wrap { position: relative; }
.qe-field__wrap > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--qe-ink-3); font-size: 13px; pointer-events: none; transition: color .15s ease; }
.qe-field__wrap:focus-within > i { color: var(--qe-accent-ink); }
.qe-auth .form-control {
  height: clamp(42px, 5.6vh, 48px); padding: 8px 14px; font-family: var(--qe-font); font-size: 14px; color: var(--qe-ink); box-shadow: none;
  background: var(--qe-surface-2); border: 1px solid var(--qe-line); border-radius: var(--qe-r-sm);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; width: 100%; display: block;
}
.qe-auth .form-control::placeholder { color: #A7B3C4; }
.qe-auth .form-control:hover { border-color: var(--qe-line-2); }
.qe-field__wrap > i + .form-control { padding-left: 40px; }
.qe-auth .form-control:focus { background: #fff; border-color: var(--qe-accent); box-shadow: 0 0 0 4px var(--qe-accent-soft); outline: 0; }
.qe-auth .form-control[disabled] { background: var(--qe-surface-2); color: var(--qe-ink-3); cursor: not-allowed; }
/* kill the yellow browser autofill */
.qe-auth input.form-control:-webkit-autofill,
.qe-auth input.form-control:-webkit-autofill:hover,
.qe-auth input.form-control:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--qe-ink); caret-color: var(--qe-ink);
  -webkit-box-shadow: 0 0 0 1000px #F1F7FB inset; box-shadow: 0 0 0 1000px #F1F7FB inset;
  transition: background-color 9999s ease-out 0s;
}
.qe-auth input.form-control:-webkit-autofill:focus { -webkit-box-shadow: 0 0 0 1000px #fff inset, 0 0 0 4px var(--qe-accent-soft); }
.qe-auth select.form-control {
  -webkit-appearance: none; -moz-appearance: none; appearance: none; padding-right: 36px;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238A97AB' d='M1.4 0 6 4.6 10.6 0 12 1.4 6 7.4 0 1.4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.qe-field__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 480px) { .qe-field__row { grid-template-columns: 1fr; gap: 0; } }
.qe-field__toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; background: transparent; color: var(--qe-ink-3); border-radius: 8px; cursor: pointer; }
.qe-field__toggle:hover { background: var(--qe-line); color: var(--qe-ink); }
.qe-field__hint { font-size: 12px; color: var(--qe-ink-3); margin-top: 6px; }
.qe-field__caps { display: none; margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--qe-warn); }
.qe-field__caps.is-on { display: flex; align-items: center; gap: 6px; }
.qe-field__hr { border: 0; border-top: 1px dashed var(--qe-line-2); margin: clamp(10px, 2vh, 18px) 0; }

/* password strength */
.qe-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 8px; }
.qe-meter span { height: 4px; border-radius: 2px; background: var(--qe-line); transition: background .2s ease; }
.qe-meter[data-level="1"] span:nth-child(-n+1) { background: var(--qe-danger); }
.qe-meter[data-level="2"] span:nth-child(-n+2) { background: var(--qe-warn); }
.qe-meter[data-level="3"] span:nth-child(-n+3) { background: #65A30D; }
.qe-meter[data-level="4"] span { background: var(--qe-ok); }

/* ---------- Buttons ---------- */
.qe-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: clamp(44px, 5.8vh, 50px); padding: 0 20px; width: 100%;
  font-family: var(--qe-font); font-size: 14.5px; font-weight: 600; border-radius: var(--qe-r-sm); border: 1px solid transparent; cursor: pointer;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease, transform .05s ease; text-decoration: none !important; overflow: hidden;
}
.qe-btn:active { transform: translateY(1px); }
.qe-btn--primary { background: linear-gradient(135deg, #22C0EA, #0E9FCB); color: #fff; box-shadow: 0 14px 28px -14px rgba(25, 181, 224, .95), inset 0 1px 0 rgba(255, 255, 255, .25); }
.qe-btn--primary:hover, .qe-btn--primary:focus { color: #fff; filter: brightness(1.05); }
.qe-btn--primary .qe-btn__arrow { transition: transform .2s ease; }
.qe-btn--primary:hover .qe-btn__arrow { transform: translateX(3px); }
.qe-btn--ghost { background: var(--qe-surface); color: var(--qe-ink-2); border-color: var(--qe-line-2); width: auto; }
.qe-btn--ghost:hover { background: var(--qe-surface-2); color: var(--qe-ink); }
.qe-btn.is-loading { pointer-events: none; }
.qe-btn.is-loading .qe-btn__label, .qe-btn.is-loading .qe-btn__arrow, .qe-btn.is-loading > i { opacity: 0; }
.qe-btn.is-loading:after {
  content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: qe-spin .7s linear infinite;
}
@keyframes qe-spin { to { transform: rotate(360deg); } }

.qe-auth__actions { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.qe-auth__actions .qe-btn--primary { flex: 1 1 auto; }

.qe-auth__meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: clamp(12px, 2.2vh, 20px); padding-top: clamp(10px, 2vh, 16px); border-top: 1px solid var(--qe-line); font-size: 12px; color: var(--qe-ink-3); }
.qe-auth__meta span { display: inline-flex; align-items: center; gap: 6px; }
.qe-auth__meta i { color: var(--qe-ok); }

.qe-auth__links { margin-top: 14px; text-align: center; font-size: 13px; }

/* steps list (forgot password) */
.qe-steps { list-style: none; padding: 0; margin: 0 0 clamp(12px, 2.2vh, 20px); display: grid; gap: 8px; counter-reset: s; }
.qe-steps li { counter-increment: s; display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--qe-ink-2); }
.qe-steps li:before { content: counter(s); flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--qe-accent-soft); color: var(--qe-accent-ink); font-weight: 700; font-size: 11px; }

.qe-auth__credit { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 11.5px; color: var(--qe-ink-3); flex-wrap: wrap; }
.qe-auth__credit a { color: var(--qe-ink-2); }

/* ---------- Alerts ---------- */
.qe-auth .alert { position: relative; border: 0; border-left: 4px solid; border-radius: var(--qe-r-sm); padding: 10px 40px 10px 14px; margin-bottom: 14px; font-size: 13px; text-align: left; }
.qe-auth .alert h4 { margin: 0 0 2px; font-size: 13px; font-weight: 700; }
.qe-auth .alert .close { position: absolute; right: 10px; top: 8px; opacity: .5; text-shadow: none; font-size: 18px; background: none; border: 0; cursor: pointer; }
.qe-auth .alert p { margin: 0; }
.qe-auth .alert-success { background: var(--qe-ok-soft); border-color: var(--qe-ok); color: #14532D; }
.qe-auth .alert-info { background: var(--qe-info-soft); border-color: var(--qe-info); color: #0C4A6E; }
.qe-auth .alert-warning { background: var(--qe-warn-soft); border-color: var(--qe-warn); color: #78350F; }
.qe-auth .alert-danger, .qe-auth .alert-error { background: var(--qe-danger-soft); border-color: var(--qe-danger); color: #7F1D1D; }

/* ======================= Height-adaptive trimming ======================= */
@media (max-height: 820px) and (min-width: 992px) {
  .qe-auth__points li span { display: none; }
}
@media (max-height: 700px) and (min-width: 992px) {
  .qe-auth__points { display: none; }
  .qe-auth__head p { display: none; }
}
@media (max-height: 600px) and (min-width: 992px) {
  .qe-auth__art { display: none; }
  .qe-auth__copy p { display: none; }
}

/* ======================= Tablet / phone ======================= */
@media (max-width: 991px) {
  .qe-auth__wrap { flex-direction: column; height: auto; min-height: 100vh; overflow: visible; }
  .qe-auth__brand { flex: 0 0 auto; max-width: none; padding: 20px 20px 18px; }
  .qe-auth__copy { margin-top: 16px; }
  .qe-auth__copy h1 { font-size: 24px; }
  .qe-auth__points, .qe-auth__art { display: none; }
  .qe-auth__foot { margin-top: 14px; }
  .qe-auth__panel { overflow: visible; padding: 16px; }
  .qe-auth__center { padding: 16px 0 24px; align-items: flex-start; }
  .qe-auth__box { padding: 22px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .qe-lane, .qe-light, .qe-auth__eyebrow i, .qe-btn.is-loading:after { animation: none; }
}
.qe-field > label { margin-bottom: 6px; }

/* brand mark: the new colour icon (dist/img/favicon.svg) carries its own navy tile */
.qe-auth__mark { background: transparent; border: 0; box-shadow: 0 10px 26px -12px rgba(25, 181, 224, .8); }
.qe-auth__mark img { width: 46px; height: 46px; }
