:root {
  color-scheme: light;
  --portal-ink: #102338;
  --portal-muted: #5b6f84;
  --portal-line: #dbe5ee;
  --portal-brand: #087f9e;
  --portal-brand-strong: #05647e;
  --login-glass-background: rgba(255, 255, 255, 0.05);
  --login-glass-blur: 5px;
  --login-glass-saturation: 100%;
  --login-glass-border: rgba(255, 255, 255, 0.30);
  --login-control-height: 46px;
  --login-action-height: 48px;
  --login-glass-shadow:
    0 8px 32px rgba(0, 0, 0, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.50),
    inset 0 -1px 0 rgba(255, 255, 255, 0.10),
    inset 0 0 0 0 rgba(255, 255, 255, 0);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

html {
  overflow: hidden !important;
}

body {
  overflow: hidden !important;
  background: #17191d;
  color: #f7fbff;
}

button,
input,
a {
  -webkit-tap-highlight-color: transparent;
}

.login-shell {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: start center;
  overflow: hidden !important;
  padding: clamp(16px, 2.5vh, 24px) clamp(14px, 4vw, 48px);
  isolation: isolate;
  background-color: #17191d;
  background-image:
    linear-gradient(rgba(20, 22, 26, 0.78), rgba(20, 22, 26, 0.86)),
    url("../images/building-bg.jpg");
  background-blend-mode: normal, luminosity;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.login-shell::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background: rgba(0, 0, 0, 0.08);
}

.portal-return {
  position: fixed;
  top: clamp(14px, 2.5vh, 24px);
  left: clamp(14px, 2.5vw, 28px);
  z-index: 10;
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
  color: #f7fbff;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.portal-return:hover {
  border-color: rgba(255, 255, 255, 0.48);
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.login-panel {
  position: relative;
  width: min(100%, 470px);
  max-height: calc(100dvh - clamp(32px, 5vh, 48px));
  overflow: hidden;
  border: 1px solid var(--login-glass-border);
  border-radius: 20px;
  background: var(--login-glass-background);
  box-shadow: var(--login-glass-shadow);
  -webkit-backdrop-filter: blur(var(--login-glass-blur)) saturate(var(--login-glass-saturation));
  backdrop-filter: blur(var(--login-glass-blur)) saturate(var(--login-glass-saturation));
}

.login-panel::before,
.login-panel::after,
.otp-dialog::before,
.otp-dialog::after {
  position: absolute;
  z-index: 0;
  content: "";
  pointer-events: none;
}

.login-panel::before,
.otp-dialog::before {
  top: 0;
  right: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.80), transparent);
}

.login-panel::after,
.otp-dialog::after {
  top: 0;
  bottom: 0;
  left: 0;
  width: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.80), transparent, rgba(255, 255, 255, 0.30));
}

.login-panel__body {
  position: relative;
  z-index: 1;
  padding: clamp(15px, 2.2vh, 20px) clamp(22px, 4vw, 32px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-bottom: clamp(9px, 1.5vh, 13px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.20);
}

.brand-lockup img {
  width: clamp(42px, 6vh, 48px);
  height: clamp(42px, 6vh, 48px);
  flex: 0 0 auto;
  object-fit: contain;
}

.brand-lockup__name {
  margin: 0;
  color: #ffffff;
  font-size: clamp(18px, 2.7vh, 22px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-lockup__module {
  margin: 6px 0 0;
  color: #b8d8e5;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.login-heading {
  margin: clamp(10px, 1.7vh, 15px) 0;
}

.login-heading__eyebrow {
  margin: 0 0 7px;
  color: #8dd8ef;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.login-heading h1 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(25px, 3.8vh, 30px);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: 0;
}

.login-heading p {
  margin: 9px 0 0;
  color: #d0e0e8;
  font-size: 13px;
  line-height: 1.45;
}

#statusModal {
  position: static;
  margin: 0 0 16px;
  border-radius: 7px;
  box-shadow: none;
}

#loginForm {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(9px, 1.4vh, 12px);
  align-content: start;
}

#loginForm > * {
  min-width: 0;
  margin: 0 !important;
}

.login-field {
  display: grid;
  grid-template-rows: auto var(--login-control-height);
  gap: 7px;
  min-height: calc(24px + var(--login-control-height));
}

.login-field__label {
  display: block;
  margin: 0;
  color: #edf6fa;
  font-size: 12px;
  font-weight: 800;
  line-height: 17px;
}

