/* ──────────────────────────────────────────────
   CDPL — Government Officer Login
   Design tokens + base styles
   ────────────────────────────────────────────── */

:root {
  /* Navy spine */
  --navy-950: #061434;
  --navy-900: #0a1f44;
  --navy-800: #112a5c;
  --navy-700: #173675;
  --navy-600: #1f4690;
  --navy-500: #2a5cb8;
  --navy-100: #e6ecf7;

  /* Civic accent — warm gold */
  --gold-600: #b07a2a;
  --gold-500: #d29a3e;
  --gold-400: #e0b160;
  --gold-100: #f5e6c4;

  /* Tricolor cues (used as 2px strip only) */
  --saffron: #ff9933;
  --indigreen: #138808;
  --chakra: #000080;

  /* Neutrals */
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #fafbfd;
  --ink: #0b1b3d;
  --ink-2: #2a3556;
  --muted: #5d6885;
  --muted-2: #8a93ad;
  --border: #e3e7ef;
  --border-strong: #c8cfdd;

  /* Status */
  --success: #0f766e;
  --danger: #b42318;
  --danger-bg: #fef3f2;

  /* Type */
  --font-ui: "Manrope", ui-sans-serif, system-ui, sans-serif;
  --font-display: "Newsreader", "Source Serif 4", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* Shape */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(11, 27, 61, 0.06);
  --shadow: 0 8px 24px -8px rgba(11, 27, 61, 0.12), 0 2px 6px rgba(11, 27, 61, 0.04);
  --shadow-lg: 0 24px 60px -20px rgba(11, 27, 61, 0.28);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

#root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input,
button {
  font-family: inherit;
}

a {
  color: var(--navy-700);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ───── Top government bar ───── */
.gov-bar {
  background: var(--navy-950);
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  letter-spacing: 0.02em;
}
.gov-bar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 8px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.gov-bar a {
  color: inherit;
  opacity: 0.78;
}
.gov-bar a:hover {
  opacity: 1;
  text-decoration: none;
}
.gov-bar .dot {
  opacity: 0.4;
  margin: 0 10px;
}
.gov-bar .lang-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

/* Tricolor 2px strip */
.tricolor {
  height: 2px;
  background: linear-gradient(
    to right,
    var(--saffron) 0 33.33%,
    #ffffff 33.33% 66.66%,
    var(--indigreen) 66.66% 100%
  );
}

/* ───── Site header ───── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.site-header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.emblem {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
}
.brand-text .agency {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.brand-text .portal {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.1;
  margin-top: 2px;
}
.brand-text .portal em {
  font-style: italic;
  color: var(--navy-700);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14px;
  color: var(--ink-2);
}
.header-nav a {
  color: inherit;
}
.header-nav .help-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
}
.header-nav .help-pill:hover {
  border-color: var(--navy-700);
  color: var(--navy-700);
  text-decoration: none;
}

/* ───── Main shell (variants set on .app-shell) ───── */
.app-shell {
  flex: 1;
  display: flex;
  position: relative;
}

/* SPLIT (default) */
.app-shell.layout-split {
  flex-direction: row;
}
.app-shell.layout-split .panel-form {
  flex: 1 1 50%;
  padding: 72px 8vw 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--surface);
}
.app-shell.layout-split .panel-brand {
  flex: 1 1 50%;
  position: relative;
  background: var(--navy-900);
  color: #fff;
  padding: 72px 6vw 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

/* CENTERED */
.app-shell.layout-centered {
  background: var(--navy-900);
  color: #fff;
  align-items: center;
  justify-content: center;
  padding: 56px 24px;
  position: relative;
  overflow: hidden;
}
.app-shell.layout-centered .center-card {
  position: relative;
  z-index: 2;
  width: min(100%, 1080px);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  overflow: hidden;
}
.app-shell.layout-centered .panel-form {
  padding: 56px 56px 48px;
}
.app-shell.layout-centered .panel-brand {
  position: relative;
  background: var(--navy-900);
  color: #fff;
  padding: 56px 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

/* BANNER (navy top, form below on a card) */
.app-shell.layout-banner {
  flex-direction: column;
  background: var(--bg);
}
.app-shell.layout-banner .panel-brand {
  position: relative;
  background: var(--navy-900);
  color: #fff;
  padding: 56px 32px 96px;
  overflow: hidden;
  text-align: center;
}
.app-shell.layout-banner .panel-brand .brand-inner {
  max-width: 720px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}
.app-shell.layout-banner .panel-form {
  margin: -64px auto 56px;
  width: min(100%, 560px);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 44px 44px 36px;
  position: relative;
  z-index: 3;
}
.app-shell.layout-banner .ticker-wrap {
  max-width: 1100px;
  margin: 0 auto 40px;
  padding: 0 24px;
}

/* ───── Pattern background ───── */
.pattern-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.14;
}
.pattern-bg.dim {
  opacity: 0.08;
}

/* Navy panel content */
.brand-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--gold-400);
  position: relative;
  z-index: 2;
}
.brand-eyebrow .pip {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-400);
  box-shadow: 0 0 0 4px rgba(224, 177, 96, 0.18);
}

