:root {
  --navy-950: #07111d;
  --navy-900: #0b1726;
  --navy-800: #12243a;
  --blue-500: #2f7de1;
  --blue-600: #246bc1;
  --blue-100: #e7f0fb;
  --paper: #f4f2ed;
  --white: #fff;
  --ink: #111c29;
  --muted: #667281;
  --line: #d9dee4;
  --danger: #a63838;
  --danger-bg: #fbecec;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Aptos", "Segoe UI Variable", "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
}
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 20;
  padding: .75rem 1rem;
  color: var(--navy-950);
  background: var(--white);
  transform: translateY(-160%);
  transition: transform 150ms var(--ease-out);
}
.skip-link:focus { transform: translateY(0); }

.login-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(28rem, 1.08fr) minmax(30rem, .92fr);
  background: var(--paper);
}

.visual-panel {
  position: relative;
  min-height: 100dvh;
  padding: clamp(2rem, 4vw, 4rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  isolation: isolate;
  overflow: hidden;
  color: var(--white);
  background: var(--navy-900);
}
.carousel-slides,
.visual-shade,
.carousel-slide { position: absolute; inset: 0; }
.carousel-slides { z-index: -3; background: var(--navy-900); }
.carousel-slide {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 58% center;
  opacity: 0;
  transform: scale(1.015);
  transition: opacity 1100ms var(--ease-out);
}
.carousel-slide.is-active { opacity: 1; }
.visual-shade {
  z-index: -2;
  background:
    radial-gradient(circle at 75% 30%, rgba(52, 112, 177, .14), transparent 38%),
    linear-gradient(180deg, rgba(5, 14, 25, .5), rgba(5, 14, 25, .34) 35%, rgba(5, 14, 25, .96));
}
.back-link {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  color: rgba(255, 255, 255, .75);
  font-size: .82rem;
  font-weight: 650;
  transition: color 150ms ease, transform 150ms var(--ease-out);
}
.back-link:hover { color: var(--white); }
.back-link:active { transform: scale(.97); }
.back-link:focus-visible,
.auth-brand:focus-visible,
.help-copy a:focus-visible,
.portal-switcher a:focus-visible,
.login-button:focus-visible,
.password-toggle:focus-visible { outline: 3px solid #6da8ec; outline-offset: 4px; }

.visual-copy { max-width: 39rem; }
.eyebrow {
  margin: 0;
  color: #9bc2ee;
  font-size: .7rem;
  font-weight: 750;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.visual-copy h2 {
  max-width: 11ch;
  margin: 1.2rem 0 0;
  font-size: clamp(3rem, 5.6vw, 5.8rem);
  line-height: .97;
  font-weight: 620;
  letter-spacing: -.055em;
  text-wrap: balance;
}
.visual-copy > p:not(.eyebrow) {
  max-width: 36rem;
  margin: 1.5rem 0 0;
  color: rgba(255, 255, 255, .68);
  font-size: 1rem;
  line-height: 1.65;
}
.visual-copy ul {
  margin: clamp(2.5rem, 7vh, 5rem) 0 0;
  padding: 1.25rem 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  list-style: none;
  border-top: 1px solid rgba(255, 255, 255, .2);
}
.visual-copy li { display: flex; flex-direction: column; gap: .45rem; color: rgba(255, 255, 255, .8); font-size: .78rem; line-height: 1.4; }
.visual-copy li span { color: rgba(255, 255, 255, .42); font: 600 .66rem/1 "SFMono-Regular", Consolas, monospace; }

.auth-panel {
  min-height: 100dvh;
  padding: clamp(2rem, 6vh, 4rem) clamp(2rem, 7vw, 6.5rem) 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(circle at 100% 0, rgba(47, 125, 225, .08), transparent 28rem),
    var(--paper);
}
.auth-wrap { width: min(100%, 29rem); margin: auto; }
.auth-brand { display: inline-flex; width: 10.5rem; }
.auth-brand img { display: block; width: 100%; height: auto; }
.auth-heading { margin-top: clamp(2rem, 5vh, 3.5rem); }
.auth-heading .eyebrow { color: #527398; }
.auth-heading h1 {
  margin: .85rem 0 0;
  font-size: clamp(2.5rem, 4vw, 3.6rem);
  line-height: 1;
  font-weight: 630;
  letter-spacing: -.045em;
}
.auth-heading > p:last-child {
  max-width: 27rem;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.6;
}

.destination-picker { margin-top: 1.5rem; }
.destination-label {
  margin: 0 0 .55rem;
  color: #273544;
  font-size: .76rem;
  font-weight: 700;
}
.portal-switcher {
  padding: .25rem;
  display: grid;
  /* Sizes itself to however many destinations exist — was a hardcoded
     repeat(3, 1fr), which pushed the 4th (SMS) onto its own row. */
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: .2rem;
  background: #e7e5df;
  border-radius: .45rem;
}
.portal-switcher a {
  min-height: 2.55rem;
  padding: 0 .3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #697482;
  border-radius: .3rem;
  font-size: .7rem;
  font-weight: 750;
  transition: color 150ms ease, background-color 150ms ease, box-shadow 150ms ease, transform 150ms var(--ease-out);
}
.portal-switcher a[aria-current="page"] {
  color: var(--ink);
  background: var(--white);
  box-shadow: 0 .2rem .7rem rgba(25, 39, 54, .1);
}
.portal-switcher a:active { transform: scale(.97); }
.destination-description {
  margin: .65rem 0 0;
  color: #74808c;
  font-size: .72rem;
  line-height: 1.45;
}

#loginForm { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 1.15rem; }
.form-field { display: flex; flex-direction: column; gap: .5rem; }
.form-field label { color: #273544; font-size: .82rem; font-weight: 700; }
.field-label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.field-label-row span { color: #87919c; font-size: .7rem; }
.form-field input {
  width: 100%;
  height: 3.25rem;
  padding: 0 .95rem;
  color: var(--ink);
  background: rgba(255, 255, 255, .72);
  border: 1px solid var(--line);
  border-radius: .4rem;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}
.form-field input::placeholder { color: #929ba5; }
.form-field input:hover { border-color: #bac3cc; }
.form-field input:focus { background: var(--white); border-color: var(--blue-500); box-shadow: 0 0 0 4px rgba(47, 125, 225, .12); }
.password-field { position: relative; }
.password-field input { padding-right: 4rem; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: .55rem;
  min-width: 3rem;
  min-height: 2rem;
  padding: 0 .4rem;
  color: #53667a;
  background: transparent;
  border: 0;
  border-radius: .25rem;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: .72rem;
  font-weight: 700;
}
.password-toggle:hover { color: var(--blue-600); background: var(--blue-100); }
.login-button {
  width: 100%;
  min-height: 3.35rem;
  margin-top: .35rem;
  padding: 0 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--white);
  background: var(--blue-500);
  border: 0;
  border-radius: .4rem;
  cursor: pointer;
  box-shadow: 0 .8rem 2rem rgba(30, 88, 157, .18);
  font-size: .9rem;
  font-weight: 750;
  transition: transform 150ms var(--ease-out), background-color 150ms ease, box-shadow 150ms ease;
}
.login-button:hover { background: var(--blue-600); box-shadow: 0 1rem 2.4rem rgba(30, 88, 157, .24); transform: translateY(-1px); }
.login-button:active { transform: scale(.98); }
.login-button:disabled { cursor: wait; opacity: .7; transform: none; }

.message:empty { display: none; }
.message { margin-top: .9rem; }
.login-alert { padding: .8rem .9rem; color: var(--danger); background: var(--danger-bg); border-left: 3px solid #c65353; font-size: .8rem; line-height: 1.5; }

.help-copy { margin: 1.35rem 0 0; color: #78838e; font-size: .72rem; line-height: 1.5; }
.help-copy a { color: #426993; font-weight: 700; border-bottom: 1px solid #aabed3; }

.auth-footer { width: min(100%, 29rem); margin: 2.5rem auto 0; padding-top: 1rem; display: flex; justify-content: space-between; gap: 1rem; color: #8b949e; border-top: 1px solid rgba(17, 28, 41, .1); font-size: .65rem; }

#cumulativeOverlay[hidden] { display: none; }
#cumulativeOverlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(7, 17, 29, .72);
  backdrop-filter: blur(8px);
}
.progress-card { width: min(100%, 26rem); padding: 1.4rem; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 1rem; color: var(--ink); background: var(--white); border-radius: .55rem; box-shadow: 0 2rem 5rem rgba(0, 0, 0, .3); }
.progress-mark { width: 2.4rem; height: 2.4rem; border: 3px solid #dce7f4; border-top-color: var(--blue-500); border-radius: 50%; animation: spin .7s linear infinite; }
.progress-card strong { font-size: .9rem; }
.progress-card p { margin: .3rem 0 0; color: var(--muted); font-size: .75rem; line-height: 1.5; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .visual-panel { min-height: 27rem; padding: 2rem; }
  .visual-copy h2 { font-size: clamp(3rem, 10vw, 5rem); }
  .auth-panel { min-height: auto; padding: 4rem 1.5rem 1.5rem; }
  .auth-wrap { margin: 0 auto; }
}

@media (max-width: 560px) {
  .visual-panel { display: none; }
  .auth-panel { min-height: 100dvh; padding: 1.5rem 1rem 1.25rem; }
  .auth-brand { width: 8.5rem; }
  .auth-heading { margin-top: 1.75rem; }
  /* Four destinations in one row get too tight on a phone — wrap to a grid. */
  .portal-switcher {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (hover: none), (pointer: coarse) {
  .login-button:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .carousel-slide { transform: none; }
}
