/* Nord Identity 4.1 — standalone auth page; all selectors are scoped to #loginScreen.
   One responsive source of truth, no layered historical patches. */
/* Login is an overlay, never a reason to change scrolling in authenticated Nord OS. */
html:has(#loginScreen.nord-auth-v2:not([hidden])),
body:has(#loginScreen.nord-auth-v2:not([hidden])) {
  height: 100%;
  overflow: hidden !important;
  overscroll-behavior: none;
}
#loginScreen.nord-auth-v2 {
  --auth-ink: #f0f5ff;
  --auth-muted: #91a6c6;
  --auth-line: #2a3c56;
  position: fixed;
  inset: 0;
  z-index: 500;
  display: block;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  color: var(--auth-ink);
  background: #0c1524;
  isolation: isolate;
}
#loginScreen.nord-auth-v2[hidden] { display: none !important; }
#loginScreen .nord-auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 55fr) minmax(0, 45fr);
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}
#loginScreen .nord-auth-story,
#loginScreen .nord-auth-main { min-width: 0; min-height: 0; height: 100%; box-sizing: border-box; }
/* Nord Identity: calm, layered Dark Navy + Nord Blue. No images, blur or animation. */
#loginScreen .nord-auth-story {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  overflow: hidden;
  /* Use the added story width for the heading rather than large side gutters. */
  padding:
    clamp(24px, 4.2vh, 48px)
    clamp(24px, 3vw, 58px)
    clamp(24px, 4.2vh, 48px)
    clamp(24px, 2.8vw, 48px);
  background:
    radial-gradient(ellipse at 18% 16%, rgba(112, 178, 255, .21) 0%, rgba(112, 178, 255, 0) 42%),
    radial-gradient(ellipse at 83% 78%, rgba(43, 106, 210, .18) 0%, rgba(43, 106, 210, 0) 45%),
    linear-gradient(155deg, #183a60 0%, #122d4e 34%, #0d223e 68%, #09182e 100%);
  border-right: 1px solid rgba(143, 185, 242, .17);
}
/* Restrained lighting layers are decorative and must never intercept input. */
#loginScreen .nord-auth-story::before,
#loginScreen .nord-auth-story::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
#loginScreen .nord-auth-story::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, .025), transparent 43%, rgba(2, 10, 26, .09));
}
#loginScreen .nord-auth-story::after {
  background: linear-gradient(112deg, rgba(152, 196, 255, .055), transparent 32%, transparent 100%);
}
#loginScreen .nord-auth-story > * { position: relative; z-index: 1; }
#loginScreen .nord-auth-glow { display: none; }
#loginScreen .nord-auth-story-logo {
  display: flex;
  align-items: center;
  flex: none;
  gap: 12px;
  width: max-content;
  max-width: 100%;
  color: #fff;
  text-decoration: none;
}
#loginScreen .nord-auth-story-logo img { display: block; width: 48px; height: 48px; object-fit: contain; }
#loginScreen .nord-auth-story-logo strong { display: block; font-size: 16px; font-weight: 860; letter-spacing: .1em; }
#loginScreen .nord-auth-story-logo small { display: block; margin-top: 3px; font-size: 10px; color: #a1c5ed; letter-spacing: .1em; }
#loginScreen .nord-auth-story-body {
  position: relative;
  flex: 0 1 auto;
  width: 100%;
  max-width: 640px;
  margin: auto 0;
}
#loginScreen .nord-auth-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  padding: 7px 11px;
  border: 1px solid rgba(153, 200, 255, .23);
  border-radius: 999px;
  background: rgba(190, 222, 255, .075);
  color: #d0e5ff;
  font-size: 11px;
  font-weight: 740;
}
#loginScreen .nord-auth-live-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: #69b9ff; }
#loginScreen .nord-auth-story h1 {
  max-width: 580px;
  margin: clamp(18px, 3vh, 27px) 0 13px;
  color: #fff;
  font-size: clamp(31px, 3vw, 54px);
  line-height: 1.12;
  font-weight: 850;
  letter-spacing: -.048em;
  overflow-wrap: normal;
  text-shadow: 0 2px 18px rgba(2, 10, 28, .24);
}
#loginScreen .nord-auth-story h1 em { font-style: normal; color: #87baff; }
#loginScreen .nord-auth-story-body > p {
  max-width: 460px;
  margin: 0;
  color: #b5c9e2;
  font-size: clamp(12px, .89vw, 15px);
  line-height: 1.62;
}
#loginScreen .nord-auth-story-features { display: grid; gap: 13px; margin-top: clamp(18px, 3.3vh, 33px); }
#loginScreen .nord-auth-story-features > span { display: flex; align-items: center; gap: 12px; color: #e0ebfb; font-size: 12px; line-height: 1.45; }
#loginScreen .nord-auth-story-features i {
  display: grid;
  place-items: center;
  flex: 0 0 33px;
  height: 33px;
  border: 1px solid rgba(149, 192, 255, .23);
  border-radius: 10px;
  background: rgba(227, 241, 255, .055);
  color: #aad0ff;
  font-size: 14px;
}
#loginScreen .nord-auth-story-foot { display: flex; justify-content: space-between; gap: 12px; flex: none; color: #a4bfdf; font-size: 10px; }