.brand-headline {
  font-family: var(--font-display);
  font-size: clamp(34px, 3.6vw, 56px);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 22px 0 18px;
  max-width: 16ch;
  position: relative;
  z-index: 2;
}
.brand-headline em {
  font-style: italic;
  color: var(--gold-400);
}
.brand-sub {
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.74);
  max-width: 46ch;
  position: relative;
  z-index: 2;
}

.brand-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 36px;
  max-width: 460px;
  position: relative;
  z-index: 2;
}
.brand-stats .stat-num {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  color: #fff;
  letter-spacing: -0.01em;
}
.brand-stats .stat-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 4px;
}

/* ───── Form panel ───── */
.form-wrap {
  width: 100%;
  max-width: 440px;
}
.form-eyebrow {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--navy-700);
}
.form-title {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin: 12px 0 8px;
  color: var(--ink);
}
.form-title em {
  font-style: italic;
  color: var(--navy-700);
}
.form-desc {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 28px;
  max-width: 38ch;
}

.field {
  display: block;
  margin-bottom: 18px;
}
.field-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 7px;
}
.field-label .hint {
  font-weight: 500;
  color: var(--muted-2);
  font-size: 12px;
}
.field-control {
  position: relative;
}
.field-input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 15px;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.field-input::placeholder {
  color: var(--muted-2);
}
.field-input:hover {
  border-color: var(--navy-500);
}
.field-input:focus {
  border-color: var(--navy-700);
  box-shadow: 0 0 0 4px rgba(23, 54, 117, 0.12);
}
.field.error .field-input {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.08);
}
.field-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: var(--muted);
  border-radius: 6px;
  background: none;
  border: 0;
  padding: 0;
}
.field-icon:hover {
  color: var(--navy-700);
  background: var(--navy-100);
}
.field-error {
  color: var(--danger);
  font-size: 12.5px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Captcha row */
.captcha-row {
  display: grid;
  grid-template-columns: 1fr 152px 44px;
  gap: 10px;
  align-items: stretch;
}
.captcha-img {
  background: linear-gradient(135deg, #f0e9d6 0%, #e7dfc7 100%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  overflow: hidden;
}
.captcha-img canvas {
  display: block;
}
.captcha-refresh {
  width: 44px;
  height: 48px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--navy-700);
  padding: 0;
  transition: all 0.15s;
}
.captcha-refresh:hover {
  border-color: var(--navy-700);
  background: var(--navy-100);
}
.captcha-refresh:active svg {
  transform: rotate(-90deg);
}
.captcha-refresh svg { transition: transform 0.25s; }

/* Row: remember + forgot */
.form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 4px 0 22px;
  font-size: 13.5px;
}
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}
.checkbox input {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  background: #fff;
  transition: all 0.15s;
}
.checkbox input:checked {
  background: var(--navy-700);
  border-color: var(--navy-700);
}
.checkbox input:checked::after {
  content: "";
  width: 10px;
  height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}
.forgot {
  font-weight: 600;
  color: var(--navy-700);
}

/* Form-level alert */
.form-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--danger-bg);
  border: 1px solid #fecdca;
  border-left: 3px solid var(--danger);
  border-radius: var(--radius);
  color: #7a271a;
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 14px;
}
.form-alert svg { color: var(--danger); flex-shrink: 0; margin-top: 2px; }
.form-alert strong { color: var(--danger); }

/* Submit button */
.btn-primary {
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: var(--radius);
  background: var(--navy-900);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.15s, transform 0.05s;
  position: relative;
  overflow: hidden;
}
.btn-primary:hover {
  background: var(--navy-700);
}
.btn-primary:active {
  transform: translateY(1px);
}
.btn-primary[disabled] {
  background: var(--muted-2);
  cursor: not-allowed;
}
.btn-primary.shake { animation: shake 0.45s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}
.btn-primary .arrow {
  transition: transform 0.2s;
}
.btn-primary:hover .arrow {
  transform: translateX(3px);
}

