login-dialog {
  position: relative;
  z-index: 3000;
}

.login-dialog__backdrop {
  position: fixed;
  z-index: 3000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
  background: rgba(5, 25, 45, 0.58);
  backdrop-filter: blur(6px) saturate(0.9);
  animation: login-dialog-backdrop-in 180ms ease-out both;
}

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

.login-dialog__panel {
  position: relative;
  width: min(100%, 470px);
  max-height: calc(100dvh - 48px);
  padding: 28px 30px 26px;
  overflow-y: auto;
  border: 1px solid rgba(133, 169, 195, 0.42);
  border-radius: 20px;
  color: #172d40;
  background:
    linear-gradient(180deg, rgba(239, 247, 252, 0.72), rgba(255, 255, 255, 0) 112px),
    #fff;
  box-shadow:
    0 30px 70px rgba(3, 28, 52, 0.3),
    0 2px 8px rgba(3, 28, 52, 0.12);
  animation: login-dialog-panel-in 210ms cubic-bezier(0.2, 0.75, 0.3, 1) both;
  scrollbar-width: thin;
  scrollbar-color: #b6c8d5 transparent;
}

.login-dialog__panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(90deg, #164f7e, #2385bb 62%, #68a9c9);
}

.login-dialog__close {
  position: absolute;
  z-index: 2;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0 0 2px;
  border: 1px solid #d6e0e7;
  border-radius: 10px;
  color: #496174;
  background: rgba(248, 251, 253, 0.94);
  font: 400 23px/1 "Source Sans 3", sans-serif;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.login-dialog__close:hover {
  border-color: #aec6d6;
  color: #123f64;
  background: #edf5f9;
  transform: translateY(-1px);
}

.login-dialog__identity {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  padding-right: 52px;
}

.login-dialog__logo-wrap {
  display: grid;
  place-items: center;
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  padding: 6px;
  border: 1px solid rgba(125, 167, 195, 0.48);
  border-radius: 15px;
  background: linear-gradient(145deg, #f8fcff, #e5f1f7);
  box-shadow:
    inset 0 1px 0 #fff,
    0 7px 16px rgba(17, 72, 111, 0.14);
}

.login-dialog__logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-dialog__brand {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.login-dialog__brand strong {
  color: #123f64;
  font-family: "Sora", sans-serif;
  font-size: 15px;
  line-height: 1.3;
}

.login-dialog__brand small {
  overflow: hidden;
  color: #637787;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.login-dialog__heading {
  margin: 25px 0 0;
}

.login-dialog__eyebrow {
  margin: 0 0 6px;
  color: #356f98;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.login-dialog__heading h2 {
  margin: 0;
  color: #102f4a;
  font-family: "Sora", sans-serif;
  font-size: clamp(24px, 5vw, 30px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.18;
}

.login-dialog__municipality {
  margin: 6px 0 0;
  color: #2c5e83;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

#login-dialog-description {
  margin: 14px 0 0;
  color: #5a6f7d;
  font-size: 14px;
  line-height: 1.55;
}

.login-dialog__separator {
  display: flex;
  align-items: center;
  height: 1px;
  margin: 22px 0;
  background: #e2e9ee;
}

.login-dialog__separator span {
  width: 48px;
  height: 2px;
  border-radius: 2px;
  background: #397da8;
}

.login-dialog__form {
  display: grid;
  gap: 16px;
}

.login-dialog__field {
  display: grid;
  gap: 7px;
}

.login-dialog__field label {
  color: #263f53;
  font-size: 13px;
  font-weight: 700;
}

.login-dialog__control {
  position: relative;
}

.login-dialog__field input {
  width: 100%;
  min-height: 50px;
  padding: 11px 13px 11px 44px;
  border: 1px solid #bdccd6;
  border-radius: 11px;
  color: #172d40;
  background: #fbfdfe;
  font: 400 15px/1.3 "Source Sans 3", "Segoe UI", sans-serif;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.login-dialog__field input::placeholder {
  color: #8293a0;
  opacity: 1;
}

.login-dialog__field input:hover {
  border-color: #93adbe;
  background: #fff;
}

.login-dialog__field input:focus {
  border-color: #397da8;
  outline: none;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(57, 125, 168, 0.15);
}

.login-dialog__field input[aria-invalid="true"] {
  border-color: #a53d38;
  box-shadow: 0 0 0 3px rgba(165, 61, 56, 0.1);
}

.login-dialog__field-icon {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 15px;
  width: 17px;
  height: 17px;
  color: #53758c;
  pointer-events: none;
  transform: translateY(-50%);
  transition: color 160ms ease;
}

.login-dialog__control:focus-within .login-dialog__field-icon {
  color: #236f9d;
}

.login-dialog__field-icon--user::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 6px;
  height: 6px;
  border: 1.7px solid currentColor;
  border-radius: 50%;
  transform: translateX(-50%);
}

.login-dialog__field-icon--user::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 14px;
  height: 7px;
  border: 1.7px solid currentColor;
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
  transform: translateX(-50%);
}

.login-dialog__field-icon--lock::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 2px;
  width: 13px;
  height: 10px;
  border: 1.7px solid currentColor;
  border-radius: 3px;
}

.login-dialog__field-icon--lock::after {
  content: "";
  position: absolute;
  top: 0;
  left: 5px;
  width: 7px;
  height: 8px;
  border: 1.7px solid currentColor;
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
}

.login-dialog__password-wrap input {
  padding-right: 78px;
}

.login-dialog__password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  min-width: 64px;
  min-height: 34px;
  padding: 7px 8px;
  border: 0;
  border-radius: 8px;
  color: #2c688f;
  background: transparent;
  font: 700 12px/1 "Source Sans 3", sans-serif;
  cursor: pointer;
  transform: translateY(-50%);
  transition: color 150ms ease, background-color 150ms ease;
}

.login-dialog__password-toggle:hover {
  color: #154d73;
  background: #eaf2f7;
}

.login-dialog__message {
  min-height: 20px;
  margin: -3px 0 0;
  color: #94342f;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.login-dialog__message:not(:empty) {
  animation: login-dialog-message-in 160ms ease-out both;
}

.login-dialog__submit {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 12px 20px;
  border: 1px solid #164f7e;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(135deg, #174f7c, #236f9d);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 7px 16px rgba(15, 63, 98, 0.2);
  font: 700 15px/1.2 "Source Sans 3", sans-serif;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background-color 170ms ease, box-shadow 170ms ease, transform 170ms ease;
}

.login-dialog__submit:hover:not(:disabled) {
  background: linear-gradient(135deg, #123f66, #1d638f);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.13),
    0 10px 20px rgba(15, 63, 98, 0.26);
  transform: translateY(-1px);
}

.login-dialog__submit:active:not(:disabled) {
  box-shadow: 0 4px 10px rgba(15, 63, 98, 0.2);
  transform: translateY(0);
}

.login-dialog__submit:disabled {
  border-color: #8ba3b3;
  color: #eef3f6;
  background: #8ba3b3;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.8;
}

.login-dialog__submit.is-loading {
  cursor: wait;
}

.login-dialog__submit-icon {
  position: relative;
  width: 16px;
  height: 16px;
  border: 1.8px solid currentColor;
  border-radius: 50%;
}

.login-dialog__submit-icon::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 4px;
  width: 6px;
  height: 1.8px;
  border-radius: 2px;
  background: currentColor;
  transform: translateY(-50%);
}

.login-dialog__submit-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 3px;
  width: 4px;
  height: 4px;
  border-top: 1.8px solid currentColor;
  border-right: 1.8px solid currentColor;
  transform: translateY(-50%) rotate(45deg);
}