#loginScreen .nord-auth-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-items: stretch;
  width: 100%;
  padding: clamp(24px, 3.8vh, 44px) clamp(20px, 2.7vw, 60px);
  gap: 12px;
  overflow: hidden;
  background: #0c1524;
}
#loginScreen .nord-auth-head,
#loginScreen .nord-auth-bottom { width: 100%; max-width: 500px; margin-inline: auto; }
#loginScreen .nord-auth-head { box-sizing: border-box; padding-inline: 6px; }
#loginScreen .nord-auth-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex: none; }
#loginScreen .nord-auth-back { display: inline-flex; align-items: center; gap: 9px; color: #a5bce0; text-decoration: none; font-size: 12px; font-weight: 670; white-space: nowrap; }
#loginScreen .nord-auth-back:hover { color: #fff; }
#loginScreen .auth-language { display: flex; align-items: center; gap: 8px; margin: 0; color: #a0b7d6; }
#loginScreen .auth-language select {
  max-width: 160px;
  width: auto;
  padding: 9px 10px;
  color: #f0f5ff;
  background: #17263d;
  border: 1px solid var(--auth-line);
  border-radius: 9px;
  font-size: 12px;
  cursor: pointer;
}
/* The trust message is independent of the form; tall signup forms scroll internally. */
#loginScreen .nord-auth-stage {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%; max-width: 500px; margin-inline: auto; max-height: 100%; min-height: 0; min-width: 0; gap: 9px; overflow: hidden;
}
/* Borderless identity form; visual hierarchy comes from spacing and controls. */
#loginScreen .login-card.nord-auth-card {
  box-sizing: border-box; display: block; align-self: center; flex: 0 1 auto;
  width: 100%; max-width: 500px; min-width: 0; max-height: 100%; min-height: 0;
  margin: 0 !important; padding: 2px 6px 4px;
  overflow-y: auto; /* only the form can scroll when a viewport is physically too short */
  overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #3c506d transparent;
  color: var(--auth-ink); border: 0; border-radius: 0; box-shadow: none;
  background: transparent;
}
#loginScreen .nord-auth-mobile-brand { display: none; }
#loginScreen .nord-auth-identity { display: inline-flex; align-items: center; gap: 11px; margin-bottom: 16px; }
#loginScreen .nord-auth-identity-icon {
  display: grid; place-items: center; flex: none; width: 37px; height: 37px;
  background: #152943; border: 1px solid #29496f; border-radius: 11px;
  color: #9ec7ff; font-size: 16px;
}
#loginScreen .nord-auth-kicker { color: #9abfff; font-size: 11px; font-weight: 800; letter-spacing: .13em; }
#loginScreen .nord-auth-heading h2 {
  margin: 0 0 7px; color: #fff; font-size: clamp(29px, 2.1vw, 35px);
  font-weight: 810; line-height: 1.15; letter-spacing: -.04em;
}
#loginScreen .nord-auth-heading p { margin: 0 0 23px; color: #a1b6d4; font-size: 13px; line-height: 1.55; }
/* Underline tabs: same width/alignment as the fields, with no bulky container. */
#loginScreen .auth-tabs.nord-auth-tabs {
  box-sizing: border-box; display: flex; align-items: stretch; justify-content: flex-start;
  width: 100%; gap: 26px; padding: 0; margin: 0 0 21px;
  border: 0; border-bottom: 1px solid #293d58; border-radius: 0; background: transparent;
}
#loginScreen .nord-auth-tabs button {
  flex: 0 0 auto; min-width: 0; min-height: 41px; padding: 9px 1px 12px;
  color: #97abc8; background: transparent; border: 0; border-bottom: 2px solid transparent;
  border-radius: 0; font-size: 13px; font-weight: 660; cursor: pointer;
}
#loginScreen .nord-auth-tabs button:hover { color: #eff5ff; }
#loginScreen .nord-auth-tabs button.active {
  color: #fff; background: transparent; border-bottom-color: #75a0ff; font-weight: 750;
}
/* Some global button styles inject a white rectangular active background.
   Keep only the Nord Blue underline in both themes. */