/* Spinner */
.spin {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Divider + alternate */
.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 24px 0 18px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.alt-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.alt-btn {
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  transition: all 0.15s;
}
.alt-btn:hover {
  border-color: var(--navy-700);
  color: var(--navy-700);
  background: var(--surface-2);
}
.alt-btn .badge {
  font-size: 10px;
  padding: 2px 6px;
  background: var(--gold-100);
  color: var(--gold-600);
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* Form footer note */
.form-foot {
  margin-top: 28px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
}
.form-foot .lock {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--success);
}

/* ───── Ticker ───── */
.ticker {
  position: relative;
  z-index: 2;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  height: 52px;
  overflow: hidden;
  backdrop-filter: blur(8px);
}
.ticker .ticker-label {
  flex-shrink: 0;
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  background: var(--gold-500);
  color: var(--navy-950);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  position: relative;
  z-index: 2;
}
.ticker .ticker-label .live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--navy-950);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.ticker .ticker-track-clip {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  align-self: stretch;
}
.ticker .ticker-track {
  display: flex;
  gap: 56px;
  white-space: nowrap;
  animation: marquee 48s linear infinite;
  padding-left: 24px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.88);
}
.ticker:hover .ticker-track {
  animation-play-state: paused;
}
.ticker .ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.ticker .ticker-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gold-400);
  letter-spacing: 0.04em;
}
.ticker .ticker-sep {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
}
@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* Banner-layout dark ticker variant on light bg */
.app-shell.layout-banner .ticker {
  background: var(--navy-900);
  border-color: var(--navy-800);
}

/* ───── Success state ───── */
.success-card {
  text-align: center;
  padding: 8px 0;
}
.success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #ecfdf5;
  color: var(--success);
  display: inline-grid;
  place-items: center;
  margin-bottom: 18px;
}
.success-card h3 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}
.success-card p {
  color: var(--muted);
  margin: 0 0 22px;
}
.redirect-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--navy-100);
  overflow: hidden;
}
.redirect-bar > span {
  display: block;
  height: 100%;
  background: var(--navy-700);
  width: 0;
  animation: fill 2.4s linear forwards;
}
@keyframes fill {
  to { width: 100%; }
}

/* ───── Footer ───── */
.site-foot {
  background: var(--navy-950);
  color: rgba(255, 255, 255, 0.66);
  font-size: 12.5px;
}
.site-foot-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.site-foot a {
  color: inherit;
  opacity: 0.78;
}
.site-foot a:hover {
  opacity: 1;
  text-decoration: none;
}
.site-foot .sep {
  opacity: 0.4;
  margin: 0 10px;
}

/* ───── Modules modal ───── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 20, 52, 0.58);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  z-index: 100;
  animation: fade-in 0.18s ease-out;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  width: min(100%, 760px);
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 32px 32px 24px;
  animation: pop-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
}
@keyframes pop-in {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 22px;
}
.modal-eyebrow {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  color: var(--ink);
}
.modal-title em { font-style: italic; color: var(--navy-700); }
.modal-sub {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  max-width: 50ch;
}
.modal-close {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
  flex-shrink: 0;
}
.modal-close:hover {
  color: var(--navy-700);
  border-color: var(--navy-700);
}

.modal-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  height: 44px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 18px;
  color: var(--muted);
}
.modal-search:focus-within {
  border-color: var(--navy-700);
  box-shadow: 0 0 0 4px rgba(23, 54, 117, 0.1);
}
.modal-search input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 14px;
  color: var(--ink);
}
.modal-search input::placeholder { color: var(--muted-2); }
.modal-search .kbd {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted-2);
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.modules-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}
.module-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 14px 12px 14px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  transition: all 0.15s;
  min-width: 0;
  overflow: hidden;
}
.module-tile:hover {
  border-color: var(--navy-500);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.module-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}
.module-meta { flex: 1; min-width: 0; }
.module-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
}
.module-desc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.module-arrow {
  color: var(--muted-2);
  flex-shrink: 0;
  transition: transform 0.15s, color 0.15s;
}
.module-tile:hover .module-arrow {
  color: var(--navy-700);
  transform: translateX(2px);
}
.modules-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 32px 0;
  color: var(--muted);
  font-size: 14px;
}

.modal-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--muted);
}
.modal-foot-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.modal-signout {
  border: 0;
  background: transparent;
  color: var(--danger);
  font-weight: 600;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 6px;
}
.modal-signout:hover { background: var(--danger-bg); }

.launch-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy-900);
  color: #fff;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 110;
  animation: pop-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (max-width: 760px) {
  .modules-grid { grid-template-columns: repeat(2, 1fr); }
  .modal-card { padding: 24px 20px 18px; }
  .modal-title { font-size: 22px; }
}

/* ───── Responsive ───── */