.login-dialog__spinner {
  position: absolute;
  top: 50%;
  right: 18px;
  display: none;
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-top-color: #fff;
  border-radius: 50%;
  transform: translateY(-50%);
  animation: login-dialog-spin 700ms linear infinite;
}

.login-dialog__submit.is-loading .login-dialog__submit-icon {
  visibility: hidden;
}

.login-dialog__submit.is-loading .login-dialog__spinner {
  display: inline-block;
}

.login-dialog__support {
  display: grid;
  gap: 4px;
  margin: 22px 0 0;
  padding: 17px 18px;
  border: 1px solid #e0e8ed;
  border-radius: 11px;
  color: #637581;
  background: #f7fafb;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.login-dialog__support strong {
  color: #3f596b;
  font-size: 12px;
}

.login-dialog__development-access {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px dashed #aebfca;
  border-radius: 10px;
  background: #f8fafb;
}

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

.login-dialog__development-access > span {
  color: #758894;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.login-dialog__development-access button {
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid #9eb6c6;
  border-radius: 8px;
  color: #285b7d;
  background: #edf4f8;
  font: 700 11px/1.2 "Source Sans 3", sans-serif;
  cursor: pointer;
}

.login-dialog__development-access button:hover {
  border-color: #729bb4;
  background: #e2eef4;
}

