.login-page {
  --login-purple: #493a9c;
  --login-purple-dark: #352779;
  --login-red: #d7192d;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--haitistream-login-background);
  color: #fff;
}

/* Lock the login screen to the viewport so the document cannot scroll. */
html:has(.login-page) {
  height: 100%;
  overflow: hidden;
  background: #1c105d;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overscroll-behavior: none;
}

html:has(.login-page)::-webkit-scrollbar { display: none; }

.login-broadcast-art {
  position: fixed;
  z-index: 0;
  top: 31%;
  left: clamp(16px, 2vw, 30px);
  width: clamp(94px, 9vw, 124px);
  aspect-ratio: 9 / 7;
  color: #d4cbed;
  opacity: .22;
  pointer-events: none;
  user-select: none;
}

.login-broadcast-art svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  stroke: currentColor;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-broadcast-art .broadcast-accent { stroke: #d87787; }
.login-broadcast-art .broadcast-live-dot { fill: #d87787; stroke: none; }

.login-tv-art {
  position: fixed;
  z-index: 0;
  left: clamp(16px, 2vw, 30px);
  bottom: clamp(72px, 10vh, 100px);
  width: clamp(108px, 10vw, 138px);
  aspect-ratio: 9 / 7;
  color: #d4cbed;
  opacity: .18;
  pointer-events: none;
  user-select: none;
}

.login-tv-art svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  stroke: currentColor;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-tv-art .tv-live-accent { fill: #d87787; stroke: none; }

.login-device-art {
  position: fixed;
  z-index: 0;
  top: 50%;
  right: clamp(0px, calc(50vw - 720px), 160px);
  width: clamp(100px, 8.33vw, 120px);
  aspect-ratio: 190 / 145;
  transform: translateY(-50%);
  color: #d4cbed;
  opacity: .18;
  pointer-events: none;
  user-select: none;
}

.login-device-art svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  stroke: currentColor;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-device-art .device-live-accent { fill: #d87787; stroke: none; }

.login-header,
.login-footer {
  width: min(1240px, calc(100% - 56px));
  margin: 0 auto;
}

.login-header {
  position: relative;
  z-index: 1;
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.login-home-link {
  color: #fff;
  font: 800 17px/1 "Manrope", "Segoe UI", sans-serif;
  letter-spacing: -.04em;
  text-decoration: none;
}

.login-home-link:focus-visible,
.invitation-switch a:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
  border-radius: 3px;
}

.login-environment {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #e5dff2;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .9px;
}

.login-environment i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #eb5966;
  box-shadow: 0 0 0 4px #d7192d24;
}

.login-main {
  position: relative;
  z-index: 1;
  width: min(1200px, calc(100% - 56px));
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(400px, 500px);
  align-items: center;
  gap: clamp(38px, 6vw, 84px);
  margin: 0 auto;
  padding: 20px 0 38px;
}

.login-intro {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 0;
}

.login-welcome {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.login-brand-frame {
  width: clamp(240px, 25vw, 300px);
  aspect-ratio: 1.64;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 13px;
  overflow: hidden;
  border: 1px solid #ffffffd9;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 48px #0b062d45;
}

.login-brand-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-welcome-copy { min-width: 0; }

.login-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 0 0 15px;
  color: #d8d0ec;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.1px;
}

.login-kicker span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--login-red);
  box-shadow: 0 0 0 4px #df172320;
}

.login-intro h1 {
  margin: 0;
  color: #fff;
  font: 750 clamp(40px, 4.2vw, 58px)/1.03 "Manrope", "Segoe UI", sans-serif;
  letter-spacing: -.055em;
}

.login-intro h1 span { color: #f1edf8; }

.login-intro-copy {
  max-width: 490px;
  margin: 17px 0 0;
  color: #e2dced;
  font-size: 15px;
  line-height: 1.65;
  text-align: center;
}

.login-promise {
  position: relative;
  z-index: 1;
  max-width: 425px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 27px auto 0;
  padding: 13px 15px;
  border: 1px solid #ffffff2b;
  border-radius: 9px;
  background: #ffffff0b;
}

.promise-mark {
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  display: block;
  object-fit: contain;
}

.login-promise p { display: grid; gap: 3px; margin: 0; }
.login-promise strong { color: #fff; font-size: 13px; }
.login-promise p span { color: #d7d0e5; font-size: 11px; line-height: 1.45; }

.login-art {
  position: absolute;
  right: -178px;
  bottom: -300px;
  width: 390px;
  height: 390px;
  opacity: .18;
  pointer-events: none;
}

.art-ring { position: absolute; inset: 0; border: 1px solid #c9bde8; border-radius: 50%; }
.ring-two { inset: 32px; border-color: #ffffff35; }
.art-core { position: absolute; top: 50%; left: 50%; display: grid; width: 82px; height: 82px; place-items: center; transform: translate(-50%, -50%); border: 1px solid #ffffff45; border-radius: 25px; background: linear-gradient(140deg, #ffffff20, #ffffff08); box-shadow: 0 0 60px #ff26313a; }
.art-core i { width: 0; height: 0; margin-left: 6px; border-top: 12px solid transparent; border-bottom: 12px solid transparent; border-left: 18px solid #f9f6ff; }
.art-wave { position: absolute; top: 50%; left: 50%; width: 136px; height: 136px; transform: translate(-50%, -50%) rotate(45deg); border: 1px solid #ffffff45; border-radius: 30px; }
.wave-two { width: 190px; height: 190px; border-color: #ffffff23; border-radius: 42px; transform: translate(-50%, -50%) rotate(45deg); }

.login-card {
  position: relative;
  z-index: 2;
  min-width: 0;
  padding: clamp(25px, 3vw, 34px);
  border: 1px solid #ffffffb8;
  border-radius: 16px;
  background: #fff;
  color: #2c2735;
  box-shadow: 0 28px 84px #0b062d55;
}

.login-card-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.login-card-heading { min-width: 0; flex: 1 1 auto; margin-bottom: 20px; }
.login-card-eyebrow { margin: 0; color: #625b70; font-size: 10px; font-weight: 750; letter-spacing: 1px; }
.login-card-heading h2 { margin: 7px 0 5px; color: #292431; font: 750 29px/1.15 "Manrope", "Segoe UI", sans-serif; letter-spacing: -.035em; }
.login-card-heading > p:last-child { margin: 0; color: #625d69; font-size: 13px; line-height: 1.5; }
.workspace-mode-switch { display: flex; flex: 0 0 auto; align-items: center; gap: 7px; margin-top: 1px; color: var(--login-purple); font-size: 10px; font-weight: 700; cursor: pointer; user-select: none; }
.workspace-mode-switch input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.workspace-switch-track { display: flex; width: 32px; height: 18px; align-items: center; padding: 2px; border: 1px solid #aaa0cf; border-radius: 99px; background: #eeeaf7; transition: background-color .16s ease, border-color .16s ease; }
.workspace-switch-track > span { width: 12px; height: 12px; border-radius: 50%; background: #7564ad; box-shadow: 0 1px 2px #20174740; transition: transform .16s ease, background-color .16s ease; }
.workspace-mode-switch input:checked + .workspace-switch-track { border-color: var(--login-purple); background: var(--login-purple); }
.workspace-mode-switch input:checked + .workspace-switch-track > span { transform: translateX(14px); background: #fff; }
.workspace-mode-switch:has(input:focus-visible) .workspace-switch-track { outline: 2px solid #8d7bd1; outline-offset: 2px; }
.workspace-mode-switch input:disabled + .workspace-switch-track { opacity: .6; cursor: wait; }

.credential-preview {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.credential-preview label {
  margin-top: 5px;
  color: #393441;
  font-size: 12px;
  font-weight: 700;
}

.credential-preview input {
  width: 100%;
  min-height: 47px;
  padding: 11px 13px;
  border: 1px solid #d4d0db;
  border-radius: 7px;
  outline: none;
  background: #fff;
  color: #282430;
  font: inherit;
  font-size: 14px;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.credential-preview input::placeholder { color: #77717e; opacity: 1; }
.credential-preview input:hover { border-color: #a9a2b6; }
.credential-preview input:focus-visible { border-color: var(--login-purple); box-shadow: 0 0 0 3px #493a9c30; background: #fff; }
.credential-preview input[readonly] { background: #f5f4f7; color: #4c4654; }
.credential-preview p { display: flex; align-items: center; gap: 6px; margin: 3px 0 0; color: #625d69; font-size: 11px; line-height: 1.5; }
.credential-preview #password-hint { display: block; }
.credential-preview p span { color: #625684; font-size: 14px; }

.workspace-choice-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 21px 0 9px;
  color: #625d69;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .75px;
}
.workspace-choice-heading[hidden],
.auth-entry-button[hidden] { display: none; }

.workspace-choice-heading i { height: 1px; flex: 1; background: #e6e3e9; }
.staff-choice-heading { margin-top: 16px; }

.workspace-entry-button {
  display: inline-flex;
  min-height: 35px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding: 0 11px;
  border: 1px solid #ded9eb;
  border-radius: 6px;
  background: #f5f3fa;
  color: #403576;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.auth-entry-button {
  width: 100%;
  min-height: 49px;
  margin: 0;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  text-align: left;
  font-size: 14px;
  transition: color .16s ease, background-color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.auth-entry-button span:last-child { font-size: 17px; transition: transform .16s ease; }
.auth-entry-button:hover { transform: translateY(-1px); }
.auth-entry-button:hover span:last-child { transform: translateX(2px); }
.auth-entry-button:active { transform: translateY(0); }
.auth-entry-button:focus-visible { outline: 3px solid #8d7bd1; outline-offset: 3px; }
.auth-entry-button:disabled { cursor: wait; opacity: .72; transform: none; }

.workspace-entry-button.auth-entry-button:not(.staff-entry-button),
#accept-invitation {
  border-color: var(--login-purple);
  background: var(--login-purple);
  color: #fff;
  box-shadow: 0 5px 12px #493a9c24;
}

.workspace-entry-button.auth-entry-button:not(.staff-entry-button):hover,
#accept-invitation:hover { border-color: var(--login-purple-dark); background: var(--login-purple-dark); }

.staff-entry-button {
  border-color: #d91117;
  background: #d91117;
  color: #fff;
  box-shadow: 0 5px 12px #d911172b;
}

.staff-entry-button:hover { border-color: #b40e13; background: #b40e13; color: #fff; }
.staff-entry-button:focus-visible { outline-color: #9c0b11; }
.staff-entry-button:disabled,
.staff-entry-button:disabled:hover { border-color: #a94c50; background: #a94c50; color: #fff; cursor: wait; opacity: 1; transform: none; box-shadow: none; }
.staff-entry-button:disabled:hover span:last-child { transform: none; }

.login-warning {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 19px;
  padding: 10px 11px;
  border: 1px solid #e4e1e9;
  border-radius: 7px;
  background: #f8f7fa;
  color: #595363;
}

.login-warning > span {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid #b8b1c5;
  border-radius: 50%;
  color: #5d536f;
  font-size: 10px;
  font-weight: 750;
}

.login-warning p { display: grid; gap: 2px; margin: 0; }
.login-warning strong { color: #494352; font-size: 11px; line-height: 1.4; }
.login-warning p span { color: #625d69; font-size: 10px; line-height: 1.45; }
.login-role-note { min-height: 0; margin: 11px 0 0; color: #625d69; font-size: 11px; line-height: 1.5; }
.login-role-note:empty { display: none; }
.login-role-note.has-error { color: #9f1826; }
.login-role-note.has-success { color: #433472; }
.invitation-switch a { color: var(--login-purple-dark); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }

.login-footer {
  position: relative;
  z-index: 1;
  min-height: 55px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #ffffff2b;
  color: #d0c9e0;
  font-size: 10px;
}

@media (max-width: 1100px) {
  .login-broadcast-art,
  .login-tv-art { display: none; }
}

@media (max-width: 1439px) {
  .login-device-art { display: none; }
}

@media (max-width: 980px) {
  .login-main {
    width: min(650px, calc(100% - 48px));
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding: 22px 0 30px;
  }
  .login-intro { padding: 12px 0 0; }
  .login-welcome { gap: 22px; }
  .login-brand-frame { width: 240px; }
  .login-intro h1 { font-size: clamp(42px, 6vw, 54px); }
  .login-intro-copy { max-width: 500px; margin-top: 12px; font-size: 14px; }
  .login-promise { margin: 18px auto 0; }
  .login-art { right: -130px; bottom: -300px; }
  .login-card { width: 100%; }
}

@media (max-width: 560px) {
  .login-header,
  .login-footer { width: calc(100% - 32px); }
  .login-header { min-height: 65px; }
  .login-home-link { font-size: 15px; }
  .login-environment { gap: 6px; font-size: 8px; letter-spacing: .55px; }
  .login-main { width: min(500px, calc(100% - 32px)); gap: 17px; padding: 14px 0 24px; }
  .login-intro { padding-top: 4px; }
  .login-welcome { align-items: center; gap: 17px; }
  .login-brand-frame { width: min(196px, 66vw); padding: 9px; border-radius: 9px; }
  .login-kicker { margin-bottom: 9px; font-size: 9px; }
  .login-intro h1 { font-size: clamp(38px, 10vw, 48px); }
  .login-intro-copy { max-width: 440px; margin-top: 10px; font-size: 13px; line-height: 1.55; }
  .login-promise { max-width: 100%; margin: 16px 0 0; padding: 10px 12px; }
  .login-art { display: none; }
  .login-card { padding: 22px 19px; border-radius: 13px; }
  .login-card-heading { margin-bottom: 17px; }
  .login-card-heading h2 { font-size: 26px; }
  .credential-preview { margin-top: 14px; }
  .workspace-choice-heading { margin-top: 18px; }
  .staff-choice-heading { margin-top: 15px; }
  .auth-entry-button { min-height: 48px; }
  .login-footer { min-height: 50px; font-size: 9px; }
}

@media (max-width: 360px) {
  .login-header,
  .login-footer,
  .login-main { width: calc(100% - 24px); }
  .login-card { padding: 19px 15px; }
  .login-environment { font-size: 7px; }
  .login-footer { align-items: flex-start; flex-direction: column; justify-content: center; gap: 4px; }
}

@media (max-height: 760px) {
  .login-header { min-height: 48px; }
  .login-main { padding-top: 6px; padding-bottom: 8px; }
  .login-intro { padding: 0; }
  .login-welcome { gap: 11px; }
  .login-brand-frame { width: clamp(150px, 20vh, 200px); padding: 8px; border-radius: 9px; }
  .login-kicker { margin-bottom: 7px; font-size: 9px; }
  .login-intro h1 { font-size: clamp(34px, 5vh, 42px); }
  .login-intro-copy { max-width: 440px; margin-top: 7px; font-size: 12px; line-height: 1.45; }
  .login-promise { margin-top: 10px; padding: 8px 10px; }
  .promise-mark { width: 26px; height: 26px; }
  .login-promise strong { font-size: 11px; }
  .login-promise p span { font-size: 10px; }
  .login-card { padding: 17px 22px; }
  .login-card-heading { margin-bottom: 11px; }
  .login-card-heading h2 { margin-top: 4px; font-size: 24px; }
  .credential-preview { gap: 5px; margin-top: 10px; }
  .credential-preview label { margin-top: 2px; font-size: 11px; }
  .credential-preview input { min-height: 39px; padding: 7px 11px; }
  .workspace-choice-heading { margin-top: 12px; }
  .staff-choice-heading { margin-top: 9px; }
  .auth-entry-button { min-height: 39px; }
  .login-warning { margin-top: 10px; padding: 7px 9px; }
  .login-footer { min-height: 34px; }
}

@media (max-height: 620px) {
  .login-home-link { font-size: 14px; }
  .login-header { min-height: 40px; }
  .login-environment { font-size: 8px; }
  .login-welcome { gap: 7px; }
  .login-brand-frame { width: clamp(112px, 17vh, 145px); padding: 5px; }
  .login-kicker { margin-bottom: 4px; font-size: 8px; }
  .login-intro h1 { font-size: clamp(28px, 4.5vh, 34px); }
  .login-intro-copy { display: none; }
  .login-promise { display: none; }
  .login-card { padding: 12px 18px; }
  .login-card-heading { margin-bottom: 7px; }
  .login-card-heading h2 { font-size: 21px; }
  .login-card-heading > p:last-child { font-size: 11px; }
  .credential-preview { gap: 3px; margin-top: 6px; }
  .credential-preview input { min-height: 34px; padding: 5px 9px; }
  .workspace-choice-heading { margin-top: 8px; margin-bottom: 5px; }
  .staff-choice-heading { margin-top: 6px; }
  .auth-entry-button { min-height: 34px; font-size: 12px; }
  .login-warning { margin-top: 7px; padding: 6px 8px; }
  .login-warning strong { font-size: 10px; }
  .login-warning p span { font-size: 9px; }
  .login-footer { min-height: 26px; font-size: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .credential-preview input,
  .auth-entry-button,
  .auth-entry-button span:last-child { transition: none; }
}
.existing-workspaces { display: grid; gap: 8px; margin: 0 0 20px; padding: 14px; border: 1px solid #ded9eb; border-radius: 10px; background: #f8f7fb; }
.existing-workspaces p { margin: 0 0 2px; color: #57516b; font-size: 12px; font-weight: 700; }
.existing-workspaces a { display: flex; justify-content: space-between; gap: 12px; color: #392979; font-size: 13px; font-weight: 700; text-decoration: none; }
.existing-workspaces a:hover { text-decoration: underline; }