/* Tablet and below */
@media (max-width: 960px) {
  .app-shell.layout-split { flex-direction: column; }
  .app-shell.layout-split .panel-form {
    flex: 0 0 auto;
    padding: 48px 28px;
  }
  .app-shell.layout-split .panel-brand {
    flex: 0 0 auto;
    padding: 56px 28px;
    min-height: 360px;
  }
  .app-shell.layout-centered { padding: 32px 16px; }
  .app-shell.layout-centered .center-card { grid-template-columns: 1fr; }
  .app-shell.layout-centered .panel-brand { padding: 40px 32px; }
  .app-shell.layout-centered .panel-form { padding: 40px 32px; }

  .app-shell.layout-banner .panel-form {
    margin: -48px 16px 40px;
    padding: 36px 28px 28px;
  }

  .gov-bar-inner { padding: 8px 20px; gap: 12px; flex-wrap: wrap; }
  .site-header-inner { padding: 14px 20px; gap: 16px; }
  .site-foot-inner { padding: 14px 20px; }

  .form-title { font-size: 32px; }
  .modal-title { font-size: 24px; }
  .brand-headline { font-size: clamp(28px, 5vw, 42px); }
}

/* Mobile */
@media (max-width: 640px) {
  .gov-bar { font-size: 11px; }
  .gov-bar-inner { padding: 8px 16px; }
  /* Hide secondary accessibility links on tight screens; keep language pill */
  .gov-bar a[href="#access"],
  .gov-bar a[href="#screen"] { display: none; }

  .site-header-inner { padding: 12px 16px; }
  .brand { gap: 10px; }
  .emblem { width: 38px; height: 38px; }
  .brand-text .portal { font-size: 18px; }
  .header-nav { gap: 14px; font-size: 13px; }

  .app-shell.layout-split .panel-form { padding: 36px 20px 28px; }
  .app-shell.layout-split .panel-brand { padding: 40px 20px; min-height: 320px; }
  .app-shell.layout-centered .panel-form,
  .app-shell.layout-centered .panel-brand { padding: 32px 22px; }
  .app-shell.layout-banner .panel-brand { padding: 40px 22px 80px; }
  .app-shell.layout-banner .panel-form {
    margin: -44px 14px 32px;
    padding: 28px 22px 22px;
    width: auto;
  }

  .form-title { font-size: 26px; }
  .form-desc { font-size: 13.5px; }
  .form-wrap { max-width: 100%; }

  /* Captcha row: stack input, keep image + refresh inline */
  .captcha-row { grid-template-columns: 1fr 56px; grid-template-areas: "input input" "img refresh"; gap: 10px; }
  .captcha-row > input.field-input { grid-area: input; }
  .captcha-row > .captcha-img { grid-area: img; height: 52px; width: 100%; }
  .captcha-row > .captcha-refresh { grid-area: refresh; height: 52px; width: 100%; }
  .captcha-img canvas { width: 100%; max-width: 220px; }

  .brand-headline { font-size: clamp(24px, 7vw, 34px); margin-top: 16px; }
  .brand-sub { font-size: 14px; }

  /* Ticker: smaller label, smaller text */
  .ticker { height: 46px; }
  .ticker .ticker-label { padding: 0 12px; font-size: 10px; }
  .ticker .ticker-track { font-size: 12.5px; padding-left: 18px; }

  /* Modal */
  .modal-backdrop { padding: 16px 12px; }
  .modal-card { padding: 22px 18px 16px; border-radius: 14px; }
  .modal-head { gap: 12px; margin-bottom: 16px; }
  .modal-title { font-size: 20px; }
  .modal-sub { font-size: 12.5px; }
  .modal-search { height: 42px; padding: 0 12px; }
  .modal-search .kbd { display: none; }
  .modules-grid { grid-template-columns: 1fr; gap: 8px; }
  .modal-foot { flex-wrap: wrap; }
}

/* Very small */
@media (max-width: 380px) {
  .header-nav a:not(.help-pill) { display: none; }
  .brand-text .portal { font-size: 16px; }
  .form-title { font-size: 22px; }
  .modal-foot-note { font-size: 11.5px; }
}

