/* Academic Management Portal - no external fonts or CDNs (strict Content-Security-Policy). */

:root {
  --bg: #f2f5fa;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --ink: #0e1b2e;
  --ink-2: #33415a;
  --muted: #64718a;
  --border: #e1e7f0;
  --border-strong: #c9d3e1;
  --primary: #1b4f8c;
  --primary-hover: #143e6f;
  --primary-soft: #e8f0fa;
  --ring: rgba(27, 79, 140, 0.22);
  --brand-1: #071b36;
  --brand-2: #123f73;
  --gold: #d5a72e;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --danger-border: #fecdca;
  --success: #067647;
  --success-soft: #ecfdf3;
  --success-border: #abefc6;
  --info: #175cd3;
  --info-soft: #eff8ff;
  --info-border: #b2ddff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(14, 27, 46, 0.05), 0 8px 24px rgba(14, 27, 46, 0.06);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", Consolas, ui-monospace, "SF Mono", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
p { margin: 0; }
img { max-width: 100%; -webkit-user-drag: none; user-select: none; -webkit-touch-callout: none; } /* no drag / long-press save */
button { font: inherit; }

.icon { width: 20px; height: 20px; flex: none; }
.icon-sm { width: 16px; height: 16px; }
.icon-xs { width: 13px; height: 13px; }
.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- Auth layout ---------- */

/*
 * Sign-in pages in the style of NUST's Qalam login: the campus photo under a 20% shade, one slate
 * card in the middle (Tailwind slate-600 at 90%), underlined fields with floating labels.
 */
.auth-shell {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* never wider than the screen, whatever the card's width */
  grid-template-rows: 1fr auto;
  min-height: 100vh;
  background: #1e293b;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.auth-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  /* The campus with the NUST and Pakistan flags; placed so the sign-in card stands between the two flags. */
  background: linear-gradient(rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.18)), url("campus.webp") var(--flags-x, 50%) 62% / cover no-repeat;
}

/* The card is centred in the full window height, as on Qalam; the copyright line floats below. */
.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 100vh;
  padding: 56px 16px;
}
/* White text on the slate card: the colour tokens are re-tuned inside it. */
.auth-card {
  --surface: rgba(255, 255, 255, 0.08);
  --surface-2: rgba(255, 255, 255, 0.06);
  --ink: #ffffff;
  --ink-2: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.78);
  --border: rgba(255, 255, 255, 0.22);
  --border-strong: rgba(255, 255, 255, 0.4);
  --ring: rgba(255, 255, 255, 0.25);
  width: min(384px, 100%);
  padding: 40px;
  border-radius: 24px;
  background: rgba(71, 85, 105, 0.9);
  color: var(--ink);
  box-shadow: 0 0 20px rgba(254, 202, 202, 0.35);
  animation: card-in 0.45s ease-out both;
}
/* Scale only, never opacity: if the animation does not run (background tab), the card is still visible. */
@keyframes card-in {
  from { transform: scale(0.96); box-shadow: 0 0 0 rgba(254, 202, 202, 0); }
  to { transform: none; }
}
.auth-card-wide { width: min(470px, 100%); }

/* NUST logo in the page's top-left corner, white over the photo. */
.auth-corner-logo {
  position: absolute;
  z-index: 1;
  top: 22px;
  left: 30px;
  width: 116px;
  height: auto;
  filter: brightness(0) invert(1) drop-shadow(2px 2px 3px rgba(0, 0, 0, 0.6));
}

/* "AMS NUST" wordmark in the 64px-high slot of Qalam's logo, with the same drop shadow. */
.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 64px;
  margin: 0 0 24px;
  filter: drop-shadow(3px 3px 2px rgba(0, 0, 0, 0.7));
}
.auth-logo img { width: 62px; height: auto; filter: brightness(0) invert(1); }
.auth-logo span {
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}

.auth-card h2 { margin-bottom: 8px; font-size: 24px; font-weight: 700; }
.lead { color: var(--muted); margin-bottom: 20px; }
.lead strong { color: var(--ink-2); }

/*
 * Underlined fields; the label sits in the field and moves up once the field is used. Spacing as on
 * Qalam: 32px above the first field, 40px fields 32px apart, then the button 32px lower.
 */