.login-field__control {
  position: relative;
  display: flex;
  height: var(--login-control-height);
  min-height: var(--login-control-height);
  align-items: center;
}

.login-field__icon {
  position: absolute;
  left: 14px;
  z-index: 1;
  width: 18px;
  color: #7c91a5;
  text-align: center;
  pointer-events: none;
}

.login-input {
  display: block;
  min-width: 0;
  width: 100%;
  height: var(--login-control-height);
  min-height: var(--login-control-height);
  padding: 0 44px;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 7px;
  outline: none;
  background: #ffffff;
  color: var(--portal-ink);
  font-size: 14px;
  line-height: 20px;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.login-input::placeholder {
  color: #90a0b0;
}

.login-input:focus {
  border-color: #82d5ed;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(130, 213, 237, 0.22);
}

.password-toggle {
  position: absolute;
  right: 7px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #71869a;
  cursor: pointer;
}

.password-toggle:hover {
  background: #eaf2f7;
  color: var(--portal-brand-strong);
}

.login-options {
  display: flex;
  min-height: 20px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 2px;
}

.remember-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #dbe8ee;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}

.remember-option input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--portal-brand);
}

.forgot-link {
  color: #9edff2;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.forgot-link:hover {
  text-decoration: underline;
}

.primary-action {
  display: inline-flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.primary-action {
  margin-top: 21px;
  border: 1px solid var(--portal-brand);
  background: var(--portal-brand);
  color: #fff;
  box-shadow: 0 8px 20px rgba(23, 107, 135, 0.2);
}

#loginForm .primary-action {
  height: var(--login-action-height);
  min-height: var(--login-action-height);
  margin-top: 9px;
}

.otp-dialog .primary-action {
  margin-top: 0;
}

.primary-action:hover {
  border-color: var(--portal-brand-strong);
  background: var(--portal-brand-strong);
}

.primary-action:disabled {
  cursor: wait;
  opacity: 0.72;
}

.security-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: clamp(13px, 2vh, 18px);
  color: #c5d8e1;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.55;
}

.security-note i {
  margin-top: 2px;
  color: #8dd8ef;
}

.login-panel__footer {
  position: relative;
  z-index: 1;
  padding: 9px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(5, 25, 38, 0.24);
  color: #c5d8e1;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-align: center;
  text-transform: uppercase;
}

.otp-modal {
  padding: 16px;
  overflow-y: auto;
  background: rgba(9, 16, 24, 0.54);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.otp-dialog {
  position: relative;
  width: min(100%, 420px);
  max-height: calc(100dvh - 32px);
  padding: clamp(22px, 4vh, 30px);
  overflow: auto;
  border-radius: 20px;
  border: 1px solid var(--login-glass-border) !important;
  background: rgba(255, 255, 255, 0.05) !important;
  box-shadow: var(--login-glass-shadow) !important;
  color: #f7fbff;
  -webkit-backdrop-filter: blur(5px) saturate(125%);
  backdrop-filter: blur(5px) saturate(125%);
}

.otp-dialog__intro {
  margin-bottom: clamp(20px, 3.5vh, 26px);
}

.otp-code {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(7px, 2vw, 10px);
  width: min(100%, 330px);
  margin-inline: auto;
}

.otp-dialog > * {
  position: relative;
  z-index: 1;
}

.otp-dialog h2 {
  color: #ffffff !important;
}

.otp-dialog p {
  color: #d0e0e8 !important;
}

.otp-dialog #otpMaskedEmail,
.otp-dialog #btnResendOtp {
  color: #9edff2 !important;
}

.otp-dialog .otp-input {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1 / 1.08;
  min-width: 0;
  border-color: rgba(255, 255, 255, 0.54);
  background: rgba(255, 255, 255, 0.94);
}

.otp-dialog > button:first-child {
  position: absolute;
  top: 16px;
  right: 16px;
  left: auto;
  z-index: 2;
  color: #c8dae5;
}

.otp-dialog > button:first-child:hover {
  background: rgba(255, 255, 255, 0.10);
  color: #ffffff;
}