#loginScreen .auth-tabs.nord-auth-tabs > button,
#loginScreen .auth-tabs.nord-auth-tabs > button.active,
#loginScreen .auth-tabs.nord-auth-tabs > button:hover,
#loginScreen .auth-tabs.nord-auth-tabs > button:focus {
  appearance: none;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  border-top: 0 !important;
  border-left: 0 !important;
  border-right: 0 !important;
  border-radius: 0 !important;
}
#loginScreen .auth-tabs.nord-auth-tabs > button.active {
  border-bottom: 2px solid #75a0ff !important;
}
html[data-theme="light"] #loginScreen .auth-tabs.nord-auth-tabs > button.active {
  border-bottom-color: #386ff1 !important;
}

#loginScreen .nord-auth-panel { display: flex; flex-direction: column; gap: 14px; }
#loginScreen .nord-auth-panel.hidden { display: none !important; }
#loginScreen .nord-auth-panel .form-group { min-width: 0; margin: 0; }
#loginScreen .nord-auth-panel .form-group label {
  display: block; margin: 0 0 7px; color: #c2d2e9; font-size: 12px;
  line-height: 1.35; font-weight: 650; letter-spacing: .015em; text-transform: none;
}
#loginScreen .nord-auth-input-wrap { position: relative; min-width: 0; }
#loginScreen .nord-auth-input-wrap > i {
  position: absolute; top: 50%; left: 15px; transform: translateY(-50%);
  z-index: 1; pointer-events: none; color: #7993b6; font-size: 14px;
}
#loginScreen .nord-auth-panel .form-group .input {
  display: block; box-sizing: border-box; min-width: 0; width: 100%; height: 48px;
  padding: 0 14px 0 44px; border: 1px solid #2d4260; border-radius: 11px;
  color: #f2f6ff; background: #091728; box-shadow: none; outline: none; font-size: 13px;
  transition: border-color .15s ease, background-color .15s ease;
}
#loginScreen .nord-auth-panel .form-group .input:hover { border-color: #426184; }
/* Prevent Chrome/Edge/Safari autofill from introducing a lighter rectangle. */
#loginScreen .nord-auth-panel .form-group .input:-webkit-autofill,
#loginScreen .nord-auth-panel .form-group .input:-webkit-autofill:hover,
#loginScreen .nord-auth-panel .form-group .input:-webkit-autofill:focus {
  -webkit-text-fill-color: #f2f6ff !important; caret-color: #f2f6ff;
  -webkit-box-shadow: 0 0 0 1000px #091728 inset !important;
  box-shadow: 0 0 0 1000px #091728 inset !important;
  border-color: #2d4260;
}
#loginScreen .nord-auth-panel .form-group .input:-webkit-autofill:focus {
  border-color: #7ea9ff;
  -webkit-box-shadow: 0 0 0 1000px #091728 inset, 0 0 0 3px rgba(78,124,241,.14) !important;
  box-shadow: 0 0 0 1000px #091728 inset, 0 0 0 3px rgba(78,124,241,.14) !important;
}
#loginScreen .nord-auth-panel .form-group .input:focus {
  border-color: #7ea9ff; box-shadow: 0 0 0 3px rgba(78, 124, 241, .14);
  background: #0b1b30;
}
#loginScreen .nord-auth-input-wrap:focus-within > i { color: #a8caff; }
/* Show/hide password controls are touch-sized and keyboard accessible. */
#loginScreen .nord-auth-input-wrap:has(.nord-auth-password-toggle) .input { padding-right: 54px; }
#loginScreen .nord-auth-password-toggle {
  position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
  display: grid; place-items: center; width: 42px; height: 42px; padding: 0;
  color: #829dbe; background: transparent; border: 0; border-radius: 8px; cursor: pointer;
}
#loginScreen .nord-auth-password-toggle:hover,
#loginScreen .nord-auth-password-toggle[aria-pressed="true"] { color: #b9d3ff; }
#loginScreen .nord-auth-password-toggle:focus-visible {
  outline: 2px solid #83acff; outline-offset: -3px;
}
#loginScreen .nord-auth-password-toggle i { pointer-events: none; font-size: 14px; }
#loginScreen .nord-auth-panel .form-group .input::placeholder { color: #7289a8; }
#loginScreen .nord-auth-panel .form-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 12px;
}
#loginScreen .nord-auth-submit,
#loginScreen .nord-auth-discord {
  display: flex; justify-content: center; align-items: center; gap: 10px;
  width: 100%; min-height: 46px; border-radius: 11px; font-size: 13px;
  font-weight: 740; cursor: pointer; transition: background-color .15s ease, border-color .15s ease;
}
#loginScreen .nord-auth-submit {
  margin: 6px 0 0; min-height: 48px; background: #4f7cf1;
  border: 1px solid #628bff; color: #fff;
}
#loginScreen .nord-auth-submit:hover { background: #648cff; border-color: #85a7ff; }
#loginScreen .nord-auth-discord { background: #101e34; border: 1px solid #30486b; color: #e1eafb; }
#loginScreen .nord-auth-discord:hover { background: #182b48; border-color: #5074ad; }
#loginScreen .nord-auth-discord .fa-discord { color: #a6b9ff; font-size: 19px; }
#loginScreen .nord-auth-discord:disabled,
#loginScreen .nord-auth-submit:disabled { opacity: .6; cursor: not-allowed; }
#loginScreen .nord-auth-external { font-size: 11px; color: #8eadd8; }
#loginScreen .nord-auth-divider { position: relative; margin: 8px 0 0; text-align: center; color: #90a7c7; font-size: 11px; }
#loginScreen .nord-auth-divider:before {
  content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid #293e5b;
}
#loginScreen .nord-auth-divider span { position: relative; padding: 0 12px; color: #90a7c7; background: #0c1524; }
#loginScreen .nord-auth-provider-hint {
  margin: -7px 0 0; color: #879dbd; text-align: center; font-size: 10px; line-height: 1.45;
}
#loginScreen .nord-auth-note { margin: 0 0 3px; padding: 9px 11px; color: #b2caeb; background: #172945; border: 1px solid #314769; border-radius: 9px; font-size: 11px; line-height: 1.4; }
#loginScreen .login-error { min-height: 0; margin: 10px 0 0; color: #ffabb4; font-size: 12px; line-height: 1.5; }
#loginScreen .login-error:empty { display: none; }
#loginScreen .nord-auth-security {
  box-sizing: border-box; display: flex; align-items: center; justify-content: center;
  width: 100%; max-width: 500px; min-width: 0; flex: none; gap: 8px;
  margin: 0; padding-inline: 6px; color: #859cbc; text-align: center;
  font-size: 11px; line-height: 1.45;
}
#loginScreen .nord-auth-security i { color: #85aaf0; flex: none; }
#loginScreen .nord-auth-bottom { display: none; } /* one footer only, on the story panel */
#loginScreen .nord-auth-discord-confirm { display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 3px; color: #fff; background: #1b2d53; border: 1px solid #5166a1; border-radius: 11px; }
#loginScreen .nord-auth-discord-confirm > i:first-child { color: #b0b9ff; font-size: 22px; }
#loginScreen .nord-auth-discord-confirm > i:last-child { margin-left: auto; color: #65d4ac; }
#loginScreen .nord-auth-discord-confirm strong { display: block; font-size: 12px; }
#loginScreen .nord-auth-discord-confirm small { display: block; margin-top: 3px; font-size: 11px; color: #adbedb; }
#loginScreen .nord-auth-panel h3 { margin: 5px 0 0; color: #fff; font-size: 20px; }
#loginScreen .nord-auth-step-description { margin: 0 0 6px; color: #adbed8; font-size: 12px; line-height: 1.5; }
#loginScreen .nord-auth-cancel { padding: 8px; color: #b0c5e4; background: transparent; border: 0; cursor: pointer; font-size: 12px; }
#loginScreen button:focus-visible,
#loginScreen a:focus-visible,
#loginScreen select:focus-visible { outline: 2px solid #89b6ff; outline-offset: 3px; }