.q-form { padding-top: 32px; }
.q-field { position: relative; }
.q-field + .q-field { margin-top: 32px; }
.q-field input {
  width: 100%;
  height: 40px;
  padding: 0;
  border: 0;
  border-bottom: 2px solid #94a3b8;
  border-radius: 0;
  background: transparent;
  color: #fff;
  caret-color: #fff;
  font: inherit;
  font-size: 18px;
  outline: none;
  transition: border-color 0.15s;
}
.q-field input::placeholder { color: transparent; }
.q-field input:focus { border-bottom-color: #f1f5f9; }
.q-field label {
  position: absolute;
  left: 0;
  top: 8px;
  color: #cbd5e1;
  font-size: 16px;
  line-height: 24px;
  pointer-events: none;
  transition: top 0.15s, font-size 0.15s, color 0.15s;
}
.q-field input:not(:placeholder-shown) + label { top: -20px; font-size: 14px; }
.q-field input:focus + label { top: -20px; font-size: 14px; color: #fff; }
.q-field-password input { padding-right: 42px; }
.q-field .input-action { top: 2px; right: 0; transform: none; color: rgba(255, 255, 255, 0.8); }
.q-field .input-action:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

.auth-card .input-wrap input::placeholder, .auth-card .otp-input::placeholder { color: rgba(255, 255, 255, 0.5); }
.auth-card .input-wrap input:focus, .auth-card .otp-input:focus { border-color: #f1f5f9; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15); }
.auth-card input:-webkit-autofill {
  -webkit-text-fill-color: #fff;
  caret-color: #fff;
  transition: background-color 600000s 0s; /* keeps Chrome's light-blue autofill fill off the card */
}

/* Qalam's dark button. */
.auth-card .btn-primary { background: #111827; border-radius: 4px; font-size: 18px; font-weight: 400; }
.auth-card .btn-primary:hover { background: linear-gradient(90deg, #111827, #1f2937); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.55); }
.auth-card .btn-block { height: 48px; }
.auth-card .q-form .btn-block { margin-top: 32px; }
.auth-card .btn-ghost:hover { border-color: #fff; color: #fff; }
.auth-card .link-button { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

/* Steps on the 2FA page: white and light green instead of the dark blue, which disappears on slate. */
.auth-card .step.is-active { color: #fff; }
.auth-card .step.is-active .step-dot { border-color: #fff; background: #fff; color: #334155; }
.auth-card .step.is-done { color: #86efac; }
.auth-card .step.is-done .step-dot { border-color: #22c55e; background: #22c55e; color: #fff; }
.auth-card .step-line.is-done { background: #22c55e; }

.brand-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 0 16px 18px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 12.5px;
  text-align: center;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}

/* ---------- Progress steps ---------- */

.steps {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.step { display: flex; align-items: center; gap: 8px; }
.step-dot {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  font-size: 12px;
}
.step-line { flex: 0 0 40px; height: 2px; border-radius: 2px; background: var(--border); }
.step-line.is-done { background: var(--success); }
.step.is-active { color: var(--primary); }
.step.is-active .step-dot { border-color: var(--primary); background: var(--primary); color: #fff; }
.step.is-done { color: var(--success); }
.step.is-done .step-dot { border-color: var(--success); background: var(--success); color: #fff; }

/* ---------- Forms ---------- */

.form { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; }
.field label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.input-wrap { position: relative; }
.input-wrap input {
  width: 100%;
  height: 48px;
  padding: 0 46px 0 44px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input-wrap input::placeholder, .otp-input::placeholder { color: #a3adbf; }
.input-wrap input:focus, .otp-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
}
.input-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}
.input-action {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transform: translateY(-50%);
}
.input-action:hover { background: var(--surface-2); color: var(--ink-2); }
.input-action:focus-visible { outline: 3px solid var(--ring); }
.input-action .icon-hide,
.input-action[aria-pressed="true"] .icon-show { display: none; }
.input-action[aria-pressed="true"] .icon-hide { display: block; }

.otp-input {
  width: 100%;
  height: 62px;
  padding: 0 0 0 0.55em;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 30px;
  letter-spacing: 0.55em;
  text-align: center;
}

/* Honeypot: invisible to people, tempting to bots. */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.check {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  cursor: pointer;
}
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-box {
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border: 1.5px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  color: transparent;
  transition: background 0.15s, border-color 0.15s;
}
.check input:checked + .check-box { border-color: var(--primary); background: var(--primary); color: #fff; }
.check input:focus-visible + .check-box { box-shadow: 0 0 0 4px var(--ring); }
.check-text { display: grid; gap: 2px; }
.check-text strong { font-size: 14px; }
.check-text small { color: var(--muted); font-size: 13px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--ring); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { border-color: var(--border-strong); background: var(--surface); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-block { width: 100%; height: 48px; }
.btn-sm { height: 36px; padding: 0 12px; font-size: 14px; }
.btn:disabled { opacity: 0.7; cursor: progress; }
.btn.is-loading { cursor: progress; }

/* Busy state of a submit button: the label is swapped for a spinner and "Signing in…". */
.btn .btn-busy { display: none; align-items: center; gap: 10px; }
.btn.is-loading .btn-label { display: none; }
.btn.is-loading .btn-busy { display: inline-flex; }
.spinner {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: conic-gradient(from 90deg, rgba(255, 255, 255, 0) 0deg, rgba(255, 255, 255, 0.15) 60deg, #fff 330deg, #fff 360deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  animation: spinner-turn 0.75s linear infinite;
}
@keyframes spinner-turn { to { transform: rotate(360deg); } }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.link-button:hover { text-decoration: underline; }
.switch-account { margin-top: 18px; text-align: center; }

/* ---------- Alerts ---------- */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
  padding: 12px 14px;
  border: 1px solid;
  border-radius: 10px;
  font-size: 14px;
}
.alert .icon { margin-top: 1px; }
.alert small { display: block; margin-top: 4px; font-weight: 600; }
.alert-error { border-color: var(--danger-border); background: var(--danger-soft); color: var(--danger); }
.alert-success { border-color: var(--success-border); background: var(--success-soft); color: var(--success); }
.alert-info { border-color: var(--info-border); background: var(--info-soft); color: var(--info); }

/* Like Qalam's "Developed by" line: 28px below the button. */
.card-credit {
  margin-top: 28px;
  color: #fff;
  font-size: 12px;
  font-weight: 300;
  line-height: 16px;
  letter-spacing: 0.05em;
  text-align: center;
}
.card-credit strong { font-weight: 600; }

/* ---------- 2FA setup ---------- */

.setup-list { display: grid; gap: 12px; margin: 0 0 20px; padding: 0; list-style: none; }
.setup-list li { display: flex; gap: 12px; }
.setup-list div { display: grid; }
.setup-list strong { font-size: 14px; }
.setup-list span:not(.setup-num) { color: var(--muted); font-size: 13.5px; }
.setup-num {
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}
.setup-final { display: flex; align-items: center; gap: 12px; margin: 22px 0 14px; font-size: 14px; }

.qr-block {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.qr {
  width: 172px;
  height: 172px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}
.qr svg { display: block; width: 100%; height: 100%; }
.secret { display: grid; justify-items: start; gap: 8px; }
.secret-label { color: var(--muted); font-size: 13px; }
.secret-key {
  padding: 8px 10px;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.04em;
  word-break: break-all;
}
.secret-meta { color: var(--muted); font-size: 12px; }

.verify-badge {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary);
}
.verify-badge .icon { width: 26px; height: 26px; }

/* ---------- Dashboard (laid out like NUST's Qalam dashboard) ---------- */

.page-portal { background: #f1f3f7; }
.dash {
  --dash-purple: #6c3fe5;
  --dash-text: #1f2937;
  --dash-muted: #4b5563;
  --dash-line: #e9ecf1;
  --dash-font: "Poppins", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  display: grid;
  grid-template-columns: 298px minmax(0, 1fr);
  gap: 20px;
  min-height: 100vh;
  padding: 10px 20px 10px 6px;
  color: var(--dash-text);
  font-family: var(--dash-font);
}
.dash.side-collapsed { grid-template-columns: minmax(0, 1fr); padding-left: 20px; }
.dash.side-collapsed .dash-side { display: none; }

/* Sidebar */
.dash-side {
  position: sticky;
  top: 10px;
  display: flex;
  flex-direction: column;
  align-self: start;
  height: calc(100vh - 20px);
  overflow-y: auto;
  padding: 18px 16px 16px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
/* NUST seal + "AMS", like Qalam's seal + "NUST". */
.dash-logo { display: flex; align-items: center; justify-content: flex-start; gap: 12px; margin: 4px 0 22px; padding-left: 8px; }
.dash-logo img { width: 60px; height: 60px; }
.dash-logo span { color: #0d2a4a; font-size: 34px; font-weight: 700; letter-spacing: 0.01em; }
.dash-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--dash-line);
  border-radius: 8px;
}
.dash-user-meta { display: grid; min-width: 0; line-height: 1.3; }
.dash-user-meta strong { overflow: hidden; color: var(--dash-text); font-size: 16px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.dash-user-meta span { overflow: hidden; color: var(--dash-muted); font-size: 13.5px; text-overflow: ellipsis; white-space: nowrap; }
.dash-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1b4f8c, #6c3fe5);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}
.dash-avatar-sm { width: 40px; height: 40px; font-size: 14px; }
.dash-menu-title { margin: 30px 4px 14px; color: var(--dash-text); font-size: 16px; font-weight: 500; }
.dash-menu { display: grid; gap: 2px; }
.dash-menu a {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 13px 8px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--dash-muted);
  font: inherit;
  font-size: 16px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.dash-menu a .icon { width: 22px; height: 22px; color: #5f6b7a; }
.dash-menu a:hover { background: #f4f2fe; color: var(--dash-purple); }
.dash-menu a:hover .icon { color: var(--dash-purple); }
.dash-menu a.is-active { background: #f4f2fe; color: var(--dash-purple); font-weight: 500; }
.dash-menu a.is-active .icon { color: var(--dash-purple); }
.dash-menu-go { margin-left: auto; opacity: 0.55; }

/* Top bar */
.dash-main { display: flex; flex-direction: column; min-width: 0; }
.dash-top {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 80px;
  padding: 0 26px 0 30px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.dash-burger {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--dash-purple);
  cursor: pointer;
}
.dash-burger:hover { background: #f4f2fe; }
.dash-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(232px, 40vw);
  height: 44px;
  padding: 0 14px;
  border-radius: 8px;
  background: #f3f4f6;
  color: #9ca3af;
}
.dash-search input { width: 100%; border: 0; background: none; color: var(--dash-text); font: inherit; font-size: 16px; outline: none; }
.dash-search input::placeholder { color: #6b7280; }
.dash-top-name { color: var(--dash-purple); font-size: 15px; font-weight: 600; }

/* Account menu under the avatar (name + avatar open it). */
.dash-account { position: relative; margin-left: auto; }
.dash-account summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 4px 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  list-style: none;
}
.dash-account summary::-webkit-details-marker { display: none; }
.dash-account summary:hover, .dash-account[open] summary { background: #f4f2fe; }
.dash-account summary:focus-visible { outline: 3px solid rgba(108, 63, 229, 0.35); outline-offset: 2px; }
.dash-account-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 10px);
  right: 0;
  width: 240px;
  padding: 8px;
  border: 1px solid var(--dash-line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.14);
}
.dash-account-head { display: grid; gap: 2px; padding: 10px 12px 12px; border-bottom: 1px solid var(--dash-line); }
.dash-account-head strong { overflow: hidden; color: var(--dash-text); font-size: 14.5px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.dash-account-head span { color: var(--dash-muted); font-size: 13px; }
.dash-account-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: #b42318;
  font: inherit;
  font-size: 14.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.dash-account-menu button:hover { background: #fef3f2; }

.dash-crumbs { display: flex; align-items: center; gap: 8px; margin: 30px 0 22px; color: var(--dash-text); font-size: 15px; }
.dash-crumb-home { margin-right: 18px; font-size: 20px; }

.dash-empty {
  margin-bottom: 22px;
  padding: 18px 22px;
  border: 1px dashed #c7cdd8;
  border-radius: 10px;
  background: #fff;
  color: var(--dash-muted);
  font-size: 14.5px;
}

/* Coloured cards */
.dash-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.dash-stat {
  position: relative;
  display: grid;
  align-content: center;
  gap: 4px;
  min-height: 110px;
  padding: 18px 22px;
  border-radius: 6px;
  color: #fff;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}
.dash-stat:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(15, 23, 42, 0.16); }
.dash-stat-title { font-size: 20px; font-weight: 600; }
.dash-stat-value { font-size: 28px; font-weight: 700; line-height: 1.2; }
.dash-stat-go { position: absolute; right: 22px; bottom: 26px; width: 18px; height: 18px; }
.dash-green { background: #0b7f5f; }
.dash-amber { background: #fda800; }
.dash-red { background: #ef2f55; }
.dash-blue { background: #3b9cf4; }

/* Banner with Qalam's dotted background */
.dash-banner {
  margin-top: 22px;
  padding: 20px 22px;
  border-radius: 10px;
  background:
    radial-gradient(circle, #e6e8ec 2px, transparent 2.5px) 0 0 / 26px 26px,
    radial-gradient(circle, #eef0f3 3px, transparent 3.5px) 13px 13px / 26px 26px,
    #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.dash-banner h2 { font-size: 19px; font-weight: 500; }
.dash-banner p { margin-top: 4px; color: var(--dash-muted); font-size: 14px; }

/* Service cards, like Qalam's news cards */
.dash-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; margin-top: 22px; }
.dash-card { overflow: hidden; border-radius: 8px; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06); }
/* Each service's own page as the card picture (config portal_links[].image). */
.dash-card-img { display: block; width: 100%; height: auto; aspect-ratio: 2.4 / 1; object-fit: cover; object-position: center; background: #e5e7eb; }
.dash-card-body { display: grid; justify-items: center; gap: 8px; padding: 18px 16px 22px; text-align: center; }
.dash-card h3 { color: #111827; font-size: 18px; font-weight: 400; line-height: 1.25; }
.dash-card-host { color: #374151; font-size: 14px; }
.dash-card-desc { color: #374151; font-size: 14px; }
.dash-btn {
  margin-top: 6px;
  padding: 6px 12px;
  border-radius: 4px;
  background: var(--dash-purple);
  color: #fff;
  font-size: 13.5px;
  text-decoration: none;
}
.dash-btn:hover { background: #5a2fcf; }

/* Bottom panels */
.dash-panels { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 22px; margin-top: 22px; }
.dash-panel { padding: 22px; border-radius: 10px; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06); }
.dash-panel h2 { margin-bottom: 18px; font-size: 19px; font-weight: 500; }
.dash-panel-table { padding: 22px 0 6px; }
.dash-panel-table h2 { padding: 0 22px; }
.dash-session { display: grid; gap: 14px; }
.dash-session > div { display: flex; gap: 14px; }
.dash-session p { display: grid; gap: 2px; color: var(--dash-muted); font-size: 14px; }
.dash-session strong { color: var(--dash-text); font-size: 15px; font-weight: 600; }
.dash-session-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #f4f2fe;
  color: var(--dash-purple);
}
.dash-link {
  margin-top: 16px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--dash-purple);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.dash-link:hover { text-decoration: underline; }
.dash-table-wrap { overflow-x: auto; }
.dash-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.dash-table th { padding: 14px 16px; background: #3b9cf4; color: #fff; font-weight: 500; text-align: left; white-space: nowrap; }
.dash-table td { padding: 12px 16px; border-bottom: 1px solid var(--dash-line); color: var(--dash-muted); white-space: nowrap; }
.dash-table-empty { color: #9ca3af; text-align: center; }
.dash-foot { margin-top: auto; padding: 26px 0 8px; color: #6b7280; font-size: 12.5px; text-align: center; }

/* Search: services that don't match are hidden (separately from the account-check hiding). */
.is-filtered { display: none !important; }

@media (max-width: 1180px) {
  .dash, .dash.side-collapsed { grid-template-columns: minmax(0, 1fr); padding: 10px 14px; }
  .dash-side {
    position: fixed;
    z-index: 40;
    top: 0;
    left: 0;
    width: 298px;
    height: 100vh;
    border-radius: 0 10px 10px 0;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }
  .dash.side-collapsed .dash-side { display: flex; }
  .dash.side-open .dash-side { transform: none; }
  .dash-stats, .dash-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-panels { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .dash-top { gap: 10px; padding: 0 14px; }
  .dash-top-name { display: none; }
  .dash-stats, .dash-cards { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .dash-crumbs { margin: 20px 0 16px; }
}

/* ---------- Warning / error pages ---------- */

.center-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}
.center-shell-danger {
  background:
    radial-gradient(700px 400px at 50% 0%, rgba(180, 35, 24, 0.12), transparent 70%),
    var(--bg);
}
.notice-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  width: 100%;
  max-width: 560px;
  padding: 40px 36px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}
.notice-card-danger { border-color: var(--danger-border); border-top: 5px solid var(--danger); }
.notice-card h1 { font-size: 26px; }
.notice-card-danger h1 { color: var(--danger); }
.notice-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--danger-soft);
  color: var(--danger);
}
.notice-icon .icon { width: 32px; height: 32px; }
.notice-icon-neutral { background: var(--primary-soft); color: var(--primary); }
.notice-card .eyebrow { color: var(--muted); }
.notice-lead { color: var(--ink-2); font-size: 16px; }
.incident {
  display: grid;
  width: 100%;
  margin: 6px 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: left;
}
.incident div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}
.incident div:first-child { border-top: 0; }
.incident dt { color: var(--muted); font-size: 13px; }
.incident dd { margin: 0; font-family: var(--mono); font-size: 13px; font-weight: 600; text-align: right; }
.notice-foot { color: var(--muted); font-size: 12.5px; }

/* ---------- Responsive ---------- */

/* Up to tablet width the card can reach the corner logo, so it starts below it. */
@media (max-width: 900px) {
  .auth-panel { padding-top: 128px; }
}
@media (max-width: 600px) {
  .auth-corner-logo { top: 14px; left: 16px; width: 84px; }
  .auth-panel { padding-top: 104px; }
}
@media (max-width: 480px) {
  .auth-card, .auth-card-wide { padding: 32px 24px; border-radius: 20px; }
  .auth-logo span { font-size: 28px; }
}

@media (max-width: 640px) {
  .qr-block { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
  .secret { justify-items: center; }
  .notice-card { padding: 30px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Gateway sign-in page ---------- */

/*
 * The sign-in page as a gateway at night: people come in along the routes on the left, pass through
 * the lit arch (the sign-in card) and leave for the university systems on the right. The routes are
 * one stretched SVG behind everything; the labels are placed at the same heights as the route ends.
 */
.gate {
  --night-1: #050f22;
  --night-2: #0a2247;
  --gold-light: #f4cf6a;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(60% 55% at 50% 50%, rgba(244, 207, 106, 0.16), transparent 70%),
    radial-gradient(120% 90% at 50% 110%, #123f73, transparent 60%),
    linear-gradient(160deg, var(--night-1), var(--night-2));
  color: #fff;
}
.gate-sky { position: absolute; inset: 0; z-index: -1; }
.gate-routes { display: block; width: 100%; height: 100%; }
.gate-route { fill: none; stroke: rgba(255, 255, 255, 0.11); stroke-width: 1.5; }
/* One short bright dash per route, travelling its whole length: towards the gate on the way in, away from it on the way out. */
.gate-pulse {
  fill: none;
  stroke: var(--gold-light);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 5 95;
  stroke-dashoffset: 100;
  filter: drop-shadow(0 0 6px rgba(244, 207, 106, 0.9));
  animation: gate-travel 5.2s linear infinite;
}
.gate-pulse-out { stroke: #9fd0ff; filter: drop-shadow(0 0 6px rgba(120, 190, 255, 0.9)); animation-duration: 4.6s; }
.gate-delay-1 { animation-delay: -0.4s; }
.gate-delay-2 { animation-delay: -2.9s; }
.gate-delay-3 { animation-delay: -1.6s; }
.gate-delay-4 { animation-delay: -4.1s; }
.gate-delay-5 { animation-delay: -2.2s; }
.gate-delay-6 { animation-delay: -3.5s; }
@keyframes gate-travel { to { stroke-dashoffset: 0; } }

/* Who comes in (left) and where it leads (right). */
.gate-side { position: absolute; inset: 0 auto 0 0; width: 220px; pointer-events: none; }
.gate-to { inset: 0 0 0 auto; }
.gate-side ul { margin: 0; padding: 0; list-style: none; }
.gate-side li {
  position: absolute;
  left: 28px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(6, 20, 44, 0.82);
  color: rgba(255, 255, 255, 0.92);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  transform: translateY(-50%);
  animation: gate-label-in 0.6s ease-out both;
}
.gate-to li { --gate-slide: 10px; left: auto; right: 28px; border-color: rgba(159, 208, 255, 0.3); }
.gate-from .icon { color: var(--gold-light); }
.gate-to .icon { color: #9fd0ff; }
.gate-side li:nth-child(2) { animation-delay: 0.08s; }
.gate-side li:nth-child(3) { animation-delay: 0.16s; }
.gate-side li:nth-child(4) { animation-delay: 0.24s; }
.gate-side li:nth-child(5) { animation-delay: 0.32s; }
.gate-side li:nth-child(6) { animation-delay: 0.4s; }
/* Movement only, never opacity: labels stay readable if the animation does not run. */
@keyframes gate-label-in { from { transform: translate(var(--gate-slide, -10px), -50%); } }
/* Label n of m sits at n / (m + 1) of the height, like the end of its route. */
.gate-count-1 li { top: 50%; }
.gate-count-2 li:nth-child(1) { top: 33.33%; } .gate-count-2 li:nth-child(2) { top: 66.67%; }
.gate-count-3 li:nth-child(1) { top: 25%; } .gate-count-3 li:nth-child(2) { top: 50%; } .gate-count-3 li:nth-child(3) { top: 75%; }
.gate-count-4 li:nth-child(1) { top: 20%; } .gate-count-4 li:nth-child(2) { top: 40%; }
.gate-count-4 li:nth-child(3) { top: 60%; } .gate-count-4 li:nth-child(4) { top: 80%; }
.gate-count-5 li:nth-child(1) { top: 16.67%; } .gate-count-5 li:nth-child(2) { top: 33.33%; } .gate-count-5 li:nth-child(3) { top: 50%; }
.gate-count-5 li:nth-child(4) { top: 66.67%; } .gate-count-5 li:nth-child(5) { top: 83.33%; }
.gate-count-6 li:nth-child(1) { top: 14.29%; } .gate-count-6 li:nth-child(2) { top: 28.57%; } .gate-count-6 li:nth-child(3) { top: 42.86%; }
.gate-count-6 li:nth-child(4) { top: 57.14%; } .gate-count-6 li:nth-child(5) { top: 71.43%; } .gate-count-6 li:nth-child(6) { top: 85.71%; }
.gate-caption {
  position: absolute;
  left: 30px;
  bottom: 22px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.gate-to .gate-caption { left: auto; right: 30px; }

/* The gate: an arched card with two faint outer arches that breathe. */
.gate-stage { display: grid; place-items: center; min-width: 0; padding: 72px 16px 76px; }
.gate-door { position: relative; width: min(420px, 100%); animation: gate-rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.gate-door::before, .gate-door::after {
  content: "";
  position: absolute;
  inset: -22px;
  z-index: -1;
  border: 1px solid rgba(244, 207, 106, 0.34);
  border-radius: 232px 232px 40px 40px;
  animation: gate-breathe 5s ease-in-out infinite;
}
.gate-door::after { inset: -46px; border-color: rgba(244, 207, 106, 0.16); border-radius: 256px 256px 60px 60px; animation-delay: -2.5s; }
/* Movement only, never opacity: if the animation does not run (background tab), the card is still solid. */
@keyframes gate-rise { from { transform: translateY(18px) scale(0.985); } }
@keyframes gate-breathe { 50% { opacity: 0.35; } }
/* While the form is being sent the arches light up, as if the gate were opening. */
.gate-door:has(form[aria-busy="true"])::before, .gate-door:has(form[aria-busy="true"])::after {
  border-color: var(--gold-light);
  animation-duration: 1.1s;
}

.gate-card {
  padding: 46px 40px 30px;
  border-radius: 210px 210px 22px 22px;
  background: linear-gradient(180deg, #fffdf6, #ffffff 42%);
  color: var(--ink);
  text-align: center;
  box-shadow: 0 0 0 1px rgba(244, 207, 106, 0.4), 0 30px 70px rgba(0, 0, 0, 0.5), 0 0 110px rgba(244, 207, 106, 0.2);
}
.gate-seal { display: block; width: 72px; height: 72px; margin: 0 auto 14px; }
.gate-eyebrow { color: #9a7412; font-size: 11.5px; font-weight: 700; letter-spacing: 0.2em; }
.gate-card h1 { margin: 6px 0 0; color: var(--brand-1); font-family: var(--serif); font-size: 23px; font-weight: 700; line-height: 1.15; letter-spacing: -0.005em; }
.gate-lead { color: var(--muted); font-size: 14.5px; }
.gate-card .alert { margin-top: 18px; text-align: left; }

.gate-form { padding-top: 26px; text-align: left; }
.gate-field { position: relative; }
.gate-field + .gate-field { margin-top: 14px; }
.gate-field input {
  width: 100%;
  height: 54px;
  padding: 20px 14px 4px;
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.gate-field input::placeholder { color: transparent; }
.gate-field input:hover { border-color: #9fb0c7; }
.gate-field input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring); }
.gate-field label {
  position: absolute;
  left: 15px;
  top: 16px;
  color: var(--muted);
  font-size: 16px;
  line-height: 22px;
  pointer-events: none;
  transition: top 0.15s, font-size 0.15s, color 0.15s;
}
.gate-field input:not(:placeholder-shown) + label,
.gate-field input:focus + label { top: 6px; font-size: 12px; line-height: 16px; }
.gate-field input:focus + label { color: var(--primary); }
.gate-field-password input { padding-right: 48px; }

.gate-enter {
  height: 52px;
  margin-top: 20px;
  border-radius: 12px;
  background: linear-gradient(180deg, #154a86, var(--brand-1));
  font-size: 16.5px;
  letter-spacing: 0.01em;
}
.gate-enter:hover { background: linear-gradient(180deg, #1b5aa0, #0b2850); }
.gate-enter:focus-visible { box-shadow: 0 0 0 4px rgba(244, 207, 106, 0.6); }
.gate-enter .btn-label { display: inline-flex; align-items: center; gap: 8px; }
.gate-enter .btn-label .icon { transition: transform 0.2s; }
.gate-enter:hover .btn-label .icon { transform: translateX(4px); }
.gate-enter.is-loading .btn-label { display: none; }

.gate-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 12.5px;
}
.gate-note .icon { color: var(--success); }

.gate-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 16px 16px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  text-align: center;
}
.gate-foot span { display: block; margin-top: 2px; color: rgba(255, 255, 255, 0.5); }
.gate-foot strong { font-weight: 600; }

/* Below this width the labels would run into the card: the routes stay as a backdrop. */
@media (max-width: 1080px) {
  .gate-side { display: none; }
}
@media (max-width: 900px) {
  .gate-stage { padding-top: 112px; }
}
@media (max-width: 480px) {
  .gate-stage { padding: 96px 12px 84px; }
  .gate-door::after { display: none; }
  .gate-door::before { inset: -10px; border-radius: 50vw 50vw 30px 30px; }
  .gate-card { padding: 38px 22px 24px; border-radius: 50vw 50vw 20px 20px; }
  .gate-card h1 { font-size: 22px; }
}
/* Short windows: flatten the arch a little so the card fits without scrolling. */
@media (max-height: 760px) and (min-width: 481px) {
  .gate-stage { padding-top: 40px; padding-bottom: 60px; }
  .gate-card { padding-top: 34px; border-radius: 210px 210px 22px 22px / 150px 150px 22px 22px; }
  .gate-door::before { border-radius: 232px 232px 40px 40px / 170px 170px 40px 40px; }
  .gate-door::after { border-radius: 256px 256px 60px 60px / 190px 190px 60px 60px; }
  .gate-seal { width: 60px; height: 60px; margin-bottom: 10px; }
  .gate-form { padding-top: 18px; }
}

/* The walking figures (app.js): drawn in real pixels on .gate-live, which then replaces the pulses. */
.gate-live { position: absolute; inset: 0; width: 100%; height: 100%; }
.gate-is-live .gate-routes { display: none; }
.gate-walker { --walker: var(--gold-light); --walker-glow: rgba(244, 207, 106, 0.7); }
.gate-walker-out { --walker: #9fd0ff; --walker-glow: rgba(120, 190, 255, 0.7); }
.gate-walker-body { filter: drop-shadow(0 0 5px var(--walker-glow)); }
.gate-walker-body line { stroke: var(--walker); stroke-width: 3.2; stroke-linecap: round; }
.gate-walker-body circle { fill: var(--walker); }
.gate-walker-badge circle { fill: #0b2147; stroke: var(--walker); stroke-width: 1.2; }
.gate-walker-badge svg { color: var(--walker); }

/* Credit at the foot of the gate card: a gold rule, the team on a soft navy ribbon, then the copyright. */
.gate-credit {
  position: relative;
  margin: 22px -40px -30px;
  padding: 18px 24px 16px;
  border-radius: 0 0 22px 22px;
  background: linear-gradient(180deg, #f6f8fc, #edf2f9);
  text-align: center;
}
.gate-credit::before {
  content: "";
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
}
.gate-credit-team {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 4px 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--brand-1);
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  box-shadow: 0 4px 14px rgba(7, 27, 54, 0.22);
}
.gate-credit-team strong {
  background: linear-gradient(90deg, var(--gold-light), #fff3c8, var(--gold-light));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
  letter-spacing: 0.02em;
  animation: gate-shine 4s linear infinite;
}
@keyframes gate-shine { to { background-position: -200% 0; } }
.gate-credit-copy { margin-top: 8px; color: var(--muted); font-size: 11.5px; }
.page-login { background: #050f22; }
.gate-stage { padding-bottom: 56px; }
@media (max-width: 480px) {
  .gate-credit { margin: 20px -22px -24px; padding: 16px 14px 14px; border-radius: 0 0 20px 20px; }
  .gate-stage { padding-bottom: 32px; }
}

/* ---------- Gateway card: motion and shine ---------- */

/* The seal sits in a slowly turning gold ring. */
.gate-seal-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  margin: 0 auto 12px;
  border-radius: 50%;
}
.gate-seal-ring::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 55%, rgba(244, 207, 106, 0.2) 70%, var(--gold-light) 88%, transparent 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  animation: gate-spin 6s linear infinite;
}
.gate-seal-ring::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(154, 116, 18, 0.22);
  border-radius: 50%;
}
.gate-seal-ring .gate-seal { margin: 0; }
@keyframes gate-spin { to { transform: rotate(360deg); } }

/* A band of gold light passes over the navy title now and then. */
.gate-title {
  background: linear-gradient(100deg, var(--brand-1) 0 40%, #c8961f 47%, #ffe7a0 50%, #c8961f 53%, var(--brand-1) 60% 100%);
  background-size: 300% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gate-title-shine 7s ease-in-out infinite 1s;
}
@keyframes gate-title-shine {
  0%, 55% { background-position: 100% 0; }
  85%, 100% { background-position: 0 0; }
}
.gate-eyebrow { animation: gate-eyebrow 3.5s ease-in-out infinite; }
@keyframes gate-eyebrow { 50% { letter-spacing: 0.26em; color: #c8961f; } }

/* Fields and button arrive one after another (movement only, never opacity). */
.gate-form > * { animation: gate-field-in 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.gate-form > :nth-child(3) { animation-delay: 0.12s; }
.gate-form > :nth-child(4) { animation-delay: 0.22s; }
.gate-form > :nth-child(5) { animation-delay: 0.32s; }
@keyframes gate-field-in { from { transform: translateY(14px); } }

/* Field: an icon at the start, and on focus a border of moving gold and blue light. */
.gate-field-icon {
  position: absolute;
  left: 15px;
  top: 18px;
  z-index: 1;
  color: #8a97ab;
  pointer-events: none;
  transition: color 0.2s, transform 0.2s;
}
.gate-field input {
  padding-left: 42px;
  border: 1.5px solid transparent;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(90deg, var(--border-strong), var(--border-strong)) border-box;
}
.gate-field label { left: 43px; }
.gate-field input:hover {
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(90deg, #9fb0c7, #9fb0c7) border-box;
}
.gate-field input:focus {
  background:
    linear-gradient(#fffefa, #fff) padding-box,
    linear-gradient(90deg, #d5a72e, #1b4f8c, #f4cf6a, #1b4f8c, #d5a72e) border-box;
  background-size: 100% 100%, 300% 100%;
  box-shadow: 0 0 0 4px rgba(244, 207, 106, 0.18), 0 8px 22px rgba(27, 79, 140, 0.12);
  animation: gate-border-flow 3s linear infinite;
}
@keyframes gate-border-flow { to { background-position: 0 0, -300% 0; } }
.gate-field:focus-within .gate-field-icon { color: #b8861a; transform: scale(1.1); }
.gate-field input:focus + label { color: #9a7412; }

/* Button: a sheen sweeps across every few seconds, and faster on hover. */
.gate-enter { position: relative; overflow: hidden; box-shadow: 0 10px 24px rgba(7, 27, 54, 0.28); }
.gate-enter::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 231, 160, 0.45), transparent);
  transform: skewX(-20deg);
  animation: gate-sheen 4.5s ease-in-out infinite 1.5s;
}
.gate-enter:hover::after { animation-duration: 1.4s; }
@keyframes gate-sheen {
  0%, 60% { left: -60%; }
  100% { left: 130%; }
}
.gate-enter:active { transform: translateY(1px); }

/* The shield gives a soft pulse. */
.gate-note .icon { animation: gate-pulse 2.8s ease-in-out infinite; }
@keyframes gate-pulse { 50% { transform: scale(1.18); filter: drop-shadow(0 0 4px rgba(6, 118, 71, 0.45)); } }

@media (max-height: 760px) and (min-width: 481px) {
  .gate-seal-ring { width: 74px; height: 74px; margin-bottom: 8px; }
}

/* Credit badge, made to catch the eye: it pops in just after the card, a gold light runs round its border,
   and the team name is large and shining. */
@property --gate-turn { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.gate-credit { padding: 20px 20px 16px; }
.gate-credit-team {
  flex-direction: column;
  gap: 2px;
  padding: 10px 26px 11px;
  border: 2px solid transparent;
  border-radius: 16px;
  background:
    linear-gradient(160deg, #0d2a55, var(--brand-1)) padding-box,
    conic-gradient(from var(--gate-turn), rgba(244, 207, 106, 0.15) 0 60%, var(--gold-light) 80%, #fff6d6 86%, rgba(244, 207, 106, 0.15) 100%) border-box;
  box-shadow: 0 8px 24px rgba(7, 27, 54, 0.35), 0 0 0 0 rgba(244, 207, 106, 0.45);
  animation:
    gate-badge-pop 0.7s cubic-bezier(0.3, 1.6, 0.5, 1) 0.6s both,
    gate-badge-turn 3.5s linear infinite,
    gate-badge-glow 2.6s ease-out 1.4s infinite;
}
.gate-credit-team span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.gate-credit-team strong { font-size: 19px; font-weight: 800; letter-spacing: 0.04em; line-height: 1.2; }
.gate-credit-copy { margin-top: 10px; font-size: 12px; }
/* Movement only, never opacity, so the badge is there even if the animation does not run. */
@keyframes gate-badge-pop { from { transform: scale(0.6) translateY(10px); } }
@keyframes gate-badge-turn { to { --gate-turn: 360deg; } }
@keyframes gate-badge-glow { 0% { box-shadow: 0 8px 24px rgba(7, 27, 54, 0.35), 0 0 0 0 rgba(244, 207, 106, 0.5); } 70%, 100% { box-shadow: 0 8px 24px rgba(7, 27, 54, 0.35), 0 0 0 12px rgba(244, 207, 106, 0); } }
@media (max-height: 760px) and (min-width: 481px) {
  .gate-credit { padding: 14px 16px 12px; }
  .gate-credit-team { padding: 8px 22px 9px; }
  .gate-credit-team strong { font-size: 17px; }
}
/* Credit badge on one line: "Design & Developed by NUST LMS Team". */
.gate-credit-team { flex-direction: row; flex-wrap: nowrap; align-items: baseline; gap: 7px; padding: 10px 20px; white-space: nowrap; }
.gate-credit-team span { font-size: 12px; letter-spacing: 0.04em; text-transform: none; }
.gate-credit-team strong { font-size: 17px; }
@media (max-width: 400px) {
  .gate-credit-team { gap: 5px; padding: 9px 14px; }
  .gate-credit-team span { font-size: 11px; }
  .gate-credit-team strong { font-size: 15px; }
}
/* Very narrow phones: one line would push the card off the screen, so it wraps there. */
@media (max-width: 360px) {
  .gate-credit-team { flex-wrap: wrap; justify-content: center; white-space: normal; }
}
/* A larger seal, so its lettering can be read. */
.gate-seal-ring { width: 124px; height: 124px; margin-bottom: 10px; }
.gate-seal-ring .gate-seal { width: 106px; height: 106px; }
@media (max-height: 760px) and (min-width: 481px) {
  .gate-seal-ring { width: 100px; height: 100px; margin-bottom: 6px; }
  .gate-seal-ring .gate-seal { width: 86px; height: 86px; }
}
@media (max-width: 480px) {
  .gate-seal-ring { width: 108px; height: 108px; }
  .gate-seal-ring .gate-seal { width: 92px; height: 92px; }
}
/* With an error or notice in the card it would grow past the window and bring a scroll bar: the seal and
   the gaps shrink while a message is shown. */
.gate-card .alert { margin: 14px 0 0; padding: 10px 12px; font-size: 14px; line-height: 1.45; }
.gate-card:has(.alert) .gate-seal-ring { width: 84px; height: 84px; margin-bottom: 6px; }
.gate-card:has(.alert) .gate-seal-ring .gate-seal { width: 72px; height: 72px; }
.gate-card:has(.alert) { padding-top: 34px; }
.gate-card:has(.alert) .gate-form { padding-top: 16px; }
.gate-card:has(.alert) .gate-note { margin-top: 10px; }
.gate-card:has(.alert) .gate-credit { margin-top: 14px; padding-top: 14px; padding-bottom: 12px; }
@media (max-height: 760px) and (min-width: 481px) {
  .gate-card:has(.alert) .gate-seal-ring { width: 64px; height: 64px; }
  .gate-card:has(.alert) .gate-seal-ring .gate-seal { width: 54px; height: 54px; }
  .gate-card:has(.alert) { padding-top: 24px; }
  .gate-card:has(.alert) .gate-field + .gate-field { margin-top: 10px; }
  .gate-card:has(.alert) .gate-enter { margin-top: 14px; }
}
.gate-credit-team strong { font-size: 16px; }
@media (max-width: 400px) { .gate-credit-team strong { font-size: 14px; } }

/* ---------- Phones and tablets ---------- */

/* Phones: 100vh includes the browser's address bar, so the dynamic viewport height is used where known. */
.gate, .auth-shell, .auth-panel, .center-shell { min-height: 100dvh; }
@media (max-width: 1180px) {
  .dash-side { height: 100dvh; overflow-y: auto; }
  /* The open menu dims the page behind it; a tap there closes it (app.js). */
  .dash.side-open::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 39;
    background: rgba(15, 23, 42, 0.45);
  }
}
/* Recent sign-ins: on a phone each sign-in becomes a small card with its labels, instead of a wide table. */
@media (max-width: 640px) {
  .dash-table, .dash-table tbody, .dash-table tr, .dash-table td { display: block; width: 100%; }
  .dash-table thead { display: none; }
  .dash-table tr { padding: 10px 0; border-bottom: 1px solid var(--dash-line); }
  .dash-table tr:last-child { border-bottom: 0; }
  .dash-table td { display: flex; justify-content: space-between; gap: 12px; padding: 4px 2px; border: 0; white-space: normal; text-align: right; }
  .dash-table td::before { content: attr(data-label); color: #9ca3af; font-size: 12.5px; text-align: left; flex: none; }
  .dash-table td.dash-table-empty { justify-content: center; text-align: center; }
  .dash-table td.dash-table-empty::before { content: none; }
}
/* Each sign-in in three short lines: date | time, IP | method, then the device. */
@media (max-width: 640px) {
  .dash-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; padding: 12px 0; }
  .dash-table td { display: block; padding: 0; text-align: left; color: var(--dash-ink, #111827); font-size: 14px; }
  .dash-table td::before { display: block; margin-bottom: 1px; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; }
  .dash-table td[data-label="Method"] { order: 4; }
  .dash-table td[data-label="Device"] { order: 5; grid-column: 1 / -1; color: var(--dash-muted); }
  .dash-table td.dash-table-empty { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .dash-table-wrap { padding: 0 22px; }
}

/* Sign-in page between the two flags (campus.webp, 1849 x 851). The photo is drawn 160% of the window
   height, and placed so the gap between the NUST flag (ends at 39% of the photo's width) and the
   Pakistan flag (starts at 51%) is centred on the window, where the card is. */
.page-login .auth-shell::before,
.page-verify .auth-shell::before {
  background:
    linear-gradient(rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.15)),
    url("campus.webp") calc(50vw - 156.4vh) calc(55vh - 92.8vh) / auto 160vh no-repeat,
    #2a5a2a;
}
.page-login .auth-card { width: min(340px, 100%); padding: 34px 30px; }
/* Phones: the photo at the window's height, so both flags show at the card's sides. */
@media (max-width: 600px) {
  .page-login .auth-shell::before,
  .page-verify .auth-shell::before {
    background:
      linear-gradient(rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.15)),
      url("campus.webp") calc(50vw - 97.8vh) 0 / auto 100vh no-repeat,
      #2a5a2a;
  }
}

/* ---------- Sign-in page: split screen ---------- */

/*
 * The campus with the NUST and Pakistan flags fills the left side (a slow zoom keeps it alive), with the
 * system's name over it; the form sits on a clean panel on the right. Entry motion moves things, never
 * fades them, so the page is complete even if animations do not run.
 */
.lx {
  --lx-navy: #071b36;
  --lx-navy-2: #123f73;
  --lx-gold: #d5a72e;
  --lx-gold-2: #f4cf6a;
  --lx-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(400px, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
  background: #fff;
}

/* Photo side */
.lx-hero { position: relative; overflow: hidden; isolation: isolate; background: var(--lx-navy); color: #fff; }
.lx-photo {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: url("campus.webp") 47% 58% / cover no-repeat;
  animation: lx-drift 24s ease-in-out infinite alternate;
}
@keyframes lx-drift { from { transform: scale(1.02); } to { transform: scale(1.1) translate(-1%, -1%); } }
.lx-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(7, 27, 54, 0.55) 0%, rgba(7, 27, 54, 0) 24%),
    linear-gradient(0deg, rgba(5, 15, 34, 0.92) 0%, rgba(7, 27, 54, 0.55) 34%, rgba(7, 27, 54, 0) 62%);
}
.lx-logo {
  position: absolute;
  top: 28px;
  left: 34px;
  width: 112px;
  height: auto;
  filter: brightness(0) invert(1) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}
.lx-hero-text { position: absolute; left: 56px; right: 56px; bottom: 56px; animation: lx-rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.lx-kicker { color: var(--lx-gold-2); font-size: 12.5px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; }
.lx-title {
  margin-top: 12px;
  font-family: var(--lx-serif);
  font-size: clamp(34px, 3.6vw, 56px);
  font-weight: 700;
  line-height: 1.05;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}
.lx-rule {
  display: block;
  width: 96px;
  height: 3px;
  margin: 22px 0 20px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--lx-gold), var(--lx-gold-2), transparent);
  background-size: 200% 100%;
  animation: lx-rule 3.5s ease-in-out infinite;
}
@keyframes lx-rule { 50% { background-position: 100% 0; width: 140px; } }
.lx-chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.lx-chips li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 13.5px;
  font-weight: 600;
  animation: lx-rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.lx-chips li:nth-child(1) { animation-delay: 0.35s; }
.lx-chips li:nth-child(2) { animation-delay: 0.45s; }
.lx-chips li:nth-child(3) { animation-delay: 0.55s; }
.lx-chips li:nth-child(4) { animation-delay: 0.65s; }
.lx-chips li:nth-child(5) { animation-delay: 0.75s; }
.lx-chips li:nth-child(6) { animation-delay: 0.85s; }
.lx-chips .icon { color: var(--lx-gold-2); }
@keyframes lx-rise { from { transform: translateY(16px); } }

/* Form side */
.lx-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 56px 28px;
  background:
    radial-gradient(520px 320px at 100% 0%, rgba(213, 167, 46, 0.1), transparent 70%),
    radial-gradient(520px 360px at 0% 100%, rgba(18, 63, 115, 0.08), transparent 70%),
    #fff;
}
.lx-form-wrap { width: 100%; max-width: 380px; margin: auto auto 0; }
.lx-form-wrap > * { animation: lx-rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.lx-form-wrap > :nth-child(2) { animation-delay: 0.06s; }
.lx-form-wrap > :nth-child(3) { animation-delay: 0.12s; }
.lx-form-wrap > :nth-child(n + 4) { animation-delay: 0.18s; }
.lx-seal { display: block; width: 64px; height: 64px; margin-bottom: 22px; filter: drop-shadow(0 6px 14px rgba(18, 63, 115, 0.25)); }
.lx-heading { color: var(--lx-navy); font-family: var(--lx-serif); font-size: 32px; font-weight: 700; letter-spacing: -0.01em; }
.lx-sub { margin-top: 6px; color: var(--muted); font-size: 15px; }
.lx-form-wrap .alert { margin: 20px 0 0; }

.lx-form { padding-top: 26px; }
.lx-field { position: relative; }
.lx-field + .lx-field { margin-top: 14px; }
.lx-field input {
  width: 100%;
  height: 56px;
  padding: 20px 14px 4px 44px;
  border: 1.5px solid #d6dde8;
  border-radius: 14px;
  background: #f7f9fc;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.lx-field input::placeholder { color: transparent; }
.lx-field input:hover { border-color: #b7c3d6; }
.lx-field input:focus { border-color: var(--lx-navy-2); background: #fff; box-shadow: 0 0 0 4px rgba(18, 63, 115, 0.12), 0 8px 20px rgba(7, 27, 54, 0.08); }
.lx-field input:-webkit-autofill { -webkit-box-shadow: 0 0 0 60px #f7f9fc inset; -webkit-text-fill-color: var(--ink); }
.lx-field label {
  position: absolute;
  left: 45px;
  top: 17px;
  color: var(--muted);
  font-size: 16px;
  line-height: 22px;
  pointer-events: none;
  transition: top 0.18s, font-size 0.18s, color 0.18s;
}
.lx-field input:not(:placeholder-shown) + label,
.lx-field input:focus + label { top: 7px; font-size: 12px; line-height: 16px; }
.lx-field input:focus + label { color: var(--lx-navy-2); font-weight: 600; }
.lx-field-icon { position: absolute; left: 16px; top: 20px; color: #8a97ab; pointer-events: none; transition: color 0.2s; }
.lx-field:focus-within .lx-field-icon { color: var(--lx-navy-2); }
.lx-field-password input { padding-right: 50px; }

.lx-submit {
  position: relative;
  overflow: hidden;
  height: 54px;
  margin-top: 22px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--lx-navy-2), var(--lx-navy));
  font-size: 16.5px;
  box-shadow: 0 12px 26px rgba(7, 27, 54, 0.28);
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}
.lx-submit:hover { background: linear-gradient(135deg, #1a5394, #0b2850); box-shadow: 0 16px 32px rgba(7, 27, 54, 0.34); transform: translateY(-1px); }
.lx-submit:active { transform: translateY(1px); }
.lx-submit:focus-visible { box-shadow: 0 0 0 4px rgba(213, 167, 46, 0.5); }
.lx-submit .btn-label { display: inline-flex; align-items: center; gap: 8px; }
.lx-submit .btn-label .icon { transition: transform 0.2s; }
.lx-submit:hover .btn-label .icon { transform: translateX(4px); }
.lx-submit::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 231, 160, 0.4), transparent);
  transform: skewX(-20deg);
  animation: lx-sheen 5s ease-in-out infinite 1.2s;
}
@keyframes lx-sheen { 0%, 70% { left: -60%; } 100% { left: 130%; } }

.lx-note { display: flex; align-items: center; gap: 7px; margin-top: 18px; color: var(--muted); font-size: 13px; }
.lx-note .icon { color: var(--success); }

.lx-foot { width: 100%; max-width: 380px; margin: 40px auto 0; padding-top: 18px; border-top: 1px solid #e7ecf3; }
.lx-credit { color: var(--ink-2); font-size: 13.5px; }
.lx-credit strong {
  background: linear-gradient(90deg, var(--lx-navy-2), var(--lx-gold), var(--lx-navy-2));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 800;
  animation: lx-credit 5s linear infinite;
}
@keyframes lx-credit { to { background-position: -200% 0; } }
.lx-copy { margin-top: 4px; color: var(--muted); font-size: 12px; }

/* Tablets: a narrower photo. */
@media (max-width: 1100px) {
  .lx { grid-template-columns: minmax(0, 1fr) minmax(380px, 1fr); }
  .lx-hero-text { left: 36px; right: 36px; bottom: 40px; }
  .lx-panel { padding: 40px 36px 24px; }
}
/* Phones and portrait tablets: the photo becomes a band above the form. */
@media (max-width: 820px) {
  .lx { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .lx-hero { min-height: 280px; }
  .lx-photo { background-position: 47% 60%; }
  .lx-logo { top: 18px; left: 20px; width: 86px; }
  .lx-hero-text { left: 22px; right: 22px; bottom: 22px; }
  .lx-title { font-size: 30px; }
  .lx-title br { display: none; }
  .lx-rule { margin: 14px 0 12px; }
  .lx-chips { gap: 6px; }
  .lx-chips li { height: 30px; padding: 0 11px; font-size: 12.5px; }
  .lx-panel {
    margin-top: -22px;
    padding: 30px 22px 22px;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -10px 30px rgba(7, 27, 54, 0.12);
  }
  .lx-seal { display: none; }
  .lx-heading { font-size: 26px; }
  .lx-foot { margin-top: 28px; }
}
@media (max-width: 380px) {
  .lx-hero { min-height: 240px; }
  .lx-chips li:nth-child(n + 5) { display: none; }
}
/* Short laptop screens: a little tighter so the form fits without scrolling. */
@media (max-height: 720px) and (min-width: 821px) {
  .lx-panel { padding-top: 28px; padding-bottom: 18px; }
  .lx-seal { width: 52px; height: 52px; margin-bottom: 14px; }
  .lx-heading { font-size: 28px; }
  .lx-form { padding-top: 18px; }
  .lx-field input { height: 52px; }
  .lx-field label { top: 15px; }
  .lx-field-icon { top: 18px; }
  .lx-foot { margin-top: 24px; }
}

/* NUST colours: the seal's blue (#1D5AA3), the logo's deep blue (#0A3D6B) and NUST gold. */
.lx {
  --lx-navy: #0a3d6b;
  --lx-navy-2: #1d5aa3;
  --lx-gold: #c9a227;
  --lx-gold-2: #e8c766;
}
.lx-hero { background: var(--lx-navy); }
.lx-hero::after {
  background:
    linear-gradient(180deg, rgba(10, 61, 107, 0.55) 0%, rgba(10, 61, 107, 0) 24%),
    linear-gradient(0deg, rgba(6, 36, 66, 0.94) 0%, rgba(10, 61, 107, 0.6) 34%, rgba(29, 90, 163, 0) 62%);
}
.lx-panel {
  background:
    radial-gradient(520px 320px at 100% 0%, rgba(201, 162, 39, 0.12), transparent 70%),
    radial-gradient(520px 360px at 0% 100%, rgba(29, 90, 163, 0.09), transparent 70%),
    #fff;
}
.lx-field input:focus { box-shadow: 0 0 0 4px rgba(29, 90, 163, 0.14), 0 8px 20px rgba(10, 61, 107, 0.08); }
.lx-submit { background: linear-gradient(135deg, var(--lx-navy-2), var(--lx-navy)); box-shadow: 0 12px 26px rgba(10, 61, 107, 0.3); }
.lx-submit:hover { background: linear-gradient(135deg, #2668b8, #0c477c); box-shadow: 0 16px 32px rgba(10, 61, 107, 0.36); }
.lx-submit:focus-visible { box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.55); }
.lx-submit::after { background: linear-gradient(100deg, transparent, rgba(232, 199, 102, 0.45), transparent); }
.lx-heading { color: var(--lx-navy); }
.lx-seal { filter: drop-shadow(0 6px 14px rgba(29, 90, 163, 0.28)); }
/* A thin gold line where the photo meets the form. */
.lx-hero { border-right: 3px solid var(--lx-gold); }
@media (max-width: 820px) {
  .lx-hero { border-right: 0; border-bottom: 0; }
  .lx-panel { border-top: 3px solid var(--lx-gold); }
}
.lx-photo { background-position: 43% 58%; }
/* Phones and portrait tablets: the text sits below the logo in the band, and the form starts right under it. */
@media (max-width: 820px) {
  .lx-hero { min-height: 0; padding: 92px 22px 44px; }
  .lx-hero-text { position: static; }
  .lx-kicker { font-size: 11px; letter-spacing: 0.16em; }
  .lx-form-wrap { margin: 0 auto; }
  .lx-foot { margin: 28px auto 0; }
  .lx-panel { justify-content: flex-start; }
}
@media (min-width: 560px) and (max-width: 820px) {
  .lx-hero { padding: 100px 40px 52px; }
  .lx-panel { padding: 40px 40px 28px; }
  .lx-seal { display: block; }
}
@media (max-width: 820px) {
  .lx-logo { width: 72px; }
  .lx-hero { padding-top: 110px; }
}
@media (min-width: 560px) and (max-width: 820px) {
  .lx-logo { width: 90px; top: 22px; left: 40px; }
  .lx-hero { padding-top: 130px; }
}

/* ---------- Two-step verification in the split screen ---------- */
.lx-form-wide { max-width: 460px; }
.lx-steps { display: flex; align-items: center; gap: 10px; margin: 0 0 26px; padding: 0; list-style: none; font-size: 13.5px; font-weight: 600; }
.lx-steps li { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.lx-steps li > span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 12.5px;
  font-weight: 700;
}
.lx-steps .is-done { color: var(--success); }
.lx-steps .is-done > span { background: var(--success); color: #fff; }
.lx-steps .is-active { color: var(--lx-navy); }
.lx-steps .is-active > span { background: var(--lx-navy-2); color: #fff; box-shadow: 0 0 0 4px rgba(29, 90, 163, 0.16); }
.lx-steps-line { flex: 0 0 44px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--success), var(--lx-navy-2)); }
.lx-badge {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(29, 90, 163, 0.12), rgba(201, 162, 39, 0.16));
  color: var(--lx-navy-2);
}
.lx-badge .icon { width: 28px; height: 28px; }
.lx-verify .lx-sub { line-height: 1.55; }
.lx-verify .lx-sub strong { color: var(--lx-navy); }
.lx-otp-label { display: block; margin-bottom: 8px; color: var(--ink-2); font-size: 14px; font-weight: 600; }
.lx-otp {
  width: 100%;
  height: 64px;
  border: 1.5px solid #d6dde8;
  border-radius: 14px;
  background: #f7f9fc;
  color: var(--lx-navy);
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.5em;
  text-align: center;
  text-indent: 0.5em;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.lx-otp::placeholder { color: #c3ccd9; }
.lx-otp:focus { border-color: var(--lx-navy-2); background: #fff; box-shadow: 0 0 0 4px rgba(29, 90, 163, 0.14), 0 8px 20px rgba(10, 61, 107, 0.08); }
.lx-check { margin-top: 16px; border-radius: 14px; }
.lx-check input:checked + .check-box { border-color: var(--lx-navy-2); background: var(--lx-navy-2); }
.lx-switch { margin-top: 16px; text-align: center; }
.lx-switch .link-button { color: var(--lx-navy-2); font-weight: 600; }
.lx-setup { margin-top: 20px; }
.lx-verify .qr-block { margin-bottom: 14px; }
@media (max-width: 820px) {
  .lx-steps { margin-bottom: 20px; }
  .lx-otp { height: 58px; font-size: 26px; }
}
/* When the form side is taller than the window (first-time 2FA set-up), only it scrolls: the photo stays put. */
@media (min-width: 821px) {
  .lx-hero { position: sticky; top: 0; align-self: start; height: 100vh; height: 100dvh; }
}
.lx-verify .lx-form { padding-top: 14px; }
.lx-verify .setup-final { margin-bottom: 0; }
.lx-verify .lx-form-wide .lx-heading { font-size: 28px; }

/* ---------- Sign-in page: dark glass box with a neon sign-in button ---------- */

/*
 * After the "login box with floating placeholder and neon button" pattern, in NUST colours: deep NUST blue
 * (#0A3D6B / #1D5AA3) behind a dark glass box, NUST gold as the neon. Labels float up when a field is used;
 * gold light runs round the sign-in button's edges and the button lights up on hover.
 */
.nx {
  --nx-blue: #1d5aa3;
  --nx-navy: #0a3d6b;
  --nx-deep: #041a33;
  --nx-gold: #e8c766;
  --nx-gold-2: #c9a227;
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 104px 16px 64px;
  overflow: hidden;
  color: #fff;
  background: var(--nx-deep);
}
/* The campus with the two flags, deep under NUST blue, slowly drifting. */
.nx-bg {
  position: absolute;
  inset: -4%;
  z-index: -1;
  background:
    radial-gradient(60% 50% at 50% 45%, rgba(29, 90, 163, 0.35), transparent 70%),
    linear-gradient(160deg, rgba(4, 26, 51, 0.92), rgba(10, 61, 107, 0.86) 55%, rgba(4, 26, 51, 0.95)),
    url("campus.webp") 46% 60% / cover no-repeat;
  animation: nx-drift 26s ease-in-out infinite alternate;
}
@keyframes nx-drift { to { transform: scale(1.06) translate(-1%, -1%); } }
.nx-logo {
  position: absolute;
  top: 24px;
  left: 30px;
  width: 112px;
  height: auto;
  filter: brightness(0) invert(1) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

.nx-box {
  width: min(400px, 100%);
  padding: 40px 40px 30px;
  border: 1px solid rgba(232, 199, 102, 0.18);
  border-radius: 16px;
  background: rgba(0, 10, 25, 0.55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  text-align: center;
  animation: nx-in 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
/* Movement only, never opacity: the box is complete even if animations do not run. */
@keyframes nx-in { from { transform: translateY(20px) scale(0.98); } }
.nx-seal { display: block; width: 76px; height: 76px; margin: 0 auto 14px; filter: drop-shadow(0 0 14px rgba(232, 199, 102, 0.35)); }
.nx-kicker { color: var(--nx-gold); font-size: 12px; font-weight: 700; letter-spacing: 0.24em; }
.nx-title { margin: 8px 0 0; font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; font-size: 23px; font-weight: 700; line-height: 1.2; }

.nx-alert {
  display: flex;
  gap: 9px;
  margin: 18px 0 0;
  padding: 10px 12px;
  border: 1px solid;
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.45;
  text-align: left;
}
.nx-alert .icon { flex: none; margin-top: 1px; }
.nx-alert small { display: block; margin-top: 3px; font-weight: 600; }
.nx-alert-error { border-color: rgba(255, 120, 110, 0.45); background: rgba(180, 35, 24, 0.22); color: #ffd3cf; }
.nx-alert-success { border-color: rgba(110, 231, 160, 0.4); background: rgba(6, 118, 71, 0.22); color: #c9f7dc; }
.nx-alert-info { border-color: rgba(159, 208, 255, 0.4); background: rgba(23, 92, 211, 0.22); color: #d6e9ff; }

.nx-form { padding-top: 30px; text-align: left; }
.nx-field { position: relative; margin-bottom: 30px; }
.nx-field input {
  width: 100%;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 0;
  background: transparent;
  color: #fff;
  caret-color: var(--nx-gold);
  font: inherit;
  font-size: 16px;
  outline: none;
  transition: border-color 0.3s;
}
.nx-field input::placeholder { color: transparent; }
.nx-field input:focus { border-bottom-color: var(--nx-gold); }
.nx-field input:-webkit-autofill {
  -webkit-text-fill-color: #fff;
  caret-color: #fff;
  transition: background-color 600000s 0s;
}
.nx-field label {
  position: absolute;
  top: 0;
  left: 0;
  padding: 10px 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 16px;
  pointer-events: none;
  transition: 0.4s;
}
/* The floating label: up and gold once the field is used. */
.nx-field input:focus + label,
.nx-field input:not(:placeholder-shown) + label { top: -22px; color: var(--nx-gold); font-size: 12px; letter-spacing: 0.04em; }
.nx-field-password input { padding-right: 40px; }
.nx-field .input-action { top: 50%; right: 0; color: rgba(255, 255, 255, 0.75); }
.nx-field .input-action:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

/* The neon button: four lines of gold light chase each other round the edges. */
.nx-submit {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 50px;
  margin-top: 6px;
  overflow: hidden;
  border: 0;
  border-radius: 6px;
  background: rgba(232, 199, 102, 0.06);
  color: var(--nx-gold);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.5s, color 0.5s, box-shadow 0.5s, border-radius 0.5s;
}
.nx-submit:hover, .nx-submit:focus-visible {
  outline: none;
  background: var(--nx-gold);
  color: var(--nx-deep);
  box-shadow: 0 0 5px var(--nx-gold), 0 0 25px var(--nx-gold), 0 0 50px var(--nx-gold-2), 0 0 100px var(--nx-gold-2);
}
.nx-line { position: absolute; display: block; }
.nx-line-top { top: 0; left: -100%; width: 100%; height: 2px; background: linear-gradient(90deg, transparent, var(--nx-gold)); animation: nx-run-top 1.6s linear infinite; }
.nx-line-right { top: -100%; right: 0; width: 2px; height: 100%; background: linear-gradient(180deg, transparent, var(--nx-gold)); animation: nx-run-right 1.6s linear infinite 0.4s; }
.nx-line-bottom { right: -100%; bottom: 0; width: 100%; height: 2px; background: linear-gradient(270deg, transparent, var(--nx-gold)); animation: nx-run-bottom 1.6s linear infinite 0.8s; }
.nx-line-left { bottom: -100%; left: 0; width: 2px; height: 100%; background: linear-gradient(360deg, transparent, var(--nx-gold)); animation: nx-run-left 1.6s linear infinite 1.2s; }
@keyframes nx-run-top { 0% { left: -100%; } 50%, 100% { left: 100%; } }
@keyframes nx-run-right { 0% { top: -100%; } 50%, 100% { top: 100%; } }
@keyframes nx-run-bottom { 0% { right: -100%; } 50%, 100% { right: 100%; } }
@keyframes nx-run-left { 0% { bottom: -100%; } 50%, 100% { bottom: 100%; } }
.nx-submit .btn-label { position: relative; text-indent: 0.28em; }
.nx-submit .btn-busy { display: none; align-items: center; gap: 10px; letter-spacing: 0.06em; text-transform: none; }
.nx-submit.is-loading .btn-label { display: none; }
.nx-submit.is-loading .btn-busy { display: inline-flex; }
.nx-submit:disabled { cursor: progress; }

/* Login page: the one-line hint in the box, and the "Single Sign-in" panel with the user guide. */
.nx-hint { margin: 12px 0 0; color: rgba(255, 255, 255, 0.8); font-size: 13.5px; line-height: 1.45; }
.nx-hint strong { color: var(--nx-gold); font-weight: 700; }
.nx-hero { width: min(380px, 100%); text-align: center; }
.nx-hero-title {
  margin: 0; font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 32px; font-weight: 700; line-height: 1.1; color: #fff; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
}
.nx-hero-title span {
  display: block; margin-top: 2px; font-size: 0.6em;
  background: linear-gradient(90deg, var(--nx-gold-2), #fff3c8, var(--nx-gold));
  -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none;
}
/* Three per row: LMS, TMS, FYP; then SSP, Internship Portal. */
.nx-hero-list { display: grid; grid-template-columns: repeat(3, max-content); justify-content: center; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.nx-hero-list li {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px;
  border: 1px solid rgba(232, 199, 102, 0.45); border-radius: 999px; background: rgba(4, 26, 51, 0.6);
  color: #fff; font-size: 13.5px; font-weight: 700; white-space: nowrap;
}
.nx-hero-list li:nth-child(5) { grid-column: span 2; justify-self: start; }
.nx-hero-list .icon { color: var(--nx-gold); }
.nx-guide {
  display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 12px 16px;
  border: 1px solid var(--nx-gold); border-radius: 12px;
  background: linear-gradient(135deg, rgba(232, 199, 102, 0.24), rgba(201, 162, 39, 0.1));
  color: #fff; text-align: left; text-decoration: none;
  animation: nx-guide-blink 1.8s ease-in-out infinite;
}
.nx-guide:hover, .nx-guide:focus-visible { background: rgba(232, 199, 102, 0.32); animation-play-state: paused; }
.nx-guide:focus-visible { outline: 2px solid var(--nx-gold); outline-offset: 3px; }
.nx-guide > .icon:first-child { flex: none; color: var(--nx-gold); }
.nx-guide span { display: flex; flex: 1; flex-direction: column; gap: 1px; }
.nx-guide strong { color: var(--nx-gold); font-size: 15px; letter-spacing: 0.02em; }
.nx-guide small { color: rgba(255, 255, 255, 0.78); font-size: 12px; }
.nx-guide > .icon:last-child { flex: none; color: var(--nx-gold); }
/* The guide button glows on and off, so new users notice it. */
@keyframes nx-guide-blink {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 199, 102, 0); border-color: rgba(232, 199, 102, 0.55); }
  50% { box-shadow: 0 0 18px 3px rgba(232, 199, 102, 0.55); border-color: #fff3c8; }
}
@media (prefers-reduced-motion: reduce) { .nx-guide { animation: none; } }
/* Phones, tablets and small laptops (below 1500px): the panel sits under the sign-in box, the same width. */
.nx-hero { order: 2; margin: 18px 0 0; }
.nx-box { order: 1; }
@media (max-width: 1499px) {
  .nx-hero {
    padding: 22px 22px 20px;
    border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 16px;
    background: rgba(8, 36, 72, 0.32);
    -webkit-backdrop-filter: blur(6px) saturate(1.2); backdrop-filter: blur(6px) saturate(1.2);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }
}
/* 1500px and wider (a 1920 screen at 100%, 110% or 125% Windows scaling included): the panel stands at the right,
   in the strip beyond the Pakistan flag of the campus picture. .nx-bg lays the picture out from --nx-w; the flag's
   right edge is at 50vw + 240px + 0.192 * --nx-w, so the panel starts just after it and never covers a flag. It sits
   a little below the middle of the screen. */
@media (min-width: 1500px) {
  .nx-hero {
    --w: max(calc((50vw - 240px) / 0.392), min(calc((100vw - 480px) / 0.884), calc(100vh * 1.95)));
    position: absolute; top: 58%; left: calc(50vw + 250px + 0.192 * var(--w)); right: 12px; width: auto; max-width: 400px;
    margin: 0; padding: 16px 14px; transform: translateY(-50%);
    /* The same glass as the sign-in box (.nx-box). */
    border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 16px;
    background: rgba(8, 36, 72, 0.32);
    -webkit-backdrop-filter: blur(6px) saturate(1.2); backdrop-filter: blur(6px) saturate(1.2);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06); text-align: left;
    animation: nx-hero-in 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
  .nx-hero-title { font-size: 26px; white-space: nowrap; }
  .nx-hero-list { justify-content: start; gap: 5px; margin-top: 12px; }
  .nx-hero-list li { gap: 4px; padding: 5px 8px; font-size: 12px; }
  .nx-hero-list .icon { width: 14px; height: 14px; }
  .nx-guide { gap: 8px; margin-top: 14px; padding: 9px 10px; }
  .nx-guide strong { font-size: 14px; }
  .nx-guide small { font-size: 11px; }
}
@media (min-width: 1700px) {
  .nx-hero { right: 14px; padding: 20px 16px 18px; }
  .nx-hero-title { font-size: 30px; }
  .nx-hero-list { gap: 6px; margin-top: 14px; }
  .nx-hero-list li { gap: 5px; padding: 6px 9px; font-size: 13px; }
  .nx-hero-list .icon { width: 16px; height: 16px; }
  .nx-guide { gap: 10px; margin-top: 16px; padding: 10px 12px; }
  .nx-guide strong { font-size: 15px; }
  .nx-guide small { font-size: 12px; }
}
@media (min-width: 1850px) {
  .nx-hero { right: 20px; padding: 24px 20px 22px; }
  .nx-hero-title { font-size: 36px; }
  .nx-hero-list { gap: 8px; margin-top: 16px; }
  .nx-hero-list li { padding: 7px 11px; font-size: 14px; }
  .nx-guide { margin-top: 18px; padding: 11px 13px; }
}
@keyframes nx-hero-in { from { transform: translate(-16px, -50%); } }
.nx-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 18px; color: rgba(255, 255, 255, 0.7); font-size: 12.5px; }
.nx-note .icon { color: #6ee7a8; }
.nx-credit { margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.75); font-size: 13px; }
.nx-credit strong {
  background: linear-gradient(90deg, var(--nx-gold-2), #fff3c8, var(--nx-gold-2));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 800;
  animation: nx-shine 4s linear infinite;
}
@keyframes nx-shine { to { background-position: -200% 0; } }
.nx-copy { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 16px 18px; color: rgba(255, 255, 255, 0.55); font-size: 12px; text-align: center; }

@media (max-width: 600px) {
  .nx { padding: 92px 14px 56px; }
  .nx-logo { top: 16px; left: 18px; width: 84px; }
  .nx-box { padding: 32px 22px 24px; }
  .nx-title { font-size: 21px; }
}
@media (max-height: 760px) and (min-width: 601px) {
  .nx { padding-top: 40px; padding-bottom: 48px; }
  .nx-seal { width: 60px; height: 60px; margin-bottom: 10px; }
  .nx-box { padding-top: 30px; }
  .nx-form { padding-top: 24px; }
  .nx-field { margin-bottom: 26px; }
}

/* Changes asked for: a white header with the seal, the two flags at the box's sides, a lighter glass box. */
.nx-box {
  overflow: hidden;
  padding-top: 0;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(8, 36, 72, 0.32);
  -webkit-backdrop-filter: blur(6px) saturate(1.2);
  backdrop-filter: blur(6px) saturate(1.2);
}
.nx-head {
  margin: 0 -40px 18px;
  padding: 18px 0 16px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}
.nx-head .nx-seal { margin: 0 auto; filter: none; }
/* The photo is drawn 180% of the window height and placed so the gap between the NUST flag (ends at 39%
   of the photo's width) and the Pakistan flag (starts at 51%) is centred on the window, behind the box. */
.nx-bg {
  inset: 0;
  background:
    radial-gradient(50% 45% at 50% 50%, rgba(4, 26, 51, 0.35), transparent 75%),
    linear-gradient(160deg, rgba(4, 26, 51, 0.55), rgba(10, 61, 107, 0.4) 55%, rgba(4, 26, 51, 0.6)),
    url("campus.webp") calc(50vw - 176vh) calc(50vh - 102.6vh) / auto 180vh no-repeat,
    #0a3d6b;
  animation: none;
}
.nx-box { width: min(380px, 100%); }
@media (max-width: 600px) {
  .nx-head { margin: 0 -22px 16px; }
  .nx-bg {
    background:
      linear-gradient(160deg, rgba(4, 26, 51, 0.55), rgba(10, 61, 107, 0.4) 55%, rgba(4, 26, 51, 0.6)),
      url("campus.webp") calc(50vw - 97.8vh) 0 / auto 100vh no-repeat,
      #0a3d6b;
  }
}
@media (max-height: 760px) and (min-width: 601px) {
  .nx-box { padding-top: 0; }
  .nx-head { padding: 12px 0 10px; }
}

/* Background back to the deep NUST blue of the first version, with the flags further out: the photo at 220%
   of the window height leaves about 60px between each flag and the box, with both emblems in view. */
.nx-bg {
  inset: 0;
  background:
    radial-gradient(60% 50% at 50% 45%, rgba(29, 90, 163, 0.35), transparent 70%),
    linear-gradient(160deg, rgba(4, 26, 51, 0.92), rgba(10, 61, 107, 0.86) 55%, rgba(4, 26, 51, 0.95)),
    url("campus.webp") calc(50vw - 200.4vh) calc(52vh - 114.8vh) / auto 205vh no-repeat,
    #041a33;
  animation: nx-drift 26s ease-in-out infinite alternate;
}
@media (max-width: 600px) {
  .nx-bg {
    background:
      radial-gradient(60% 50% at 50% 45%, rgba(29, 90, 163, 0.35), transparent 70%),
      linear-gradient(160deg, rgba(4, 26, 51, 0.92), rgba(10, 61, 107, 0.86) 55%, rgba(4, 26, 51, 0.95)),
      url("campus.webp") calc(50vw - 97.8vh) 0 / auto 100vh no-repeat,
      #041a33;
  }
}
/* SEECS building in view: the photo moved down so the building (at 26% of the photo's height) sits near the
   top of the window, above the box; the top of the shade a little lighter so the building reads. */
.nx-bg {
  background:
    radial-gradient(60% 50% at 50% 45%, rgba(29, 90, 163, 0.3), transparent 70%),
    linear-gradient(180deg, rgba(4, 26, 51, 0.55) 0%, rgba(10, 61, 107, 0.82) 30%, rgba(4, 26, 51, 0.93) 100%),
    url("campus.webp") calc(50vw - 200.4vh) calc(12vh - 53.3vh) / auto 205vh no-repeat,
    #041a33;
}
/* A wide, far-away view of the campus: the photo at its own size (cover), so the SEECS building, both flags
   and the lawn show together and sharp, under a light NUST-blue shade. */
.nx-bg {
  inset: 0;
  background:
    radial-gradient(42% 55% at 50% 50%, rgba(4, 26, 51, 0.38), transparent 72%),
    linear-gradient(180deg, rgba(4, 26, 51, 0.32) 0%, rgba(10, 61, 107, 0.28) 45%, rgba(4, 26, 51, 0.62) 100%),
    url("campus.webp") 50% 40% / cover no-repeat,
    #041a33;
  animation: nx-drift-far 30s ease-in-out infinite alternate;
}
@keyframes nx-drift-far { from { transform: scale(1); } to { transform: scale(1.04); } }
@media (max-width: 600px) {
  .nx-bg {
    background:
      linear-gradient(180deg, rgba(4, 26, 51, 0.35), rgba(4, 26, 51, 0.6)),
      url("campus.webp") 46% 50% / cover no-repeat,
      #041a33;
  }
}
/* The whole photo, nothing cropped: it is drawn complete (contain) over a blurred, darker copy of itself that
   fills the rest of the window. */
.nx-bg {
  inset: 0;
  isolation: isolate;
  background: #041a33;
  animation: none;
}
.nx-bg::before,
.nx-bg::after {
  content: "";
  position: absolute;
  inset: 0;
}
.nx-bg::before {
  inset: -40px;
  background: url("campus.webp") 50% 50% / cover no-repeat;
  filter: blur(28px) brightness(0.55) saturate(1.1);
}
.nx-bg::after {
  background:
    radial-gradient(40% 55% at 50% 50%, rgba(4, 26, 51, 0.3), transparent 72%),
    linear-gradient(180deg, rgba(4, 26, 51, 0.12), rgba(4, 26, 51, 0.32)),
    url("campus.webp") 50% 50% / contain no-repeat;
}
/* Phones: a whole wide photo would be a thin strip, so the photo fills the screen there. */
@media (max-width: 600px) {
  .nx-bg::after {
    background:
      linear-gradient(180deg, rgba(4, 26, 51, 0.35), rgba(4, 26, 51, 0.6)),
      url("campus.webp") 46% 50% / cover no-repeat;
  }
}
/* Soft edges where the whole photo (a band 46vw tall, centred) meets its blurred copy. */
@media (min-width: 601px) {
  .nx-bg::after {
    -webkit-mask-image: linear-gradient(180deg, transparent calc(50% - 23vw), #000 calc(50% - 23vw + 70px), #000 calc(50% + 23vw - 70px), transparent calc(50% + 23vw));
    mask-image: linear-gradient(180deg, transparent calc(50% - 23vw), #000 calc(50% - 23vw + 70px), #000 calc(50% + 23vw - 70px), transparent calc(50% + 23vw));
  }
}

/* The flags apart, beside the box: the photo is cut where the box stands (between the flags, at 45% of its
   width) and the two halves moved outwards, so each flag stays 50px clear of the box and both keep the same
   size. The cut is hidden behind the box. W = photo width on screen, H = its height (photo is 1849 x 851). */
.nx-bg { --nx-gap: 480px; --nx-w: min(calc((100vw - 480px) / 0.884), calc(100vh * 1.95)); --nx-h: calc(var(--nx-w) / 2.1727); }
.nx-half {
  position: absolute;
  z-index: 1;
  top: calc(50% - var(--nx-h) / 2);
  height: var(--nx-h);
  background-image:
    linear-gradient(180deg, rgba(4, 26, 51, 0.1), rgba(4, 26, 51, 0.3)),
    url("campus.webp");
  background-size: var(--nx-w) var(--nx-h), var(--nx-w) var(--nx-h);
  background-repeat: no-repeat;
}
.nx-half-l {
  left: calc(50vw - var(--nx-gap) / 2 - 0.392 * var(--nx-w));
  width: calc(0.45 * var(--nx-w));
  background-position: 0 0, 0 0;
  -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent), linear-gradient(180deg, transparent, #000 50px, #000 calc(100% - 50px), transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, #000 85%, transparent), linear-gradient(180deg, transparent, #000 50px, #000 calc(100% - 50px), transparent);
  mask-composite: intersect;
}
.nx-half-r {
  left: calc(50vw + var(--nx-gap) / 2 - 0.058 * var(--nx-w));
  width: calc(0.55 * var(--nx-w));
  background-position: calc(-0.45 * var(--nx-w)) 0, calc(-0.45 * var(--nx-w)) 0;
  -webkit-mask-image: linear-gradient(270deg, #000 88%, transparent), linear-gradient(180deg, transparent, #000 50px, #000 calc(100% - 50px), transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(270deg, #000 88%, transparent), linear-gradient(180deg, transparent, #000 50px, #000 calc(100% - 50px), transparent);
  mask-composite: intersect;
}
@media (min-width: 601px) {
  .nx-bg::after { content: none; }
}
@media (max-width: 600px) {
  .nx-half { display: none; }
}
/* A light blur on the background photo. */
.nx-half, .nx-bg::after { filter: blur(1.2px); }

/* ---------- Two-step verification in the neon look ---------- */
.nx-verify { align-items: start; padding-top: 96px; }
.nx-box-wide { width: min(480px, 100%); }
.nx-steps { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 16px 0 6px; padding: 0; list-style: none; font-size: 13px; font-weight: 600; }
.nx-steps li { display: flex; align-items: center; gap: 7px; color: rgba(255, 255, 255, 0.75); }
.nx-steps li > span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 12px; font-weight: 700; }
.nx-steps .is-done { color: #86efac; }
.nx-steps .is-done > span { background: #22c55e; color: #fff; }
.nx-steps .is-active { color: var(--nx-gold); }
.nx-steps .is-active > span { background: var(--nx-gold); color: var(--nx-deep); box-shadow: 0 0 0 4px rgba(232, 199, 102, 0.2); }
.nx-steps-line { flex: 0 0 40px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, #22c55e, var(--nx-gold)); }
.nx-verify .nx-title { margin-top: 10px; }
.nx-lead { margin-top: 8px; color: rgba(255, 255, 255, 0.82); font-size: 14px; line-height: 1.55; }
.nx-lead strong { color: #fff; }
.nx-setup { display: grid; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; text-align: left; }
.nx-setup li { display: flex; gap: 12px; color: rgba(255, 255, 255, 0.78); font-size: 13px; line-height: 1.45; }
.nx-setup li > span {
  display: grid;
  flex: none;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--nx-gold);
  border-radius: 50%;
  color: var(--nx-gold);
  font-size: 12px;
  font-weight: 700;
}
.nx-setup strong { display: block; color: #fff; font-size: 13.5px; }
/* The QR code on a white card, so phones can scan it. */
.nx-qr { margin: 14px 0 0; padding: 14px; border-radius: 12px; background: #fff; color: var(--ink); text-align: left; }
.nx-form-otp { padding-top: 20px; }
.nx-otp-label { display: block; margin-bottom: 8px; color: var(--nx-gold); font-size: 12.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.nx-otp {
  width: 100%;
  height: 60px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  caret-color: var(--nx-gold);
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.5em;
  text-align: center;
  text-indent: 0.5em;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.nx-otp::placeholder { color: rgba(255, 255, 255, 0.3); }
.nx-otp:focus { border-color: var(--nx-gold); box-shadow: 0 0 0 3px rgba(232, 199, 102, 0.18), 0 0 18px rgba(232, 199, 102, 0.2); }
.nx-check { margin: 14px 0 18px; border-color: rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.05); color: #fff; text-align: left; }
.nx-check .check-text strong { color: #fff; }
.nx-check .check-text small { color: rgba(255, 255, 255, 0.72); }
.nx-check .check-box { border-color: rgba(255, 255, 255, 0.5); background: transparent; }
.nx-check input:checked + .check-box { border-color: var(--nx-gold); background: var(--nx-gold); color: var(--nx-deep); }
.nx-switch { margin-top: 14px; }
.nx-switch .link-button { color: var(--nx-gold); font-weight: 600; }
@media (max-width: 600px) {
  .nx-verify { padding-top: 88px; }
}
/* 2FA page fits the window: a tighter box and less space above it. */
.nx-verify { align-items: center; padding-top: 72px; padding-bottom: 44px; }
.nx-verify .nx-head { padding: 12px 0 10px; margin-bottom: 14px; }
.nx-verify .nx-head .nx-seal { width: 62px; height: 62px; }
.nx-verify .nx-steps { margin: 12px 0 4px; }
.nx-verify .nx-form-otp { padding-top: 16px; }
.nx-verify .nx-otp { height: 54px; }
.nx-verify .nx-check { margin: 12px 0 14px; padding: 12px 14px; }
.nx-verify .nx-switch { margin-top: 10px; }
.nx-verify .nx-credit { margin-top: 14px; padding-top: 12px; }
@media (max-height: 800px) and (min-width: 601px) {
  .nx-verify { padding-top: 24px; padding-bottom: 36px; }
  .nx-verify .nx-head .nx-seal { width: 50px; height: 50px; }
  .nx-verify .nx-head { padding: 8px 0 6px; margin-bottom: 10px; }
  .nx-verify .nx-lead { font-size: 13px; }
  .nx-verify .nx-check small { font-size: 11.5px; line-height: 1.4; }
  .nx-verify .nx-box { padding-bottom: 20px; }
}
/* A field the browser filled in itself (saved password) counts as used: its label floats up too.
   Kept as its own rule, because a browser that does not know :autofill would drop a whole shared rule. */
.nx-field input:-webkit-autofill + label { top: -22px; color: var(--nx-gold); font-size: 12px; letter-spacing: 0.04em; }
.nx-field input:autofill + label { top: -22px; color: var(--nx-gold); font-size: 12px; letter-spacing: 0.04em; }
.lx-field input:-webkit-autofill + label { top: 7px; font-size: 12px; line-height: 16px; }
.gate-field input:-webkit-autofill + label { top: 6px; font-size: 12px; line-height: 16px; }
.q-field input:-webkit-autofill + label { top: -20px; font-size: 14px; }

/* ---------- Dashboard: app launcher in NUST blue and gold ---------- */
.page-portal { background: #f3f6fb; }
.ax {
  --ax-navy: #0a3d6b;
  --ax-blue: #1d5aa3;
  --ax-deep: #041a33;
  --ax-gold: #e8c766;
  --ax-gold-2: #c9a227;
  --ax-line: #e6ebf2;
  --ax-muted: #64718a;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
}
.ax-head {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 40px;
  background: var(--ax-navy);
  border-bottom: 3px solid var(--ax-gold);
  color: #fff;
}
.ax-brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font: 700 22px "Iowan Old Style", "Palatino Linotype", Georgia, serif; }
.ax-brand img { width: 40px; height: 40px; padding: 2px; border-radius: 50%; background: #fff; }
.ax-search {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 1 420px;
  margin-left: 28px;
  padding: 0 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.75);
}
.ax-search input { width: 100%; height: 40px; border: 0; background: transparent; color: #fff; font: inherit; font-size: 14px; outline: none; }
.ax-search input::placeholder { color: rgba(255, 255, 255, 0.65); }
.ax-search:focus-within { background: rgba(255, 255, 255, 0.16); box-shadow: 0 0 0 2px rgba(232, 199, 102, 0.5); }
.ax-account { position: relative; margin-left: auto; }
.ax-account summary { display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; font-weight: 600; }
.ax-account summary::-webkit-details-marker { display: none; }
.ax-avatar { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--ax-blue), var(--ax-navy)); color: #fff; font-weight: 700; }
.ax-avatar-sm { width: 38px; height: 38px; background: var(--ax-gold); color: var(--ax-deep); font-size: 14px; }
.ax-avatar-lg { width: 68px; height: 68px; font-size: 24px; box-shadow: 0 0 0 4px #fff, 0 0 0 6px var(--ax-gold); }
.ax-account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  min-width: 240px;
  padding: 8px;
  border: 1px solid var(--ax-line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 16px 36px rgba(14, 27, 46, 0.18);
}
.ax-account-head { display: grid; padding: 10px 12px 12px; border-bottom: 1px solid var(--ax-line); margin-bottom: 6px; }
.ax-account-head span { color: var(--ax-muted); font-size: 13px; }
.ax-account-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 8px; background: transparent; color: #b42318; font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
.ax-account-menu button:hover { background: #fef3f2; }

.ax-band {
  padding: 36px 40px 76px;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(4, 26, 51, 0.9), rgba(10, 61, 107, 0.5)),
    url("campus.webp") center 45% / cover no-repeat;
}
.ax-date { color: var(--ax-gold); font-size: 12px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; }
.ax-band h1 { margin: 8px 0 4px; font: 700 34px "Iowan Old Style", "Palatino Linotype", Georgia, serif; }
.ax-band-sub { opacity: 0.85; }

.ax-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; margin-top: -48px; padding: 0 40px 24px; }
.ax-main { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.ax-empty { padding: 16px 18px; border: 1px solid var(--ax-line); border-radius: 14px; background: #fff; color: var(--ax-muted); }
.ax-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; }
.ax-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 26px 16px 20px;
  border-top: 3px solid transparent;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(14, 27, 46, 0.08);
  color: inherit;
  text-align: center;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.ax-app:hover, .ax-app:focus-visible {
  outline: none;
  border-top-color: var(--ax-gold);
  transform: translateY(-4px);
  box-shadow: 0 18px 36px rgba(14, 27, 46, 0.15);
}
.ax-app-icon {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin-bottom: 8px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--ax-blue), var(--ax-navy));
  color: #fff;
  box-shadow: 0 10px 20px rgba(29, 90, 163, 0.3);
  transition: background 0.2s, color 0.2s;
}
.ax-app-icon .icon { width: 32px; height: 32px; }
.ax-app:hover .ax-app-icon { background: linear-gradient(135deg, var(--ax-gold), var(--ax-gold-2)); color: var(--ax-deep); }
.ax-app-name { color: var(--ax-navy); font-size: 17px; font-weight: 700; }
.ax-app-desc { color: var(--ax-muted); font-size: 13px; line-height: 1.4; }
.ax-app-host { color: var(--ax-blue); font-size: 12px; }
.ax-app-open { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--ax-gold-2); font-size: 13px; font-weight: 700; }
.ax-app:hover .ax-app-open .icon { transform: translateX(3px); }
.ax-app-open .icon { transition: transform 0.2s; }

.ax-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.ax-panel { padding: 20px 22px; border-radius: 16px; background: #fff; box-shadow: 0 1px 3px rgba(14, 27, 46, 0.06); }
.ax-panel h2 { margin: 0 0 14px; color: var(--ax-navy); font-size: 16.5px; }
.ax-row { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.ax-row p { display: grid; gap: 2px; color: var(--ax-muted); font-size: 13.5px; }
.ax-row strong { color: var(--ink); }
.ax-row-icon { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 10px; background: #eef3fb; color: var(--ax-blue); }
.ax-link { padding: 0; border: 0; background: none; color: var(--ax-blue); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.ax-link:hover { text-decoration: underline; }

.ax-rail { display: flex; flex-direction: column; gap: 18px; }
.ax-profile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 24px 20px; border-radius: 18px; background: #fff; box-shadow: 0 10px 28px rgba(14, 27, 46, 0.08); text-align: center; }
.ax-profile .ax-avatar-lg { margin-bottom: 10px; }
.ax-profile strong { color: var(--ax-navy); }
.ax-profile > span { color: var(--ax-muted); font-size: 13px; }
.ax-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.ax-chips span { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; background: #eef3fb; color: var(--ax-blue); font-size: 12px; font-weight: 600; }
.ax-timeline { position: relative; margin: 0; padding: 0 0 0 20px; list-style: none; }
.ax-timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--ax-line); }
.ax-timeline li { position: relative; display: grid; margin-bottom: 14px; font-size: 13px; color: var(--ax-muted); }
.ax-timeline li:last-child { margin-bottom: 0; }
.ax-timeline li::before { content: ""; position: absolute; left: -19px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--ax-gold); box-shadow: 0 0 0 3px #fff; }
.ax-timeline strong { color: var(--ink); font-size: 13.5px; }
.ax-timeline small { color: #9aa5b8; font-size: 11.5px; }
.ax-none { color: var(--ax-muted); font-size: 13.5px; }
.ax-foot { margin-top: auto; padding: 14px 40px 20px; color: var(--ax-muted); font-size: 12.5px; text-align: center; }
.ax-foot strong { color: var(--ax-gold-2); }

@media (max-width: 1100px) {
  .ax-body { grid-template-columns: minmax(0, 1fr); }
  .ax-rail { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .ax-head { gap: 10px; padding: 10px 14px; }
  .ax-brand span { display: none; }
  .ax-search { margin-left: 0; flex: 1 1 auto; }
  .ax-account-name { display: none; }
  .ax-band { padding: 24px 16px 66px; }
  .ax-band h1 { font-size: 26px; }
  .ax-body { padding: 0 14px 18px; gap: 16px; }
  .ax-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .ax-app { padding: 18px 10px 14px; border-radius: 16px; }
  .ax-app-icon { width: 54px; height: 54px; border-radius: 16px; }
  .ax-app-icon .icon { width: 26px; height: 26px; }
  .ax-app-desc, .ax-app-host { display: none; }
  .ax-panels, .ax-rail { grid-template-columns: minmax(0, 1fr); }
  .ax-foot { padding: 12px 14px 18px; }
}
/* Recent sign-ins: three show, the rest scroll inside the panel. The line is drawn per item so it scrolls too. */
.ax-timeline { max-height: 262px; overflow-y: auto; padding-right: 6px; scrollbar-width: thin; scrollbar-color: #c9d3e1 transparent; }
.ax-timeline::before { content: none; }
.ax-timeline li { padding-bottom: 14px; margin-bottom: 0; }
.ax-timeline li::after { content: ""; position: absolute; left: -15px; top: 14px; bottom: -4px; width: 2px; background: var(--ax-line); }
.ax-timeline li:last-child::after { content: none; }
.ax-timeline::-webkit-scrollbar { width: 6px; }
.ax-timeline::-webkit-scrollbar-thumb { border-radius: 6px; background: #c9d3e1; }

/* ---------- Dashboard: name + username in the header, one colour per system ---------- */
.ax-account-name { display: grid; text-align: right; line-height: 1.2; }
.ax-account-name strong { font-weight: 600; }
.ax-account-name small { color: rgba(255, 255, 255, 0.7); font-size: 12.5px; font-weight: 500; }

.ax-app { --tone: #1d5aa3; --tone-2: #0a3d6b; --tone-soft: #eaf1fb; position: relative; border-top: 5px solid var(--tone); padding-top: 26px; }
.ax-tone-blue   { --tone: #1d5aa3; --tone-2: #0a3d6b; --tone-soft: #eaf1fb; }
.ax-tone-green  { --tone: #0f8a63; --tone-2: #075c42; --tone-soft: #e5f5ef; }
.ax-tone-maroon { --tone: #b3263e; --tone-2: #7d1528; --tone-soft: #fbeaed; }
.ax-tone-orange { --tone: #d9731a; --tone-2: #a3520c; --tone-soft: #fcf0e4; }
.ax-tone-purple { --tone: #6c45b0; --tone-2: #4a2c80; --tone-soft: #f1ecfa; }
.ax-tone-teal   { --tone: #0f8a9a; --tone-2: #08606b; --tone-soft: #e4f4f6; }
.ax-tone-gold   { --tone: #b8901c; --tone-2: #8a6a0e; --tone-soft: #faf3df; }
.ax-app:hover, .ax-app:focus-visible { border-top-color: var(--tone); box-shadow: 0 18px 36px rgba(14, 27, 46, 0.15), 0 0 0 2px var(--tone); }
.ax-app-icon, .ax-app:hover .ax-app-icon { background: linear-gradient(135deg, var(--tone), var(--tone-2)); color: #fff; box-shadow: 0 10px 20px color-mix(in srgb, var(--tone) 35%, transparent); }
.ax-app-name { color: var(--tone-2); }
.ax-app-host { color: var(--tone); }
.ax-app-badge { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; background: var(--tone-soft); color: var(--tone-2); font-size: 11px; font-weight: 700; white-space: nowrap; }
.ax-app-open { align-self: stretch; justify-content: center; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--tone); color: #fff; font-size: 13.5px; transition: background 0.2s; }
.ax-app:hover .ax-app-open { background: var(--tone-2); }
@media (max-width: 700px) {
  .ax-account-name { display: none; }
  .ax-app { padding-top: 34px; }
  .ax-app-badge { font-size: 10px; padding: 2px 7px; }
  .ax-app-open { padding: 8px 6px; font-size: 12.5px; }
}

/* ---------- Dashboard: intro above the tiles, lower layout, rail as tall as the main column ---------- */
.ax-band { padding-bottom: 40px; }
.ax-body { margin-top: 0; padding-top: 30px; }
.ax-main { gap: 30px; }
.ax-intro h2 { margin: 0 0 4px; color: var(--ax-navy); font: 700 24px "Iowan Old Style", "Palatino Linotype", Georgia, serif; }
.ax-intro p { margin: 0; color: var(--ax-muted); font-size: 14.5px; }
.ax-intro + .ax-grid { margin-top: -12px; }
.ax-panels { margin-top: 10px; }
@media (min-width: 1101px) {
  .ax-rail { position: relative; }
  .ax-rail > .ax-panel { position: absolute; inset: 0; display: flex; flex-direction: column; }
  .ax-rail .ax-timeline { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; }
}
@media (max-width: 700px) {
  .ax-band { padding-bottom: 28px; }
  .ax-body { padding-top: 22px; }
  .ax-intro h2 { font-size: 20px; }
}

/* ---------- Dashboard banner: same light shade on the whole photo (no dark left side) ---------- */
.ax-band {
  background:
    linear-gradient(rgba(4, 26, 51, 0.45), rgba(4, 26, 51, 0.45)),
    url("campus.webp") center 45% / cover no-repeat;
}
.ax-band h1, .ax-band-sub, .ax-date { text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55); }

/* Login: the left half of the photo always reaches the left edge of the screen (like the right half),
   so no blurred strip shows on the left. Both halves keep the same scale, so the flags stay the same size. */
.nx-bg { --nx-w: max(calc((50vw - var(--nx-gap) / 2) / 0.392), min(calc((100vw - 480px) / 0.884), calc(100vh * 1.95))); }

/* Seal header removed (19 Nov 2026): no white band, the box starts with "AMS · NUST" on the same glass. */
.nx-box { padding-top: 34px; }
@media (max-width: 600px) { .nx-box { padding-top: 28px; } }
@media (max-height: 760px) and (min-width: 601px) { .nx-box { padding-top: 26px; } }
@media (max-height: 800px) and (min-width: 601px) { .nx-verify .nx-box { padding-top: 22px; } }

/* Admin: the "Admin: reset 2FA" entry in the account menu, and the admin page (public/admin.php). */
.ax-account-menu .ax-menu-link { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 8px; color: var(--ax-navy, #0a3d6b); font-weight: 600; text-decoration: none; }
.ax-account-menu .ax-menu-link:hover, .ax-account-menu .ax-menu-link:focus-visible { background: #eef4fb; }
.adm-back { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; padding: 8px 14px; border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 999px; color: #fff; font-weight: 600; text-decoration: none; }
.adm-back:hover, .adm-back:focus-visible { background: rgba(255, 255, 255, 0.12); }
.adm-back-icon { transform: rotate(180deg); }
.adm-main { width: min(760px, 100%); margin: 0 auto; padding: 32px 16px 24px; }
.adm-main h1 { margin: 0; color: var(--ax-navy, #0a3d6b); font: 700 28px "Iowan Old Style", "Palatino Linotype", Georgia, serif; }
.adm-lead { margin: 8px 0 22px; color: var(--ax-muted, #5b6676); line-height: 1.5; }
.adm-alert { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 18px; padding: 12px 14px; border-radius: 10px; line-height: 1.45; }
.adm-alert .icon { flex: none; margin-top: 2px; }
.adm-alert-success { border: 1px solid #a6e3b8; background: #ecfbf0; color: #146c2e; }
.adm-alert-info { border: 1px solid #b8d4f5; background: #eef5fd; color: #154a85; }
.adm-alert-error { border: 1px solid #f5b5ae; background: #fef3f2; color: #a02518; }
.adm-search label, .adm-reset label { display: block; margin: 0 0 6px; color: #1d2939; font-weight: 700; }
.adm-search label small, .adm-reset label small { color: var(--ax-muted, #5b6676); font-weight: 400; }
.adm-search-row { display: flex; gap: 10px; }
.adm-search input, .adm-reset input {
  width: 100%; min-width: 0; padding: 11px 13px; border: 1px solid #c7d0dc; border-radius: 10px; background: #fff;
  color: #101828; font: inherit; font-size: 15px;
}
.adm-search input:focus, .adm-reset input:focus { border-color: #1d5aa3; outline: 3px solid rgba(29, 90, 163, 0.18); }
.adm-btn {
  display: inline-flex; flex: none; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px;
  border: 0; border-radius: 10px; background: #0a3d6b; color: #fff; font: inherit; font-weight: 700; cursor: pointer;
}
.adm-btn:hover, .adm-btn:focus-visible { background: #1d5aa3; }
.adm-btn-danger { width: 100%; margin-top: 6px; background: #b42318; }
.adm-btn-danger:hover, .adm-btn-danger:focus-visible { background: #912018; }
.adm-btn .btn-busy { display: none; align-items: center; gap: 8px; }
.adm-btn.is-loading .btn-label { display: none; }
.adm-btn.is-loading .btn-busy { display: inline-flex; }
.adm-card { margin-top: 22px; padding: 22px; border: 1px solid #e3e8ef; border-radius: 14px; background: #fff; box-shadow: 0 8px 24px rgba(16, 24, 40, 0.06); }
.adm-card h2 { margin: 0 0 14px; color: #101828; font-size: 20px; word-break: break-all; }
.adm-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 20px; }
.adm-facts div { padding: 12px 14px; border-radius: 10px; background: #f5f7fa; }
.adm-facts dt { color: var(--ax-muted, #5b6676); font-size: 12.5px; }
.adm-facts dd { margin: 4px 0 0; color: #101828; font-weight: 700; }
.adm-reset input { margin-bottom: 14px; }
.adm-code { max-width: 200px; font-family: ui-monospace, Consolas, monospace; font-size: 20px !important; letter-spacing: 0.3em; }
.adm-warn { display: flex; gap: 8px; margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: #fff7e6; color: #8a4b00; font-size: 13.5px; line-height: 1.45; }
.adm-warn .icon { flex: none; margin-top: 2px; }
.adm-note { margin: 0; padding: 12px 14px; border-radius: 10px; background: #eef5fd; color: #154a85; line-height: 1.5; }
.adm-note a { color: #0a3d6b; font-weight: 700; }
@media (max-width: 600px) {
  .adm-search-row { flex-direction: column; }
  .adm-facts { grid-template-columns: 1fr; }
  .adm-back { padding: 7px 10px; font-size: 13px; }
}

/* Dashboard: "You don't have <service> account" (a service was opened that has no account for this user). */
.ax-notice { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 22px; padding: 14px 16px; border: 1px solid #f4cf8a; border-radius: 12px; background: #fff8e8; color: #7a4a00; line-height: 1.5; }
.ax-notice .icon { flex: none; margin-top: 3px; color: #b26b00; }
.ax-notice p { margin: 0; }
.ax-notice strong { color: #5c3700; }