.theme-toggle {
  position: fixed;
  right: clamp(14px, 2.5vw, 28px);
  bottom: clamp(14px, 2.5vh, 24px);
  z-index: 20;
  display: inline-grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(16, 35, 56, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 8px 24px rgba(16, 35, 56, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.75);
  color: #176b87;
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.theme-toggle:hover {
  border-color: rgba(23, 107, 135, 0.42);
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
}

.theme-toggle .fa-sun {
  display: none;
}

html[data-theme="light"] body {
  background: #ffffff;
  color: var(--portal-ink);
}

html[data-theme="light"] .login-shell {
  background-color: #ffffff;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.10)),
    url("../images/building-bg.jpg");
  background-blend-mode: normal;
}

html[data-theme="light"] .login-shell::before {
  background: transparent;
}

html[data-theme="light"] .portal-return {
  border-color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.48);
  box-shadow:
    0 8px 24px rgba(16, 35, 56, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  color: var(--portal-ink);
}

html[data-theme="light"] .portal-return:hover {
  border-color: rgba(23, 107, 135, 0.34);
  background: rgba(255, 255, 255, 0.88);
}

html[data-theme="light"] .login-panel {
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(210, 224, 234, 0.34);
  box-shadow:
    0 18px 48px rgba(16, 35, 56, 0.15),
    0 2px 8px rgba(16, 35, 56, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(255, 255, 255, 0.22),
    inset 1px 0 0 rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(5px) saturate(105%);
  backdrop-filter: blur(5px) saturate(105%);
}

html[data-theme="light"] .otp-modal {
  background: rgba(16, 35, 56, 0.16);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

html[data-theme="light"] .brand-lockup {
  border-bottom-color: rgba(16, 35, 56, 0.12);
}

html[data-theme="light"] .brand-lockup__name,
html[data-theme="light"] .login-heading h1 {
  color: var(--portal-ink);
}

html[data-theme="light"] .brand-lockup__module,
html[data-theme="light"] .login-heading p,
html[data-theme="light"] .login-field__label,
html[data-theme="light"] .remember-option,
html[data-theme="light"] .security-note {
  color: var(--portal-muted);
}

html[data-theme="light"] .login-heading__eyebrow,
html[data-theme="light"] .forgot-link,
html[data-theme="light"] .security-note i {
  color: var(--portal-brand);
}

html[data-theme="light"] .login-input {
  border-color: rgba(16, 35, 56, 0.16);
  background: rgba(255, 255, 255, 0.92);
}

html[data-theme="light"] .login-panel__footer {
  border-top-color: rgba(16, 35, 56, 0.12);
  background: rgba(255, 255, 255, 0.24);
  color: #496176;
}

html[data-theme="light"] .otp-dialog {
  border-color: rgba(16, 35, 56, 0.12) !important;
  background: #ffffff !important;
  box-shadow:
    0 18px 48px rgba(16, 35, 56, 0.18),
    0 2px 8px rgba(16, 35, 56, 0.08) !important;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  color: var(--portal-ink);
}

html[data-theme="light"] .otp-dialog::before,
html[data-theme="light"] .otp-dialog::after {
  display: none;
}

html[data-theme="light"] .otp-dialog h2 {
  color: var(--portal-ink) !important;
}

html[data-theme="light"] .otp-dialog p {
  color: var(--portal-muted) !important;
}

html[data-theme="light"] .otp-dialog #otpMaskedEmail,
html[data-theme="light"] .otp-dialog #btnResendOtp {
  color: var(--portal-brand) !important;
}

html[data-theme="light"] .otp-dialog > button:first-child {
  color: #647a8e;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme="dark"] body {
  background: #17191d;
}

html[data-theme="dark"] .login-shell {
  background-color: #17191d;
  background-image:
    linear-gradient(rgba(20, 22, 26, 0.78), rgba(20, 22, 26, 0.86)),
    url("../images/building-bg.jpg");
  background-blend-mode: normal, luminosity;
}

html[data-theme="dark"] .login-shell::before {
  background: rgba(0, 0, 0, 0.08);
}

html[data-theme="dark"] .login-panel {
  border-color: rgba(255, 255, 255, 0.30);
  background: rgba(255, 255, 255, 0.05);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.50),
    inset 0 -1px 0 rgba(255, 255, 255, 0.10);
}

html[data-theme="dark"] input.login-input::placeholder,
html[data-theme="dark"] input.login-input::-webkit-input-placeholder {
  color: #000000 !important;
  opacity: 1 !important;
}

html[data-theme="dark"] .portal-return {
  background: rgba(255, 255, 255, 0.07);
}

html[data-theme="dark"] .theme-toggle {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(24, 26, 30, 0.72);
  color: #ffd166;
}

html[data-theme="dark"] .theme-toggle:hover {
  background: rgba(24, 26, 30, 0.92);
}

html[data-theme="dark"] .theme-toggle .fa-moon {
  display: none;
}

html[data-theme="dark"] .theme-toggle .fa-sun {
  display: inline-block;
}

:focus-visible {
  outline: 3px solid rgba(23, 107, 135, 0.3);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .login-shell {
    padding: 68px 14px 14px;
  }

  .theme-toggle {
    width: 42px;
    height: 42px;
  }

  .login-panel {
    max-height: calc(100dvh - 82px);
  }

  .login-panel__body {
    padding: clamp(18px, 2.8vh, 24px) 20px;
  }

  .brand-lockup img {
    width: 46px;
    height: 46px;
  }

  .brand-lockup__name {
    font-size: 19px;
  }

  .brand-lockup__module {
    font-size: 10px;
  }

  .login-options {
    gap: 10px;
  }

  .otp-dialog {
    padding: 22px 18px;
  }

  .otp-code {
    gap: 6px;
  }
}

@media (max-height: 720px) and (min-width: 481px) {
  :root {
    --login-control-height: 44px;
    --login-action-height: 44px;
  }

  .login-panel__body {
    padding-top: 18px;
    padding-bottom: 18px;
  }

  .brand-lockup {
    padding-bottom: 11px;
  }

  .brand-lockup img {
    width: 44px;
    height: 44px;
  }

  .login-heading {
    margin: 12px 0;
  }

  .login-heading p {
    margin-top: 6px;
    line-height: 1.4;
  }

  .login-input,
  .primary-action {
    min-height: 44px;
    height: 44px;
  }

  .login-options {
    margin-top: 10px;
  }

  .primary-action {
    margin-top: 14px;
  }

  .security-note {
    margin-top: 11px;
  }

  .login-panel__footer {
    padding-top: 9px;
    padding-bottom: 9px;
  }
}

@media (max-height: 599px) and (min-width: 481px) {
  .login-shell {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .login-panel {
    max-height: calc(100dvh - 20px);
  }

  .login-panel__body {
    padding-top: 40px;
    padding-bottom: 20px;
  }

  .brand-lockup__module,
  .login-heading p,
  .security-note {
    line-height: 1.3;
  }

  .security-note {
    margin-top: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/*
 * Targeted login theme surfaces.
 * Keep the original login layout and only change the requested areas.
 */
html[data-theme="light"] .login-panel__body {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.58) 0%,
    rgba(233, 244, 250, 0.50) 54%,
    rgba(205, 226, 239, 0.42) 100%
  );
  border-bottom: 1px solid rgba(255, 255, 255, 0.44);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 -1px 0 rgba(100, 142, 166, 0.08),
    0 10px 24px rgba(74, 112, 137, 0.06);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
  backdrop-filter: blur(22px) saturate(145%);
}

html[data-theme="light"] .login-panel__footer {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.54),
    rgba(212, 231, 242, 0.46)
  );
  border-top-color: rgba(255, 255, 255, 0.60);
  color: #4c6478;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.70);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
  backdrop-filter: blur(22px) saturate(145%);
}

html[data-theme="dark"] .login-panel__body {
  background: rgba(7, 8, 10, 0.92);
}

html[data-theme="dark"] .login-panel__footer {
  background: rgba(3, 4, 6, 0.96);
  border-top-color: rgba(255, 255, 255, 0.12);
  color: #cbd8e1;
}

html[data-theme="dark"] input.login-input {
  color: #f7fbff;
  background: #050607;
  border-color: rgba(255, 255, 255, 0.26);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] input.login-input::placeholder,
html[data-theme="dark"] input.login-input::-webkit-input-placeholder {
  color: #93a2b1 !important;
  opacity: 1 !important;
}

html[data-theme="dark"] input.login-input:focus {
  background: #000000;
  border-color: #82d5ed;
  box-shadow: 0 0 0 3px rgba(130, 213, 237, 0.22);
}

/* Legal pages reuse the employee login background, controls, and glass body. */
.legal-page {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.legal-panel {
  width: min(100%, 760px);
  max-height: calc(100dvh - clamp(32px, 5vh, 48px));
}

.legal-panel__body {
  max-height: inherit;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.legal-panel__body::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.legal-panel .brand-lockup {
  justify-content: center;
  text-align: center;
  gap: 10px;
}

.legal-heading {
  margin-top: 14px;
  padding-bottom: 14px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.20);
}

.legal-heading > p {
  color: #8dd8ef;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.legal-heading h1 {
  margin-top: 4px;
  color: #f7fbff;
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 900;
  line-height: 1.1;
}

.legal-heading span {
  display: block;
  margin-top: 6px;
  color: #a9bdcb;
  font-size: 11px;
  font-weight: 700;
}

.legal-content {
  display: grid;
  gap: 20px;
  padding: 20px 0 8px;
}

.legal-content h2 {
  margin: 0 0 5px;
  color: #f7fbff;
  font-size: 14px;
  font-weight: 900;
}

.legal-content p {
  margin: 0;
  color: #c5d8e1;
  font-size: 13px;
  line-height: 1.65;
}

html[data-theme="light"] .legal-heading {
  border-bottom-color: rgba(16, 35, 56, 0.12);
}

html[data-theme="light"] .legal-heading > p {
  color: var(--portal-brand);
}

html[data-theme="light"] .legal-heading h1,
html[data-theme="light"] .legal-content h2 {
  color: var(--portal-ink);
}

html[data-theme="light"] .legal-heading span,
html[data-theme="light"] .legal-content p {
  color: var(--portal-muted);
}

@media (max-width: 480px) {
  .legal-shell { padding-top: 68px; }
  .legal-panel { max-height: calc(100dvh - 82px); }
  .legal-panel__body { padding: 20px; }
}

html[data-theme="dark"] input.login-input:-webkit-autofill,
html[data-theme="dark"] input.login-input:-webkit-autofill:hover,
html[data-theme="dark"] input.login-input:-webkit-autofill:focus {
  -webkit-text-fill-color: #f7fbff;
  -webkit-box-shadow: 0 0 0 1000px #050607 inset;
}

.recovery-panel {
  width: min(100%, 500px);
}

.recovery-form {
  display: grid;
  gap: 12px;
}

.recovery-form.hidden {
  display: none;
}

.recovery-form .primary-action {
  margin-top: 6px;
}

.recovery-code-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.recovery-code-boxes {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.recovery-code-box {
  width: 100%;
  min-width: 0;
  height: 58px;
  border: 1px solid rgba(16, 35, 56, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--portal-brand);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 22px;
  font-weight: 900;
  text-align: center;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.recovery-code-box:focus {
  border-color: #2c86a5;
  outline: 0;
  box-shadow: 0 0 0 4px rgba(44, 134, 165, 0.18);
  transform: translateY(-1px);
}

.recovery-secondary {
  min-height: 42px;
  border: 0;
  background: transparent;
  color: #9edff2;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.password-strength {
  display: grid;
  gap: 8px;
  margin-top: -2px;
}

.password-strength__heading {
  display: flex;
  justify-content: space-between;
  color: #c5d8e1;
  font-size: 11px;
}

.password-strength__heading strong {
  color: #9fb3c5;
}

.password-strength__track {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.password-strength__track span {
  height: 5px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.32);
}

.password-strength[data-strength="weak"] .password-strength__track span:nth-child(1),
.password-strength[data-strength="fair"] .password-strength__track span:nth-child(-n+2),
.password-strength[data-strength="good"] .password-strength__track span:nth-child(-n+3),
.password-strength[data-strength="strong"] .password-strength__track span {
  background: currentColor;
}

.password-strength[data-strength="weak"] { color: #ef4444; }
.password-strength[data-strength="fair"] { color: #f59e0b; }
.password-strength[data-strength="good"] { color: #0ea5e9; }
.password-strength[data-strength="strong"] { color: #10b981; }
.password-strength[data-strength]:not([data-strength="empty"]) .password-strength__heading strong { color: currentColor; }

.password-requirements {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #9fb3c5;
  font-size: 10px;
}

.password-requirements li {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.password-requirements li.is-met {
  color: #10b981;
}

html[data-theme="light"] .recovery-secondary {
  color: var(--portal-brand);
}

html[data-theme="light"] .password-strength__heading,
html[data-theme="light"] .password-requirements {
  color: var(--portal-muted);
}

html[data-theme="dark"] .recovery-code-box {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(5, 6, 7, 0.82);
  color: #9edff2;
}

@media (max-width: 480px) {
  .recovery-code-boxes { gap: 6px; }
  .recovery-code-box { height: 50px; font-size: 19px; }
}