/* Medium desktop and laptops: extend the branding column without narrowing
   the login form too much; keep the right-hand area usable at 960px. */
@media (min-width: 960px) and (max-width: 1279px) {
  #loginScreen .nord-auth-layout { grid-template-columns: minmax(0, 52fr) minmax(0, 48fr); }
  #loginScreen .nord-auth-story {
    padding:
      clamp(22px, 3.8vh, 36px)
      clamp(18px, 2.4vw, 34px)
      clamp(22px, 3.8vh, 36px)
      clamp(18px, 2vw, 28px);
  }
  #loginScreen .nord-auth-story-body { max-width: 100%; }
  #loginScreen .nord-auth-story h1 { font-size: clamp(28px, 3.2vw, 42px); }
  #loginScreen .nord-auth-story-body > p { font-size: 12px; line-height: 1.55; }
  #loginScreen .nord-auth-story-features { margin-top: 20px; gap: 10px; }
  #loginScreen .nord-auth-story-features > span { font-size: 11px; }
  #loginScreen .nord-auth-story-foot { flex-wrap: wrap; }
  #loginScreen .nord-auth-main { padding: clamp(22px, 3.5vh, 36px) clamp(22px, 3.5vw, 54px); }
}

/* Small tablets: a genuinely centered, single-column identity screen.
   All three rows (top bar, form, footer) share the same central axis. */