.login-dialog__development-access button:focus-visible {
  outline: 3px solid rgba(57, 125, 168, 0.28);
  outline-offset: 2px;
}

.login-dialog__close:focus-visible,
.login-dialog__password-toggle:focus-visible,
.login-dialog__submit:focus-visible {
  outline: 3px solid rgba(57, 125, 168, 0.28);
  outline-offset: 2px;
}

body.login-dialog-open {
  overflow: hidden;
}

html[data-theme="dark"] .login-dialog__backdrop {
  background: rgba(2, 10, 18, 0.7);
  backdrop-filter: blur(6px) saturate(0.72);
}

html[data-theme="dark"] .login-dialog__panel {
  color: #dce7ee;
  border-color: #3c5264;
  background:
    linear-gradient(180deg, rgba(42, 64, 81, 0.52), rgba(24, 36, 48, 0) 120px),
    #17232e;
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.48),
    0 2px 8px rgba(0, 0, 0, 0.3);
  scrollbar-color: #536b7d transparent;
  color-scheme: dark;
}

html[data-theme="dark"] .login-dialog__panel::before {
  background: linear-gradient(90deg, #3c7da8, #55a0c7 62%, #6ba4bd);
}

html[data-theme="dark"] .login-dialog__close {
  border-color: #455c6e;
  color: #b8cad6;
  background: rgba(33, 49, 63, 0.96);
}

html[data-theme="dark"] .login-dialog__close:hover {
  border-color: #64849a;
  color: #edf6fb;
  background: #293f50;
}

html[data-theme="dark"] .login-dialog__logo-wrap {
  border-color: #49677c;
  background: linear-gradient(145deg, #2a4051, #1d303f);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 7px 16px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .login-dialog__brand strong,
html[data-theme="dark"] .login-dialog__heading h2 {
  color: #edf5fa;
}

html[data-theme="dark"] .login-dialog__brand small,
html[data-theme="dark"] #login-dialog-description {
  color: #aabcc8;
}

html[data-theme="dark"] .login-dialog__eyebrow {
  color: #78b6d8;
}

html[data-theme="dark"] .login-dialog__municipality {
  color: #9bc5dd;
}

html[data-theme="dark"] .login-dialog__separator {
  background: #344958;
}

html[data-theme="dark"] .login-dialog__separator span {
  background: #65a5c8;
}

html[data-theme="dark"] .login-dialog__field label {
  color: #d2e0e8;
}

html[data-theme="dark"] .login-dialog__field input {
  border-color: #496173;
  color: #eef5f9;
  background: #111c25;
}

html[data-theme="dark"] .login-dialog__field input::placeholder {
  color: #788e9e;
}

html[data-theme="dark"] .login-dialog__field input:hover {
  border-color: #638198;
  background: #14222d;
}

html[data-theme="dark"] .login-dialog__field input:focus {
  border-color: #69a9ca;
  background: #14222d;
  box-shadow: 0 0 0 3px rgba(105, 169, 202, 0.18);
}

html[data-theme="dark"] .login-dialog__field-icon {
  color: #86a5b9;
}

html[data-theme="dark"] .login-dialog__control:focus-within .login-dialog__field-icon {
  color: #83c0df;
}

html[data-theme="dark"] .login-dialog__password-toggle {
  color: #9ec6dc;
}

html[data-theme="dark"] .login-dialog__password-toggle:hover {
  color: #d8edf8;
  background: #263b4b;
}

html[data-theme="dark"] .login-dialog__message {
  color: #f0a7a2;
}

html[data-theme="dark"] .login-dialog__submit {
  border-color: #4c8db4;
  background: linear-gradient(135deg, #2b668e, #357fa8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 7px 16px rgba(0, 0, 0, 0.26);
}

html[data-theme="dark"] .login-dialog__submit:hover:not(:disabled) {
  background: linear-gradient(135deg, #34759d, #438db3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 10px 20px rgba(0, 0, 0, 0.32);
}

html[data-theme="dark"] .login-dialog__submit:disabled {
  border-color: #536977;
  color: #b7c6cf;
  background: #465b69;
}

html[data-theme="dark"] .login-dialog__support {
  border-color: #344958;
  color: #96aab7;
  background: #1d2c38;
}

html[data-theme="dark"] .login-dialog__support strong {
  color: #c7d8e2;
}

html[data-theme="dark"] .login-dialog__development-access {
  border-color: #465d6d;
  background: #1a2934;
}

html[data-theme="dark"] .login-dialog__development-access > span {
  color: #8096a4;
}

html[data-theme="dark"] .login-dialog__development-access button {
  border-color: #52748a;
  color: #c7e0ed;
  background: #263c4a;
}

html[data-theme="dark"] .login-dialog__development-access button:hover {
  border-color: #6d96ad;
  background: #2d4656;
}

@keyframes login-dialog-backdrop-in {
  from {
    opacity: 0;
    backdrop-filter: blur(0);
  }
}

@keyframes login-dialog-panel-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.975);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes login-dialog-message-in {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes login-dialog-spin {
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

@media (max-width: 540px) {
  .login-dialog__backdrop {
    align-items: end;
    padding: 10px;
  }

  .login-dialog__panel {
    width: 100%;
    max-height: calc(100dvh - 20px);
    padding: 24px 20px 20px;
    border-radius: 18px;
  }

  .login-dialog__panel::before {
    border-radius: 18px 18px 0 0;
  }

  .login-dialog__logo-wrap {
    flex-basis: 52px;
    width: 52px;
    height: 52px;
  }

  .login-dialog__heading {
    margin-top: 20px;
  }

  .login-dialog__separator {
    margin-block: 18px;
  }

  .login-dialog__support {
    margin-top: 18px;
    padding: 14px;
  }
}

@media (max-height: 680px) and (orientation: landscape) {
  .login-dialog__backdrop {
    align-items: start;
    padding-block: 10px;
  }

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

  .login-dialog__identity {
    gap: 10px;
  }

  .login-dialog__logo-wrap {
    flex-basis: 46px;
    width: 46px;
    height: 46px;
  }

  .login-dialog__heading {
    margin-top: 14px;
  }

  #login-dialog-description {
    margin-top: 9px;
  }

  .login-dialog__separator {
    margin-block: 13px;
  }

  .login-dialog__form {
    gap: 11px;
  }

  .login-dialog__support {
    margin-top: 13px;
    padding: 10px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-dialog__backdrop,
  .login-dialog__panel,
  .login-dialog__spinner {
    animation-duration: 1ms;
    animation-iteration-count: 1;
  }

  .login-dialog__close,
  .login-dialog__field input,
  .login-dialog__field-icon,
  .login-dialog__password-toggle,
  .login-dialog__submit {
    transition: none;
  }

  .login-dialog__message:not(:empty) {
    animation: none;
  }
}
