/* Standalone helpdesk sign-in experience. Load after platform.css. */
body.login-page {
  --login-ink: #19233b;
  --login-muted: #73809a;
  --login-blue: #2463eb;
  --login-blue-deep: #174fc8;
  --login-border: #e4eaf5;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  position: relative;
  padding: 40px 24px;
  color: var(--login-ink);
  background:
    radial-gradient(ellipse at 16% 12%, #edf5ff 0, transparent 38%),
    radial-gradient(ellipse at 73% 88%, #f3f4ff 0, transparent 42%),
    #fff;
}

body.login-page::before,
body.login-page::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: -1;
}

/* Sparse light points, with a slow drift that never competes with the form. */
body.login-page::before {
  inset: 0;
  opacity: .48;
  background-image:
    radial-gradient(circle, #7da8f5 1px, transparent 1.8px),
    radial-gradient(circle, #91b3f0 1px, transparent 1.8px),
    radial-gradient(circle, #a5a9ed 1px, transparent 1.8px);
  background-size: 151px 151px, 223px 223px, 307px 307px;
  background-position: 18px 28px, 79px 106px, 131px 40px;
  animation: login-points-drift 34s ease-in-out infinite alternate;
}

/* Large cropped orbital stroke at the upper right. */
body.login-page::after {
  width: min(74vw, 870px);
  aspect-ratio: 1;
  top: -49vw;
  right: -30vw;
  border: 1px solid rgb(165 146 235 / 23%);
  border-radius: 50%;
  box-shadow: 0 0 0 24px rgb(176 160 239 / 6%), 0 0 0 72px rgb(176 160 239 / 5%);
  background: radial-gradient(circle at 45% 68%, rgb(199 190 250 / 12%), transparent 53%);
  animation: login-orbit-breathe 9s ease-in-out infinite alternate;
}

.login-scene {
  width: min(100%, 360px);
  position: relative;
  z-index: 1;
  padding: 14px 0;
  animation: login-form-arrive .75s cubic-bezier(.2,.75,.25,1) both;
}

.login-mark {
  display: inline-flex;
  align-items: center;
  margin-bottom: 36px;
  border-radius: 8px;
}

.login-mark img {
  display: block;
  width: 176px;
  max-width: 70vw;
  height: auto;
}

.login-scene h1 {
  margin: 0 0 9px;
  color: var(--login-ink);
  font-size: 24px;
  font-weight: 690;
  line-height: 1.22;
  letter-spacing: -.7px;
}

.login-form {
  display: grid;
  gap: 15px;
  margin-top: 28px;
}

.login-form label {
  display: block;
  margin: 0 0 -8px 4px;
  color: #53617b;
  font-size: 13px;
  font-weight: 600;
}

.login-form input:not([type="checkbox"]):not([type="hidden"]) {
  width: 100%;
  min-width: 0;
  min-height: 54px;
  padding: 0 19px;
  border: 1px solid var(--login-border);
  border-radius: 40px;
  outline: none;
  color: var(--login-ink);
  background: rgb(255 255 255 / 82%);
  box-shadow: 0 4px 18px rgb(35 69 126 / 4%);
  font-size: 15px;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.login-form input::placeholder { color: #a0abc0; }
.login-form input:focus {
  border-color: #81a8fa;
  background: #fff;
  box-shadow: 0 0 0 4px rgb(57 112 235 / 11%);
}

.login-password-control {
  position: relative;
}

.login-password-control input { padding-right: 58px !important; }

.login-password-toggle {
  position: absolute;
  inset: 0 8px 0 auto;
  display: grid;
  place-items: center;
  width: 42px;
  min-height: 42px;
  margin: auto 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #7886a1;
  background: transparent;
}

.login-password-toggle:hover { color: var(--login-blue); background: #f1f5ff; }
.login-password-toggle:focus-visible { outline: 3px solid #9ab8fb; outline-offset: 1px; }

.login-submit {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 54px;
  margin-top: 7px;
  padding: 0 20px;
  overflow: hidden;
  border: 0;
  border-radius: 40px;
  color: #fff;
  background: linear-gradient(105deg, #3677f2, #2059df);
  box-shadow: 0 9px 22px rgb(39 98 228 / 22%);
  font-size: 15px;
  font-weight: 650;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.login-submit:hover {
  transform: translateY(-1px);
  background: linear-gradient(105deg, #2e6ce9, var(--login-blue-deep));
  box-shadow: 0 12px 26px rgb(39 98 228 / 28%);
}

.login-submit:active { transform: translateY(0); }
.login-submit:focus-visible { outline: 3px solid #9ab8fb; outline-offset: 4px; }
.login-submit:disabled { cursor: wait; opacity: .88; }

.login-spinner {
  display: none;
  width: 17px;
  height: 17px;
  margin-left: 10px;
  border: 2px solid rgb(255 255 255 / 42%);
  border-top-color: #fff;
  border-radius: 50%;
  animation: login-spin .7s linear infinite;
}

.login-form[aria-busy="true"] .login-spinner { display: inline-block; }
.login-form[aria-busy="true"] .login-submit-label { opacity: .88; }

.login-splash {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  background: #fff;
}

body.login-entering .login-splash {
  animation: login-splash-out 1.55s cubic-bezier(.65,0,.3,1) both;
}

.login-splash-symbol {
  position: relative;
  display: grid;
  place-items: center;
  width: 144px;
  aspect-ratio: 1;
  border: 1px solid rgb(77 121 235 / 17%);
  border-radius: 50%;
  background: radial-gradient(circle, #f4f7ff 0 39%, rgb(227 236 255 / 70%) 40% 58%, transparent 59%);
  animation: login-splash-pulse 1.55s ease-out both;
}

.login-splash-symbol::before,
.login-splash-symbol::after {
  content: "";
  position: absolute;
  inset: -19px;
  border: 1px solid rgb(75 121 235 / 18%);
  border-radius: 50%;
  animation: login-ripple 1.55s ease-out both;
}

.login-splash-symbol::after { animation-delay: .18s; }
.login-splash-symbol img { width: 58px; height: 58px; object-fit: contain; }

.login-splash-brand {
  position: absolute;
  bottom: max(28px, env(safe-area-inset-bottom));
  left: 50%;
  width: 112px;
  max-height: 34px;
  object-fit: contain;
  transform: translateX(-50%);
  opacity: .72;
}

body.login-page :focus-visible { outline-color: #78a2fa; }

@keyframes login-points-drift {
  from { background-position: 18px 28px, 79px 106px, 131px 40px; }
  to { background-position: 32px 8px, 56px 128px, 150px 22px; }
}
@keyframes login-orbit-breathe { to { transform: translate(-8px, 12px) scale(1.015); opacity: .75; } }
@keyframes login-form-arrive {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes login-splash-out {
  0%, 68% { opacity: 1; visibility: visible; }
  100% { opacity: 0; visibility: hidden; }
}
@keyframes login-splash-pulse {
  0% { transform: scale(.76); opacity: 0; }
  22%, 58% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.08); opacity: 0; }
}
@keyframes login-ripple {
  0% { transform: scale(.74); opacity: 0; }
  25% { opacity: .7; }
  100% { transform: scale(1.34); opacity: 0; }
}
@keyframes login-spin { to { transform: rotate(360deg); } }

@media (max-width: 540px) {
  body.login-page { padding: 28px 25px; }
  .login-scene { width: min(100%, 360px); }
  .login-mark { margin-bottom: 30px; }
  body.login-page::after { width: 112vw; top: -63vw; right: -55vw; }
}

@media (prefers-reduced-motion: reduce) {
  body.login-page::before,
  body.login-page::after,
  .login-scene,
  .login-spinner,
  .login-splash-symbol,
  .login-splash-symbol::before,
  .login-splash-symbol::after,
  body.login-entering .login-splash {
    animation: none !important;
  }
  body.login-entering .login-splash { visibility: hidden; opacity: 0; }
  .login-submit, .login-form input { transition: none; }
}

html[data-theme="dark"] body.login-page {
  --login-ink: #eef2ff;
  --login-muted: #a5b1c8;
  --login-border: #303b55;
  background:
    radial-gradient(ellipse at 16% 12%, #172746 0, transparent 40%),
    radial-gradient(ellipse at 73% 88%, #211d3d 0, transparent 43%),
    #101522;
}

html[data-theme="dark"] body.login-page::before { opacity: .3; }
html[data-theme="dark"] body.login-page::after {
  border-color: rgb(172 157 244 / 22%);
  box-shadow: 0 0 0 24px rgb(176 160 239 / 5%), 0 0 0 72px rgb(176 160 239 / 4%);
}
html[data-theme="dark"] .login-form label { color: #b7c2d8; }
html[data-theme="dark"] .login-form input:not([type="checkbox"]):not([type="hidden"]) {
  color: var(--login-ink);
  background: rgb(25 33 50 / 88%);
  box-shadow: none;
}
html[data-theme="dark"] .login-form input::placeholder { color: #7886a1; }
html[data-theme="dark"] .login-form input:focus { background: #1b2539; }
html[data-theme="dark"] .login-password-toggle { color: #a5b1c8; }
html[data-theme="dark"] .login-password-toggle:hover { background: #27334d; }
html[data-theme="dark"] .login-splash { background: #101522; }
html[data-theme="dark"] .login-splash-symbol {
  border-color: rgb(141 169 244 / 22%);
  background: radial-gradient(circle, #1a2743 0 39%, rgb(45 61 98 / 78%) 40% 58%, transparent 59%);
}
html[data-theme="dark"] .login-splash-symbol::before,
html[data-theme="dark"] .login-splash-symbol::after { border-color: rgb(141 169 244 / 25%); }

@media (prefers-reduced-motion: reduce) {
  html[data-theme="dark"] body.login-entering .login-splash { visibility: hidden; opacity: 0; }
}

.login-form [hidden] { display: none; }

body.login-page .login-form .login-submit { border-radius: 999px !important; }
.login-recovery { width: fit-content; color: #3654d8; font-size: 14px; text-decoration: underline; text-underline-offset: 2px; }
html[data-theme="dark"] .login-recovery { color: #aab9ff; }

body.login-page .login-scene {
  width: min(100%, 410px);
  padding: clamp(24px, 6vw, 38px);
  border: 1px solid #dce5fb;
  border-radius: 26px;
  background: linear-gradient(145deg, #e6edff, #fff 52%, #f3efff);
  box-shadow: 0 18px 54px #29447a1c;
  text-align: center;
}
body.login-page .login-mark { margin-bottom: 16px; }
body.login-page .login-form { gap: 12px; margin-top: 20px; }
body.login-page .login-form label { margin: 0; }
body.login-page .login-form input:not([type="checkbox"]):not([type="hidden"]) { min-height: 46px; }
body.login-page .login-recovery { justify-self: center; }
html[data-theme="dark"] body.login-page .login-scene {
  border-color: #38476b;
  background: linear-gradient(145deg, #253656, #192236 56%, #2a2344);
  box-shadow: 0 18px 54px #05081466;
}

@media (prefers-reduced-motion: no-preference) {
  .login-step-arriving { animation: login-form-arrive 220ms ease-out both; }
}

@media (max-width: 540px) {
  html:has(body.login-page) { overflow-x: clip; }
  body.login-page {
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    min-height: 100svh;
    overflow: visible;
    padding: max(14px,env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) max(14px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left));
  }
  body.login-page::after { display: none; }
  body.login-page .login-scene { box-sizing: border-box; width: min(100%,410px); min-width: 0; padding: 20px 18px; border-radius: 20px; }
  body.login-page .login-mark { margin-bottom: 10px; }
  body.login-page .login-mark img { width: 122px; max-width: 100%; height: auto; }
  body.login-page .login-scene h1 { font-size: 26px; line-height: 1.15; }
  body.login-page .login-form { gap: 9px; margin-top: 13px; }
  body.login-page .login-form input:not([type="checkbox"]):not([type="hidden"]) { min-height: 42px; font-size: 16px; }
}

.login-form .login-session-option {
    display:flex;
    align-items:center;
    gap:8px;
    font-size:.85rem;
    line-height:1.3;
}
.login-session-option input[type="checkbox"] {
    flex:none;
    width:16px;
    height:16px;
    margin:0;
}