@media (max-width: 959px) {
  #loginScreen .nord-auth-layout { grid-template-columns: minmax(0, 1fr); }
  #loginScreen .nord-auth-story { display: none; }
  #loginScreen .nord-auth-main {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    padding: clamp(20px, 4vh, 36px) clamp(24px, 6vw, 70px);
  }
  #loginScreen .nord-auth-head { max-width: 480px; }
  #loginScreen .login-card.nord-auth-card { width: 100%; max-width: 480px; }
  #loginScreen .nord-auth-mobile-brand { display: flex; align-items: center; gap: 10px; margin: 0 0 17px; color: #fff; font-size: 14px; font-weight: 780; letter-spacing: .08em; }
  #loginScreen .nord-auth-mobile-brand img { display: block; width: 41px; height: 41px; object-fit: contain; }
  #loginScreen .nord-auth-bottom { display: block; max-width: 480px; color: #829ab9; text-align: center; font-size: 10px; }
  #loginScreen .nord-auth-bottom > span:first-child { display: none; }
}

/* Phones: same full-viewport UI, form adapts; no fake second desktop column. */
@media (max-width: 767px) {
  #loginScreen .nord-auth-main {
    gap: 8px;
    padding: max(13px, env(safe-area-inset-top, 0px)) clamp(15px, 4.5vw, 28px) max(13px, env(safe-area-inset-bottom, 0px));
  }
  #loginScreen .nord-auth-head { max-width: 480px; }
  #loginScreen .login-card.nord-auth-card { max-width: 460px; padding: 2px 4px 4px; }
  #loginScreen .nord-auth-stage { gap: 8px; }
  #loginScreen .nord-auth-identity { margin-bottom: 10px; }
  #loginScreen .nord-auth-heading p { margin-bottom: 17px; }
  #loginScreen .auth-tabs.nord-auth-tabs { margin-bottom: 17px; gap: 22px; }
  #loginScreen .nord-auth-security { font-size: 10px; }
  #loginScreen .nord-auth-head { padding-inline: 4px; }
  #loginScreen .nord-auth-mobile-brand { margin-bottom: 12px; }
  #loginScreen .nord-auth-heading h2 { font-size: 26px; }
  #loginScreen .nord-auth-panel .form-group .input { font-size: 16px; min-height: 44px; }
  #loginScreen .nord-auth-panel .form-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  #loginScreen .nord-auth-submit,
  #loginScreen .nord-auth-discord { min-height: 45px; }
  #loginScreen .nord-auth-bottom { display: none; }
}
@media (max-width: 380px) {
  #loginScreen .nord-auth-back { font-size: 0; gap: 0; }
  #loginScreen .nord-auth-back i { font-size: 16px; }
  #loginScreen .auth-language select { max-width: 124px; }
  #loginScreen .nord-auth-main { padding-inline: 13px; }
}
/* Short desktop: tighten presentation and login before allowing panel-only scroll. */
@media (min-width: 1280px) and (max-height: 740px) {
  #loginScreen .nord-auth-story { padding-block: 19px; }
  #loginScreen .nord-auth-story-logo img { width: 40px; height: 40px; }
  #loginScreen .nord-auth-story h1 { margin-block: 13px 8px; font-size: clamp(28px, 2.5vw, 42px); }
  #loginScreen .nord-auth-story-body > p { line-height: 1.45; }
  #loginScreen .nord-auth-story-features { margin-top: 15px; gap: 9px; }
  #loginScreen .nord-auth-story-features i { height: 28px; flex-basis: 28px; }
  #loginScreen .nord-auth-main { padding-block: 14px; gap: 6px; }
  #loginScreen .login-card.nord-auth-card { padding-block: 12px 10px; }
  #loginScreen .nord-auth-identity { margin-bottom: 9px; }
  #loginScreen .nord-auth-heading p { margin-bottom: 12px; }
  #loginScreen .auth-tabs.nord-auth-tabs { margin-bottom: 12px; }
  #loginScreen .nord-auth-panel { gap: 7px; }
  #loginScreen .nord-auth-panel .form-group .input { height: 40px; }
  #loginScreen .nord-auth-submit,
  #loginScreen .nord-auth-discord { min-height: 40px; }
  #loginScreen .nord-auth-divider { margin-block: 4px 2px; }
  #loginScreen .nord-auth-security { margin-top: 8px; }
}
@media (max-height: 590px) {
  #loginScreen .nord-auth-main { padding-block: 10px; gap: 5px; }
  #loginScreen .nord-auth-story { padding-block: 15px; }
  #loginScreen .nord-auth-story h1 { margin-block: 10px; }
  #loginScreen .nord-auth-story-body > p { line-height: 1.3; }
  #loginScreen .nord-auth-story-features { display: none; }
  #loginScreen .nord-auth-heading p { margin-bottom: 8px; }
  #loginScreen .auth-tabs.nord-auth-tabs { margin-bottom: 9px; }
  #loginScreen .nord-auth-mobile-brand { margin-bottom: 8px; }
  #loginScreen .nord-auth-bottom { display: none; }
}
/* The signup / password setup is taller. Preserve every field on landscape
   phones by scrolling only the form, never the whole page. */
@media (max-height: 490px) {
  #loginScreen .login-card.nord-auth-card { align-self: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  #loginScreen .nord-auth-submit,
  #loginScreen .nord-auth-discord { transition: none; }
}


/* Nord Identity 4.1 — explicit light-theme palette.
   The platform's generic light-mode .login-card rule uses !important.
   Keep this page's form borderless and transparent, while styling its
   surrounding panel and controls as a cohesive light interface.
   Dark styling above stays untouched; the brand story stays Nord Navy. */
html[data-theme="light"] #loginScreen.nord-auth-v2 {
  --auth-ink: #172840;
  --auth-muted: #556985;
  --auth-line: #d4dfed;
  color: var(--auth-ink);
  background: #f4f7fc;
  color-scheme: light;
}
html[data-theme="light"] #loginScreen .nord-auth-main {
  background: linear-gradient(155deg, #f8faff 0%, #f1f5fc 68%, #eaf1fb 100%);
  color: #172840;
}
html[data-theme="light"] #loginScreen .login-card.nord-auth-card {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0;
  box-shadow: none;
  color: #172840 !important;
}
html[data-theme="light"] #loginScreen .nord-auth-back,
html[data-theme="light"] #loginScreen .auth-language { color: #526781; }
html[data-theme="light"] #loginScreen .nord-auth-back:hover { color: #2455b4; }
html[data-theme="light"] #loginScreen .auth-language select {
  background: #fff;
  border-color: #cad7e9;
  color: #172840;
  color-scheme: light;
}
html[data-theme="light"] #loginScreen .auth-language .nord-select-trigger {
  color: #172840;
  background: #fff;
  border: 1px solid #d1dced;
  border-radius: 9px;
}
html[data-theme="light"] #loginScreen .auth-language .nord-select-trigger:hover {
  border-color: #9cb8e4;
  background: #f7faff;
}
html[data-theme="light"] #loginScreen .nord-auth-mobile-brand { color: #172840; }
html[data-theme="light"] #loginScreen .nord-auth-identity-icon {
  background: #e4efff;
  border-color: #c9ddfc;
  color: #2866c5;
}
html[data-theme="light"] #loginScreen .nord-auth-kicker { color: #2864bd; }
html[data-theme="light"] #loginScreen .nord-auth-heading h2,
html[data-theme="light"] #loginScreen .nord-auth-panel h3 { color: #13233b; }
html[data-theme="light"] #loginScreen .nord-auth-heading p,
html[data-theme="light"] #loginScreen .nord-auth-step-description { color: #60738e; }
html[data-theme="light"] #loginScreen .auth-tabs.nord-auth-tabs {
  border-bottom-color: #d0dced;
  background: transparent;
}
html[data-theme="light"] #loginScreen .nord-auth-tabs button { color: #60738e; }
html[data-theme="light"] #loginScreen .nord-auth-tabs button:hover { color: #1b3f79; }
html[data-theme="light"] #loginScreen .nord-auth-tabs button.active {
  color: #1b4f9f;
  background: transparent;
  border-bottom-color: #386ff1;
}
html[data-theme="light"] #loginScreen .nord-auth-panel .form-group label { color: #334765; }
html[data-theme="light"] #loginScreen .nord-auth-panel .form-group .input {
  color: #172840;
  background: #fff;
  border-color: #cdd9e9;
  color-scheme: light;
}
html[data-theme="light"] #loginScreen .nord-auth-panel .form-group .input:hover {
  border-color: #9cb5d7;
}
html[data-theme="light"] #loginScreen .nord-auth-panel .form-group .input:focus {
  background: #fff;
  border-color: #5181ec;
  box-shadow: 0 0 0 3px rgba(79, 124, 241, .13);
}
html[data-theme="light"] #loginScreen .nord-auth-panel .form-group .input::placeholder {
  color: #7b8fa9;
}
html[data-theme="light"] #loginScreen .nord-auth-input-wrap > i { color: #6481aa; }
html[data-theme="light"] #loginScreen .nord-auth-input-wrap:focus-within > i { color: #386fe0; }
html[data-theme="light"] #loginScreen .nord-auth-password-toggle { color: #647f9f; }
html[data-theme="light"] #loginScreen .nord-auth-password-toggle:hover,
html[data-theme="light"] #loginScreen .nord-auth-password-toggle[aria-pressed="true"] {
  color: #245dbb;
}
html[data-theme="light"] #loginScreen .nord-auth-panel .form-group .input:-webkit-autofill,
html[data-theme="light"] #loginScreen .nord-auth-panel .form-group .input:-webkit-autofill:hover,
html[data-theme="light"] #loginScreen .nord-auth-panel .form-group .input:-webkit-autofill:focus {
  -webkit-text-fill-color: #172840 !important;
  caret-color: #172840;
  -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
  box-shadow: 0 0 0 1000px #fff inset !important;
  border-color: #cdd9e9;
}
html[data-theme="light"] #loginScreen .nord-auth-panel .form-group .input:-webkit-autofill:focus {
  border-color: #5181ec;
  -webkit-box-shadow: 0 0 0 1000px #fff inset, 0 0 0 3px rgba(79, 124, 241, .13) !important;
  box-shadow: 0 0 0 1000px #fff inset, 0 0 0 3px rgba(79, 124, 241, .13) !important;
}
html[data-theme="light"] #loginScreen .nord-auth-submit {
  background: #4978ed;
  border-color: #4978ed;
  color: #fff;
}
html[data-theme="light"] #loginScreen .nord-auth-submit:hover {
  background: #3568e4;
  border-color: #3568e4;
  color: #fff;
}
html[data-theme="light"] #loginScreen .nord-auth-discord {
  background: #edf2ff;
  border-color: #cad6f4;
  color: #28436f;
}
html[data-theme="light"] #loginScreen .nord-auth-discord:hover {
  background: #e2eaff;
  border-color: #9fb8eb;
  color: #1c3765;
}
html[data-theme="light"] #loginScreen .nord-auth-discord .fa-discord { color: #6277d8; }
html[data-theme="light"] #loginScreen .nord-auth-external { color: #5978ae; }
html[data-theme="light"] #loginScreen .nord-auth-divider { color: #63768e; }
html[data-theme="light"] #loginScreen .nord-auth-divider:before {
  border-top-color: #d4dfed;
}
html[data-theme="light"] #loginScreen .nord-auth-divider span {
  color: #60738e;
  background: #f3f6fc;
}
html[data-theme="light"] #loginScreen .nord-auth-provider-hint,
html[data-theme="light"] #loginScreen .nord-auth-security,
html[data-theme="light"] #loginScreen .nord-auth-bottom { color: #667d99; }
html[data-theme="light"] #loginScreen .nord-auth-security i { color: #5175b4; }
html[data-theme="light"] #loginScreen .nord-auth-note {
  background: #e8f0ff;
  border-color: #cbdafa;
  color: #365581;
}
html[data-theme="light"] #loginScreen .nord-auth-discord-confirm {
  background: #e7edff;
  border-color: #c7d5f6;
  color: #24416e;
}
html[data-theme="light"] #loginScreen .nord-auth-discord-confirm strong { color: #1c3560; }
html[data-theme="light"] #loginScreen .nord-auth-discord-confirm small { color: #546e96; }
html[data-theme="light"] #loginScreen .nord-auth-discord-confirm > i:first-child { color: #687bdb; }
html[data-theme="light"] #loginScreen .nord-auth-discord-confirm > i:last-child { color: #178265; }
html[data-theme="light"] #loginScreen .login-error { color: #ab263b; }
html[data-theme="light"] #loginScreen .nord-auth-cancel { color: #476b9a; }
html[data-theme="light"] #loginScreen .nord-auth-cancel:hover { color: #1d4c99; }
html[data-theme="light"] #loginScreen button:focus-visible,
html[data-theme="light"] #loginScreen a:focus-visible,
html[data-theme="light"] #loginScreen select:focus-visible {
  outline-color: #4275e7;
}

/* This boundary marks the end of the identity light palette. */
