@font-face {
  font-family: "YOS Sans";
  src: url("/iam/ui/assets/fonts/yos/yos-sans-variable.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "YOS Sans";
  src: url("/iam/ui/assets/fonts/yos/yos-sans-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "YOS Sans";
  src: url("/iam/ui/assets/fonts/yos/yos-sans-semibold.woff2") format("woff2");
  font-weight: 650 760;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ink: #173f74;
  --muted: rgba(23, 63, 116, 0.64);
  --line: rgba(255, 255, 255, 0.74);
  --surface: linear-gradient(145deg, rgba(255, 255, 255, 0.66), rgba(248, 251, 255, 0.46));
  --accent: #1d4f91;
  --accent-strong: #173f74;
  --accent-bright: #245fa8;
  --control-blue: #0071e3;
  --login-background-url: url("/iam/ui/assets/hero-videos/video4.jpg");
  --warn: #8a5a00;
  --danger: #a33b3b;
  --focus: 0 0 0 0.18rem rgba(29, 79, 145, 0.24);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  font-family: "YOS Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #070d18;
  color: #fff;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 44px);
  isolation: isolate;
}

.hero,
.hero-media,
.hero-scrim {
  position: fixed;
  inset: 0;
}

.hero {
  z-index: -2;
  overflow: hidden;
  background: #050a14;
}

.hero-media {
  background-image: image-set(url("/iam/ui/assets/hero-videos/video4.webp") type("image/webp"), url("/iam/ui/assets/hero-videos/video4.jpg") type("image/jpeg"));
  background-position: center;
  background-size: cover;
  transform: scale(1.05);
  filter: saturate(1.08) brightness(0.76);
}

body[data-static-background="true"] .hero-media {
  background-image: var(--login-background-url);
}

body[data-static-background="true"] .hero-video {
  display: none;
}

.hero-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  opacity: 0;
  transform: scale(1.05);
  filter: saturate(1.08) brightness(0.78);
  transition: opacity 900ms cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-video-active {
  opacity: 1;
}

.hero-scrim {
  z-index: 1;
  background:
    radial-gradient(ellipse 82% 72% at 50% 42%, rgba(0, 0, 0, 0.04) 0%, rgba(5, 10, 20, 0.48) 100%),
    linear-gradient(90deg, rgba(4, 9, 18, 0.28), rgba(4, 9, 18, 0.05) 45%, rgba(4, 9, 18, 0.32));
  box-shadow: inset 0 0 140px rgba(0, 0, 0, 0.36);
}

.chrome {
  position: fixed;
  z-index: -1;
  pointer-events: none;
  color: rgba(255, 255, 255, 0.78);
  text-shadow: 0 1px 26px rgba(0, 0, 0, 0.48);
}

.chrome-left {
  left: 24px;
  bottom: 24px;
  font-size: clamp(1.05rem, 2.2vw, 1.55rem);
  font-weight: 360;
  letter-spacing: 0.04em;
}

.chrome-right {
  top: clamp(70px, 13vh, 126px);
  right: clamp(24px, 4vw, 62px);
  display: grid;
  gap: 8px;
  text-align: right;
  letter-spacing: 0.075em;
}

.chrome-right span {
  font-size: clamp(0.8rem, 1.35vw, 1rem);
  font-weight: 300;
  color: rgba(255, 255, 255, 0.58);
}

.chrome-right strong {
  font-size: clamp(1.35rem, 3.2vw, 2.45rem);
  font-weight: 320;
  color: rgba(255, 255, 255, 0.72);
}

.chrome-clock {
  right: clamp(24px, 4vw, 62px);
  bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  color: rgba(255, 255, 255, 0.82);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.chrome-clock span,
.chrome-clock strong {
  display: block;
}

.chrome-clock span {
  order: 2;
  font-size: 12px;
  font-weight: 360;
  color: rgba(255, 255, 255, 0.58);
}

.chrome-clock strong {
  order: 1;
  font-size: clamp(1.35rem, 2.2vw, 1.85rem);
  line-height: 1;
  font-weight: 380;
  color: rgba(255, 255, 255, 0.92);
}

.login-panel {
  position: relative;
  width: min(420px, 100%);
  max-height: calc(100vh - 36px);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 18px;
  box-shadow: 0 30px 90px rgba(5, 12, 30, 0.30), 0 0 0 1px rgba(255, 255, 255, 0.18) inset;
  backdrop-filter: blur(28px) saturate(1.18);
  padding: clamp(20px, 3vw, 28px);
  color: var(--ink);
  animation: panel-enter 980ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.login-panel[data-auth-state="error"] {
  animation: login-shake 260ms cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.login-panel[data-auth-state="success"] {
  animation: login-confirm 760ms cubic-bezier(0.16, 1, 0.3, 1);
}

.brand {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-bottom: 20px;
  text-align: center;
}

.login-logo {
  width: 68px;
  height: auto;
  display: block;
  filter: drop-shadow(0 12px 24px rgba(11, 29, 58, 0.18));
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 520;
}

h1 {
  margin: 0;
  color: #214e86;
  font-size: 28px;
  line-height: 1.1;
  font-weight: 680;
  letter-spacing: 0;
}

.client-name {
  margin: 0 0 3px;
  color: var(--muted);
  line-height: 1.45;
  text-align: center;
}

.policy {
  min-height: 28px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 0 18px;
}

.policy span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(29, 79, 145, 0.14);
  border-radius: 999px;
  padding: 0 10px;
  color: rgba(23, 63, 116, 0.78);
  background: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  font-weight: 760;
}

.providers,
.password-form {
  display: grid;
  gap: 8px;
}

.providers[hidden] {
  display: none;
}

.provider {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(23, 63, 116, 0.10);
  background: rgba(255, 255, 255, 0.52);
  color: var(--ink);
  border-radius: 999px;
  padding: 0 16px;
  text-align: left;
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
  display: grid;
  grid-template-columns: 74px 1fr 74px;
  align-items: center;
  gap: 4px;
  box-shadow: none;
  opacity: 0;
  transform: translateY(16px) scale(0.975);
  filter: blur(7px);
  animation: provider-enter 820ms cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(280ms + var(--provider-index, 0) * 82ms);
  transition: background 280ms cubic-bezier(0.16, 1, 0.3, 1),
    border-color 280ms cubic-bezier(0.16, 1, 0.3, 1),
    color 280ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 280ms cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

.provider:hover {
  border-color: rgba(0, 113, 227, 0.28);
  background: rgba(255, 255, 255, 0.74);
  color: #173f74;
  transform: translateY(-1px) scale(1.004);
  box-shadow: 0 12px 30px rgba(15, 35, 66, 0.09);
}

.provider:active {
  transform: translateY(0) scale(0.996);
}

.provider-disabled {
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.24);
  color: rgba(23, 63, 116, 0.52);
}

.provider-disabled:hover {
  border-color: rgba(29, 79, 145, 0.14);
  color: rgba(23, 63, 116, 0.52);
}

.provider strong,
.provider small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.provider-copy {
  min-width: 0;
  text-align: center;
}

.provider small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 560;
}

.provider small:empty {
  display: none;
}

.provider-choice {
  min-height: 42px;
  margin-top: -2px;
  background: rgba(255, 255, 255, 0.34);
  font-size: 14px;
}

.provider-symbol {
  width: 62px;
  min-width: 62px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  place-items: center;
  justify-self: center;
  gap: 6px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  position: relative;
}

.provider-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
}

.provider-logo img {
  display: block;
  max-width: 28px;
  max-height: 24px;
  object-fit: contain;
}

.provider-logo-local {
  width: 34px;
  height: 34px;
  background: transparent;
  box-shadow: none;
}

.provider-logo-local img {
  width: 28px;
  height: 28px;
  transform: scale(1.55);
  transform-origin: center;
}

.provider-logo-google img,
.provider-logo-microsoft img {
  width: 24px;
  height: 24px;
}

.provider-symbol-spidcie {
  width: 72px;
  min-width: 72px;
  justify-content: center;
  gap: 7px;
}

.provider-logo-spid {
  width: 34px;
}

.provider-logo-spid img {
  max-width: 34px;
  max-height: 18px;
}

.provider-logo-cie {
  width: 27px;
  height: 27px;
  border-radius: 7px;
  background: #0053a2;
  box-shadow: 0 2px 7px rgba(0, 83, 162, 0.20);
}

.provider-logo-cie img {
  max-width: 18px;
  max-height: 20px;
}

.provider-symbol-spid .provider-logo-spid {
  width: 48px;
}

.provider-symbol-spid .provider-logo-spid img {
  max-width: 48px;
  max-height: 24px;
}

.provider-symbol-cie .provider-logo-cie {
  width: 34px;
  height: 34px;
}

.provider::after {
  content: "";
  width: 7px;
  height: 7px;
  justify-self: center;
  border-top: 1.7px solid rgba(23, 63, 116, 0.36);
  border-right: 1.7px solid rgba(23, 63, 116, 0.36);
  transform: rotate(45deg);
  transition: border-color 240ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

.provider:hover::after {
  border-color: rgba(0, 113, 227, 0.7);
  transform: translateX(2px) rotate(45deg);
}

body[data-hide-provider-labels="true"] .provider small {
  display: none;
}

.password-form {
  margin-top: 8px;
  animation: form-reveal 460ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

.field {
  position: relative;
  display: block;
}

.field::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 1;
}

.field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  fill: none;
  stroke: #173f74;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.42;
  transition: opacity 220ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.field:has(input:focus) .field-icon,
.field:has(input:valid) .field-icon {
  opacity: 0.72;
  transform: translateY(-50%) scale(1.03);
}

.field:has(input:valid) input {
  padding-right: 42px;
}

.field:has(input:valid)::after {
  right: 15px;
  left: auto;
  top: 50%;
  width: 14px;
  height: 8px;
  border-left: 2px solid #1f7a4d;
  border-bottom: 2px solid #1f7a4d;
  border-top: 0;
  border-right: 0;
  border-radius: 0;
  opacity: 1;
  transform: translateY(-64%) rotate(-45deg);
}

.password-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 12px;
  padding: 0 42px 0 44px;
  background-color: rgba(255, 255, 255, 0.96);
  color: #1d1d1f;
  font: inherit;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.62) inset;
  caret-color: #0071e3;
}

.password-form input:focus {
  outline: none;
  border-color: rgba(0, 113, 227, 0.72);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.16);
}

.password-form input:-webkit-autofill,
.password-form input:-webkit-autofill:hover,
.password-form input:-webkit-autofill:focus {
  -webkit-text-fill-color: #1d1d1f;
  caret-color: #0071e3;
  box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.96) inset, 0 0 0 3px rgba(0, 113, 227, 0.12);
  transition: background-color 9999s ease-out;
}

.password-form button,
.secondary-action {
  min-height: 44px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 820;
  cursor: pointer;
}

.password-form button {
  position: relative;
  margin-bottom: 10px;
  border: 0;
  background: var(--control-blue);
  color: #fff;
  box-shadow: 0 12px 28px rgba(0, 113, 227, 0.24);
}

.password-form button:hover {
  background: #0077ed;
}

.password-form .change-method {
  min-height: 0;
  margin: 0 0 4px;
  border: 0;
  background: transparent;
  color: rgba(23, 63, 116, 0.72);
  box-shadow: none;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  line-height: 1.35;
  padding: 2px 8px;
  transition: color 220ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.password-form .change-method:hover {
  background: transparent;
  color: #0071e3;
  transform: translateY(-1px);
}

.password-form[aria-busy="true"] button[type="submit"] {
  color: transparent;
  cursor: wait;
}

.password-form[aria-busy="true"] .change-method {
  color: transparent;
}

.password-form[aria-busy="true"] button[type="submit"]::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 28px;
  height: 18px;
  background:
    linear-gradient(#fff, #fff) 2px 8px / 4px 8px no-repeat,
    linear-gradient(#fff, #fff) 12px 4px / 4px 14px no-repeat,
    linear-gradient(#fff, #fff) 22px 7px / 4px 10px no-repeat;
  border-radius: 999px;
  animation: equalizer-soft 920ms cubic-bezier(0.42, 0, 0.22, 1) infinite;
}

.credential-header {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  color: var(--ink);
  text-align: center;
  animation: credential-enter 460ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.credential-header[hidden] {
  display: none;
}

.credential-header strong {
  min-width: 0;
  max-width: min(280px, 92%);
  color: #173f74;
  font-size: 15px;
  font-weight: 760;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.activity {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(1.01);
  overflow: hidden;
  border-radius: inherit;
  background:
    radial-gradient(ellipse 70% 48% at 50% 38%, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.025) 56%, rgba(4, 9, 18, 0.28) 100%),
    rgba(5, 10, 18, 0.20);
  backdrop-filter: blur(18px) saturate(1.18) contrast(0.92);
  transition: opacity 320ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 320ms cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.activity::before {
  content: "";
  position: absolute;
  inset: -18%;
  background:
    linear-gradient(115deg, transparent 0 28%, rgba(255, 255, 255, 0.16) 36%, transparent 46% 100%),
    radial-gradient(circle at 26% 24%, rgba(255, 255, 255, 0.16), transparent 24%),
    radial-gradient(circle at 76% 72%, rgba(255, 255, 255, 0.10), transparent 28%);
  filter: blur(18px);
  opacity: 0.42;
  transform: translate3d(-2%, 1%, 0) rotate(-5deg) scale(1.04);
  animation: glass-drift 6200ms cubic-bezier(0.45, 0, 0.2, 1) infinite alternate;
}

.activity::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(96deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 12px),
    radial-gradient(ellipse 46% 18% at 50% 48%, rgba(255, 255, 255, 0.09), transparent 70%);
  mix-blend-mode: screen;
  opacity: 0.34;
  transform: skewX(-6deg);
}

.activity-mark {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.42);
  box-shadow: 0 20px 50px rgba(15, 35, 66, 0.13), 0 0 0 1px rgba(255, 255, 255, 0.48) inset;
  transform: translateY(8px) scale(0.96);
  transition: transform 420ms cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  z-index: 1;
}

.activity span {
  width: 3px;
  height: 12px;
  border-radius: 999px;
  background: rgba(23, 63, 116, 0.52);
  transform-origin: center;
  animation: equalizer-bar 980ms cubic-bezier(0.42, 0, 0.22, 1) infinite;
}

.activity i {
  display: none;
}

.activity span:nth-child(2) {
  animation-delay: 110ms;
}

.activity span:nth-child(3) {
  animation-delay: 220ms;
}

.activity span:nth-child(4) {
  animation-delay: 330ms;
}

body[data-busy="true"] .activity {
  opacity: 1;
  transform: scale(1);
}

body[data-busy="true"] .activity-mark,
body[data-auth-state="success"] .activity-mark {
  transform: translateY(0) scale(1);
}

body[data-auth-state="success"] .activity {
  opacity: 1;
  transform: scale(1);
  background:
    radial-gradient(ellipse 70% 48% at 50% 38%, rgba(232, 255, 244, 0.14), rgba(255, 255, 255, 0.025) 56%, rgba(4, 18, 11, 0.30) 100%),
    rgba(5, 18, 12, 0.24);
}

body[data-auth-state="success"] .activity span {
  display: none;
}

body[data-auth-state="success"] .activity i {
  width: 24px;
  height: 14px;
  display: block;
  border-left: 3px solid #1f7a4d;
  border-bottom: 3px solid #1f7a4d;
  transform: translateY(-2px) rotate(-45deg) scale(0.7);
  transform-origin: center;
  animation: success-check 540ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

body[data-auth-state="success"] .activity-mark {
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 22px 54px rgba(31, 122, 77, 0.16), 0 0 0 1px rgba(31, 122, 77, 0.16) inset;
}

.secondary-action {
  width: 100%;
  margin-top: 12px;
  border: 1px dashed rgba(29, 79, 145, 0.28);
  background: rgba(255, 255, 255, 0.42);
  color: rgba(23, 63, 116, 0.76);
}

.logout-action {
  border-style: solid;
}

.help-text,
.footer-text {
  margin: 14px 0 0;
  color: rgba(23, 63, 116, 0.66);
  font-size: 13px;
  line-height: 1.42;
  text-align: center;
  overflow-wrap: anywhere;
}

.footer-text {
  margin-top: 10px;
  font-size: 12px;
  color: rgba(23, 63, 116, 0.52);
}

.help-text:empty,
.footer-text:empty {
  display: none;
}

.message {
  min-height: 20px;
  margin: 18px 0 0;
  color: rgba(23, 63, 116, 0.68);
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  overflow-wrap: anywhere;
  position: relative;
}

.message:empty {
  min-height: 0;
  margin-top: 0;
}

.message[data-tone="error"] {
  color: var(--danger);
}

.message[data-tone="warn"] {
  color: var(--warn);
}

.message[data-tone="success"] {
  color: #1f7a4d;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.message[data-tone="success"]::before {
  content: "✓";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #1f7a4d;
  box-shadow: 0 8px 18px rgba(31, 122, 77, 0.20);
  color: #fff;
  display: inline-grid;
  place-items: center;
  font-size: 12px;
  line-height: 1;
}

@media (max-width: 680px) {
  body {
    overflow: auto;
  }

  .shell {
    align-items: center;
    padding: 78px 14px 20px;
  }

  .login-panel {
    width: 100%;
    max-height: none;
    border-radius: 14px;
    padding: 21px 22px;
  }

  .chrome-right {
    display: none;
  }

  .chrome-clock {
    display: none;
  }

  .chrome-left {
    left: 18px;
    bottom: auto;
    top: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-video {
    display: none;
  }

  .hero-media {
    transform: none;
  }

  .login-panel,
  .provider,
  .password-form,
  .password-form[aria-busy="true"] button::after,
  .activity span,
  .activity i,
  .credential-header {
    animation: none;
  }
}

@keyframes panel-enter {
  from {
    opacity: 0;
    transform: translateY(32px) scale(0.965);
    filter: blur(14px);
  }
  58% {
    opacity: 1;
    filter: blur(1px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes provider-enter {
  60% {
    filter: blur(0);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes form-reveal {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes credential-enter {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes login-shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-7px);
  }
  50% {
    transform: translateX(6px);
  }
  75% {
    transform: translateX(-3px);
  }
}

@keyframes login-confirm {
  0% {
    box-shadow: 0 28px 82px rgba(5, 12, 30, 0.34), 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  }
  45% {
    box-shadow: 0 28px 82px rgba(5, 12, 30, 0.34), 0 0 0 3px rgba(34, 139, 92, 0.22) inset;
  }
  100% {
    box-shadow: 0 28px 82px rgba(5, 12, 30, 0.34), 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  }
}

@keyframes equalizer-bar {
  0%, 100% {
    transform: scaleY(0.72);
    opacity: 0.52;
  }
  45% {
    transform: scaleY(1.55);
    opacity: 0.86;
  }
}

@keyframes success-check {
  0% {
    opacity: 0;
    transform: translateY(4px) rotate(-45deg) scale(0.54);
  }
  55% {
    opacity: 1;
    transform: translateY(-2px) rotate(-45deg) scale(1.08);
  }
  100% {
    opacity: 1;
    transform: translateY(-2px) rotate(-45deg) scale(1);
  }
}

@keyframes equalizer-soft {
  0%, 100% {
    filter: opacity(0.72);
    transform: translateY(0);
  }
  50% {
    filter: opacity(1);
    transform: translateY(-1px);
  }
}

@keyframes glass-drift {
  from {
    transform: translate3d(-2%, 1%, 0) rotate(-5deg) scale(1.04);
  }
  to {
    transform: translate3d(2%, -1%, 0) rotate(4deg) scale(1.08);
  }
}

.account-panel{max-height:90dvh;overflow-y:auto}.account-panel h2{font-size:1rem;margin:1.5rem 0 .75rem}.factor-row{display:flex;align-items:center;gap:1rem}.account-panel code,.account-panel pre{white-space:pre-wrap;overflow-wrap:anywhere}.account-panel #qr{width:200px;max-width:100%}.account-panel .secondary-action{margin-top:.75rem}

/* Collegamenti che si comportano da pulsanti, e pagine semplici senza pannello. */
.primary-action,
.link-action {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.primary-action {
  min-height: 44px;
  margin-top: 18px;
  border-radius: 999px;
  background: var(--control-blue);
  color: #fff;
  font-size: 15px;
  font-weight: 820;
}
.account-panel .message:not(:empty) {
  margin: 0 0 8px;
}
body.plain {
  overflow: auto;
  background: #f4f6f8;
  color: #20354a;
  font-size: 16px;
  line-height: 1.5;
}
body.plain main {
  max-width: 600px;
  margin: 8vh auto;
  padding: 28px;
  border-radius: 12px;
  background: #fff;
}
body.plain h1 {
  color: var(--accent);
  font-weight: 550;
}
body.plain label {
  display: block;
  margin: 12px 0;
  padding: 16px;
  border: 1px solid #d4dfe8;
  border-radius: 8px;
  cursor: pointer;
}
body.plain input {
  margin-right: 10px;
}
body.plain small {
  display: block;
  margin-left: 28px;
  color: #52657a;
}
body.plain button {
  padding: 12px 20px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  cursor: pointer;
}
@media (max-width: 640px) {
  body.plain main {
    margin: 16px;
    padding: 20px;
  }
}

/*
 * Temi. Il tema è scritto dal server su <html data-theme>, quindi la pagina nasce già
 * con l'aspetto giusto. "video" è l'aspetto di base, qui sopra; gli altri due lo
 * ridefiniscono. Il colore principale configurato arriva in --accent.
 */

/* ---- Tema "minimal": fondo pieno, pannello netto, chiaro o scuro secondo il sistema. */
html[data-theme="minimal"],
html:is([data-theme="split"], [data-theme="image"]) {
  color-scheme: light;
  --page: #f5f5f7;
  --panel: #ffffff;
  --panel-border: #e8e8ed;
  --text: #1d1d1f;
  --text-soft: #6e6e73;
  --control: #ffffff;
  --control-border: #d2d2d7;
  --control-hover: #f5f5f7;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.06);
}
/* Scuro: scelto dalla configurazione (data-mode="dark") oppure, in "auto", dal sistema
   di chi guarda. I due blocchi devono restare identici. */
html[data-theme="minimal"][data-mode="dark"],
html:is([data-theme="split"], [data-theme="image"])[data-mode="dark"] {
  color-scheme: dark;
  --page: #000000;
  --panel: #1c1c1e;
  --panel-border: #2f2f32;
  --text: #f5f5f7;
  --text-soft: #a1a1a6;
  --control: #2c2c2e;
  --control-border: #3a3a3c;
  --control-hover: #3a3a3c;
  --shadow: none;
}
@media (prefers-color-scheme: dark) {
  html[data-theme="minimal"][data-mode="auto"],
  html:is([data-theme="split"], [data-theme="image"])[data-mode="auto"] {
    color-scheme: dark;
    --page: #000000;
    --panel: #1c1c1e;
    --panel-border: #2f2f32;
    --text: #f5f5f7;
    --text-soft: #a1a1a6;
    --control: #2c2c2e;
    --control-border: #3a3a3c;
    --control-hover: #3a3a3c;
    --shadow: none;
  }
}
html[data-theme="minimal"] body,
html:is([data-theme="split"], [data-theme="image"]) body {
  overflow: auto;
  background: var(--page);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
html[data-theme="minimal"] .hero,
html[data-theme="minimal"] .chrome-right,
html[data-theme="minimal"] .chrome-clock {
  display: none;
}
html[data-theme="minimal"] .chrome-left {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 22px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  text-align: center;
  text-shadow: none;
}
html[data-theme="minimal"] .login-panel,
html:is([data-theme="split"], [data-theme="image"]) .login-panel {
  width: min(400px, 100%);
  max-height: none;
  padding: 36px 32px 28px;
  border: 1px solid var(--panel-border);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: none;
  color: var(--text);
  animation-duration: 420ms;
}
html[data-theme="minimal"] .login-logo,
html:is([data-theme="split"], [data-theme="image"]) .login-logo {
  width: 52px;
  filter: none;
}
html[data-theme="minimal"] h1,
html:is([data-theme="split"], [data-theme="image"]) h1 {
  color: var(--text);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
html[data-theme="minimal"] .eyebrow,
html[data-theme="minimal"] .client-name,
html[data-theme="minimal"] .help-text,
html[data-theme="minimal"] .footer-text,
html[data-theme="minimal"] .message,
html:is([data-theme="split"], [data-theme="image"]) .eyebrow,
html:is([data-theme="split"], [data-theme="image"]) .client-name,
html:is([data-theme="split"], [data-theme="image"]) .help-text,
html:is([data-theme="split"], [data-theme="image"]) .footer-text,
html:is([data-theme="split"], [data-theme="image"]) .message {
  color: var(--text-soft);
}
html[data-theme="minimal"] .message[data-tone="error"],
html:is([data-theme="split"], [data-theme="image"]) .message[data-tone="error"] {
  color: #e0453c;
}
html[data-theme="minimal"] .provider,
html:is([data-theme="split"], [data-theme="image"]) .provider {
  border: 1px solid var(--control-border);
  border-radius: 12px;
  background: var(--control);
  color: var(--text);
  font-weight: 500;
  filter: none;
  animation-duration: 360ms;
  animation-delay: calc(var(--provider-index, 0) * 40ms);
}
html[data-theme="minimal"] .provider:hover,
html:is([data-theme="split"], [data-theme="image"]) .provider:hover {
  border-color: var(--accent);
  background: var(--control-hover);
  color: var(--text);
  box-shadow: none;
  transform: none;
}
html[data-theme="minimal"] .provider small,
html:is([data-theme="split"], [data-theme="image"]) .provider small {
  color: var(--text-soft);
}
html[data-theme="minimal"] .password-form input,
html:is([data-theme="split"], [data-theme="image"]) .password-form input {
  border-color: var(--control-border);
  background-color: var(--control);
  color: var(--text);
  box-shadow: none;
  caret-color: var(--accent);
}
html[data-theme="minimal"] .password-form input:focus,
html:is([data-theme="split"], [data-theme="image"]) .password-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
html[data-theme="minimal"] .field-icon,
html:is([data-theme="split"], [data-theme="image"]) .field-icon {
  stroke: var(--text-soft);
}
html[data-theme="minimal"] .password-form button[type="submit"],
html[data-theme="minimal"] .password-form button:not([type]),
html[data-theme="minimal"] .primary-action,
html:is([data-theme="split"], [data-theme="image"]) .password-form button[type="submit"],
html:is([data-theme="split"], [data-theme="image"]) .password-form button:not([type]),
html:is([data-theme="split"], [data-theme="image"]) .primary-action {
  border-radius: 12px;
  background: var(--accent);
  box-shadow: none;
  font-weight: 600;
}
html[data-theme="minimal"] .password-form button[type="submit"]:hover,
html:is([data-theme="split"], [data-theme="image"]) .password-form button[type="submit"]:hover {
  background: color-mix(in srgb, var(--accent) 88%, #fff);
}
html[data-theme="minimal"] .password-form .change-method,
html:is([data-theme="split"], [data-theme="image"]) .password-form .change-method {
  color: var(--text-soft);
  font-weight: 500;
}
html[data-theme="minimal"] .password-form .change-method:hover,
html:is([data-theme="split"], [data-theme="image"]) .password-form .change-method:hover {
  color: var(--accent);
}
html[data-theme="minimal"] .secondary-action,
html:is([data-theme="split"], [data-theme="image"]) .secondary-action {
  border: 1px solid var(--control-border);
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font-weight: 500;
}
html[data-theme="minimal"] .credential-header strong,
html:is([data-theme="split"], [data-theme="image"]) .credential-header strong {
  color: var(--text);
}
html[data-theme="minimal"] .account-panel h2,
html:is([data-theme="split"], [data-theme="image"]) .account-panel h2 {
  color: var(--text);
}

/* ---- Tema "split": a sinistra il nome su un fondo del colore principale, a destra l'accesso. */
html:is([data-theme="split"], [data-theme="image"]) .shell {
  justify-items: end;
  padding-right: clamp(18px, 9vw, 150px);
}
html:is([data-theme="split"], [data-theme="image"]) .hero {
  right: 50%;
  z-index: 0;
  background:
    radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--accent) 70%, #fff) 0%, transparent 60%),
    linear-gradient(160deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #000));
}
html:is([data-theme="split"], [data-theme="image"]) .hero-media,
html:is([data-theme="split"], [data-theme="image"]) .hero-video,
html:is([data-theme="split"], [data-theme="image"]) .hero-scrim,
html:is([data-theme="split"], [data-theme="image"]) .chrome-clock {
  display: none;
}
html:is([data-theme="split"], [data-theme="image"]) .chrome {
  z-index: 1;
  color: #fff;
  text-shadow: none;
}
html:is([data-theme="split"], [data-theme="image"]) .chrome-right {
  top: auto;
  right: auto;
  left: clamp(28px, 6vw, 88px);
  bottom: 50%;
  text-align: left;
  letter-spacing: 0;
}
html:is([data-theme="split"], [data-theme="image"]) .chrome-right span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 15px;
  font-weight: 500;
}
html:is([data-theme="split"], [data-theme="image"]) .chrome-right strong {
  color: #fff;
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
html:is([data-theme="split"], [data-theme="image"]) .chrome-left {
  left: clamp(28px, 6vw, 88px);
  bottom: 32px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
}
@media (max-width: 860px) {
  html:is([data-theme="split"], [data-theme="image"]) .shell {
    justify-items: center;
    padding: 132px 14px 20px;
    align-items: start;
  }
  html:is([data-theme="split"], [data-theme="image"]) .hero {
    right: 0;
    bottom: auto;
    height: 112px;
  }
  html:is([data-theme="split"], [data-theme="image"]) .chrome-right {
    display: grid;
    top: 28px;
    bottom: auto;
    left: 20px;
  }
  html:is([data-theme="split"], [data-theme="image"]) .chrome-right strong {
    font-size: 1.6rem;
  }
  html:is([data-theme="split"], [data-theme="image"]) .chrome-right span,
  html:is([data-theme="split"], [data-theme="image"]) .chrome-left {
    display: none;
  }
}
@media (max-width: 680px) {
  html[data-theme="minimal"] .shell {
    padding: 24px 14px 56px;
  }
  html[data-theme="minimal"] .chrome-left {
    top: auto;
  }
  html[data-theme="minimal"] .login-panel,
  html:is([data-theme="split"], [data-theme="image"]) .login-panel {
    padding: 28px 22px 22px;
  }
}

/* ---- Tema "image": le due colonne, con la fotografia al posto del colore a sinistra. */
html[data-theme="image"] .hero {
  background: #0b0d12;
}
html[data-theme="image"] .hero-media,
html[data-theme="image"] .hero-scrim {
  display: block;
  position: absolute;
  inset: 0;
}
html[data-theme="image"] .hero-media {
  background-image: var(--login-background-url);
  transform: none;
  filter: none;
}
html[data-theme="image"] .hero-scrim {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 30%, rgba(0, 0, 0, 0.62) 100%);
  box-shadow: none;
}
html[data-theme="image"] .chrome-right {
  bottom: 72px;
}

/* ---- Tema "photo": come il filmato, ma con una fotografia ferma; pannello al centro. */
html[data-theme="photo"] .hero-video {
  display: none;
}
html[data-theme="photo"] .hero-media {
  background-image: var(--login-background-url);
}

/*
 * ---- Tema "aurora": luce colorata che si muove lenta dietro un pannello in vetro.
 * I colori nascono dal colore principale; il resto è neutro. Chiaro o scuro come gli
 * altri temi a superficie piena.
 */
html[data-theme="aurora"] {
  color-scheme: light;
  --au-page: #f4f5fa;
  --au-text: #1d1d1f;
  --au-soft: #6e6e73;
  --au-glass: rgba(255, 255, 255, 0.58);
  --au-glass-edge: rgba(255, 255, 255, 0.9);
  --au-field: rgba(255, 255, 255, 0.72);
  --au-field-edge: rgba(0, 0, 0, 0.09);
  --au-field-hover: rgba(255, 255, 255, 0.95);
  --au-light: 0.5;
  --au-shadow: 0 40px 100px rgba(40, 52, 90, 0.18);
  --au-vignette: transparent;
}
html[data-theme="aurora"][data-mode="dark"] {
  color-scheme: dark;
  --au-page: #05060b;
  --au-text: #f5f5f7;
  --au-soft: rgba(245, 245, 247, 0.62);
  --au-glass: rgba(255, 255, 255, 0.07);
  --au-glass-edge: rgba(255, 255, 255, 0.16);
  --au-field: rgba(255, 255, 255, 0.07);
  --au-field-edge: rgba(255, 255, 255, 0.14);
  --au-field-hover: rgba(255, 255, 255, 0.12);
  --au-light: 0.72;
  --au-shadow: 0 50px 140px rgba(0, 0, 0, 0.55);
  --au-vignette: rgba(0, 0, 0, 0.55);
}
@media (prefers-color-scheme: dark) {
  html[data-theme="aurora"][data-mode="auto"] {
    color-scheme: dark;
    --au-page: #05060b;
    --au-text: #f5f5f7;
    --au-soft: rgba(245, 245, 247, 0.62);
    --au-glass: rgba(255, 255, 255, 0.07);
    --au-glass-edge: rgba(255, 255, 255, 0.16);
    --au-field: rgba(255, 255, 255, 0.07);
    --au-field-edge: rgba(255, 255, 255, 0.14);
    --au-field-hover: rgba(255, 255, 255, 0.12);
    --au-light: 0.72;
    --au-shadow: 0 50px 140px rgba(0, 0, 0, 0.55);
    --au-vignette: rgba(0, 0, 0, 0.55);
  }
}
html[data-theme="aurora"] body {
  overflow: auto;
  background: var(--au-page);
  color: var(--au-text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
}
/* Tre luci sfocate: il colore principale e due sue variazioni, una calda e una fredda. */
html[data-theme="aurora"] .hero {
  background: var(--au-page);
}
html[data-theme="aurora"] .hero-video {
  display: none;
}
html[data-theme="aurora"] .hero::before,
html[data-theme="aurora"] .hero::after,
html[data-theme="aurora"] .hero-media {
  content: "";
  position: absolute;
  inset: auto;
  width: 62vmax;
  height: 62vmax;
  border-radius: 50%;
  background-image: none;
  filter: blur(90px) saturate(1.35);
  opacity: var(--au-light);
  transform: none;
  will-change: transform;
}
html[data-theme="aurora"] .hero::before {
  top: -22vmax;
  left: -14vmax;
  background: radial-gradient(circle at 40% 40%, var(--accent), transparent 68%);
  animation: aurora-a 26s ease-in-out infinite alternate;
}
html[data-theme="aurora"] .hero::after {
  right: -20vmax;
  bottom: -26vmax;
  background: radial-gradient(circle at 50% 50%, color-mix(in oklab, var(--accent) 45%, #ff4fa3), transparent 66%);
  animation: aurora-b 32s ease-in-out infinite alternate;
}
html[data-theme="aurora"] .hero-media {
  top: 18vmax;
  left: 34vmax;
  width: 46vmax;
  height: 46vmax;
  background: radial-gradient(circle at 50% 50%, color-mix(in oklab, var(--accent) 40%, #38e8ff), transparent 64%);
  animation: aurora-c 38s ease-in-out infinite alternate;
}
html[data-theme="aurora"] .hero-scrim {
  background: radial-gradient(ellipse 90% 80% at 50% 45%, transparent 40%, var(--au-vignette) 100%);
  box-shadow: none;
}
/* Il nome in alto a sinistra, come un marchio; la riga di servizio in basso al centro. */
html[data-theme="aurora"] .chrome {
  z-index: 1;
  color: var(--au-text);
  text-shadow: none;
}
html[data-theme="aurora"] .chrome-clock {
  display: none;
}
html[data-theme="aurora"] .chrome-right {
  top: 30px;
  right: auto;
  left: 36px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-align: left;
  letter-spacing: 0;
}
html[data-theme="aurora"] .chrome-right strong {
  order: 1;
  color: var(--au-text);
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
html[data-theme="aurora"] .chrome-right span {
  order: 2;
  color: var(--au-soft);
  font-size: 13px;
  font-weight: 400;
}
html[data-theme="aurora"] .chrome-left {
  left: 0;
  right: 0;
  bottom: 26px;
  color: var(--au-soft);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-align: center;
}
/* Il pannello: vetro spesso, bordo di luce, molto respiro. */
html[data-theme="aurora"] .login-panel {
  width: min(440px, 100%);
  max-height: none;
  padding: 48px 40px 36px;
  border: 1px solid var(--au-glass-edge);
  border-radius: 34px;
  background: var(--au-glass);
  box-shadow:
    var(--au-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(44px) saturate(1.8);
  color: var(--au-text);
  animation: aurora-panel 900ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
html[data-theme="aurora"] .brand {
  gap: 18px;
  margin-bottom: 30px;
}
html[data-theme="aurora"] .login-logo {
  width: 60px;
  border-radius: 16px;
  filter: drop-shadow(0 14px 30px color-mix(in srgb, var(--accent) 38%, transparent));
}
html[data-theme="aurora"] .eyebrow {
  margin-bottom: 8px;
  color: var(--au-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
html[data-theme="aurora"] h1 {
  color: var(--au-text);
  font-size: 36px;
  font-weight: 680;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
html[data-theme="aurora"] .client-name,
html[data-theme="aurora"] .help-text,
html[data-theme="aurora"] .footer-text,
html[data-theme="aurora"] .message {
  color: var(--au-soft);
}
html[data-theme="aurora"] .message[data-tone="error"] {
  color: #ff6b61;
}
html[data-theme="aurora"] .providers,
html[data-theme="aurora"] .password-form {
  gap: 12px;
}
html[data-theme="aurora"] .provider {
  min-height: 54px;
  border: 1px solid var(--au-field-edge);
  border-radius: 18px;
  background: var(--au-field);
  color: var(--au-text);
  font-size: 16px;
  font-weight: 560;
}
html[data-theme="aurora"] .provider:hover {
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  background: var(--au-field-hover);
  color: var(--au-text);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
  transform: translateY(-1px);
}
html[data-theme="aurora"] .provider small {
  color: var(--au-soft);
}
html[data-theme="aurora"] .credential-header strong,
html[data-theme="aurora"] .account-panel h2 {
  color: var(--au-text);
}
html[data-theme="aurora"] .password-form input {
  min-height: 54px;
  border: 1px solid var(--au-field-edge);
  border-radius: 18px;
  background-color: var(--au-field);
  color: var(--au-text);
  font-size: 16px;
  box-shadow: none;
  caret-color: var(--accent);
}
html[data-theme="aurora"] .password-form input::placeholder {
  color: var(--au-soft);
}
html[data-theme="aurora"] .password-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 26%, transparent);
}
html[data-theme="aurora"] .password-form input:-webkit-autofill,
html[data-theme="aurora"] .password-form input:-webkit-autofill:hover,
html[data-theme="aurora"] .password-form input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--au-text);
  box-shadow: 0 0 0 1000px var(--au-page) inset;
}
html[data-theme="aurora"] .field-icon {
  stroke: var(--au-soft);
}
html[data-theme="aurora"] .password-form button[type="submit"],
html[data-theme="aurora"] .password-form button:not([type]),
html[data-theme="aurora"] .primary-action {
  min-height: 54px;
  margin-top: 6px;
  border-radius: 18px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 86%, #fff), var(--accent));
  box-shadow:
    0 14px 34px color-mix(in srgb, var(--accent) 42%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.38);
  color: #fff;
  font-size: 16px;
  font-weight: 620;
  letter-spacing: -0.005em;
  transition:
    transform 220ms cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
html[data-theme="aurora"] .password-form button[type="submit"]:hover,
html[data-theme="aurora"] .primary-action:hover {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 78%, #fff), var(--accent));
  transform: translateY(-1px);
  box-shadow:
    0 18px 44px color-mix(in srgb, var(--accent) 52%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.38);
}
html[data-theme="aurora"] .password-form button[type="submit"]:active {
  transform: translateY(0) scale(0.99);
}
html[data-theme="aurora"] .password-form .change-method {
  color: var(--au-soft);
  font-weight: 500;
}
html[data-theme="aurora"] .password-form .change-method:hover {
  color: var(--au-text);
}
html[data-theme="aurora"] .secondary-action {
  border: 1px solid var(--au-field-edge);
  border-radius: 18px;
  background: transparent;
  color: var(--au-text);
  font-weight: 560;
}
@keyframes aurora-a {
  to {
    transform: translate3d(16vmax, 12vmax, 0) scale(1.15);
  }
}
@keyframes aurora-b {
  to {
    transform: translate3d(-18vmax, -10vmax, 0) scale(0.9);
  }
}
@keyframes aurora-c {
  to {
    transform: translate3d(-22vmax, 8vmax, 0) scale(1.2);
  }
}
@keyframes aurora-panel {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.975);
    filter: blur(10px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}
@media (max-width: 680px) {
  html[data-theme="aurora"] .shell {
    padding: 84px 14px 60px;
  }
  html[data-theme="aurora"] .login-panel {
    padding: 36px 24px 26px;
    border-radius: 28px;
  }
  html[data-theme="aurora"] .chrome-right {
    display: flex;
    top: 24px;
    left: 22px;
  }
  html[data-theme="aurora"] .chrome-left {
    top: auto;
  }
  html[data-theme="aurora"] h1 {
    font-size: 30px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html[data-theme="aurora"] .hero::before,
  html[data-theme="aurora"] .hero::after,
  html[data-theme="aurora"] .hero-media {
    animation: none;
  }
}

/*
 * ---- Tema "editorial": nessun pannello. Il nome è il titolo della pagina, il modulo
 * sta sulla carta con campi a sola linea. Un solo colore oltre al bianco e nero.
 */
html[data-theme="editorial"] {
  color-scheme: light;
  --ed-page: #fbfaf7;
  --ed-text: #111111;
  --ed-soft: #6b6b6b;
  --ed-line: rgba(17, 17, 17, 0.2);
  --ed-serif: "New York", "Iowan Old Style", "Palatino Linotype", Georgia, ui-serif, serif;
}
html[data-theme="editorial"][data-mode="dark"] {
  color-scheme: dark;
  --ed-page: #0c0c0d;
  --ed-text: #f3f2ee;
  --ed-soft: #9b9a96;
  --ed-line: rgba(243, 242, 238, 0.24);
}
@media (prefers-color-scheme: dark) {
  html[data-theme="editorial"][data-mode="auto"] {
    color-scheme: dark;
    --ed-page: #0c0c0d;
    --ed-text: #f3f2ee;
    --ed-soft: #9b9a96;
    --ed-line: rgba(243, 242, 238, 0.24);
  }
}
html[data-theme="editorial"] body {
  overflow: auto;
  background: var(--ed-page);
  color: var(--ed-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
html[data-theme="editorial"] .hero,
html[data-theme="editorial"] .chrome-clock {
  display: none;
}
html[data-theme="editorial"] .chrome {
  color: var(--ed-text);
  text-shadow: none;
}
/* Il nome: grande quanto mezza pagina, in basso a sinistra. */
html[data-theme="editorial"] .chrome-right {
  top: auto;
  right: auto;
  left: clamp(28px, 6vw, 96px);
  bottom: clamp(36px, 9vh, 110px);
  max-width: 58vw;
  gap: 18px;
  text-align: left;
  letter-spacing: 0;
}
html[data-theme="editorial"] .chrome-right span {
  color: var(--ed-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
html[data-theme="editorial"] .chrome-right strong {
  color: var(--ed-text);
  font-family: var(--ed-serif);
  font-size: clamp(3.4rem, 10.5vw, 9.5rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 0.9;
  overflow-wrap: anywhere;
}
/* Una riga di testata in alto, con il filo sotto. */
html[data-theme="editorial"] .chrome-left {
  top: 30px;
  right: clamp(28px, 6vw, 96px);
  bottom: auto;
  left: clamp(28px, 6vw, 96px);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ed-line);
  color: var(--ed-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
html[data-theme="editorial"] .chrome-left:has(span:empty) {
  display: none;
}
html[data-theme="editorial"] .shell {
  justify-items: end;
  padding-right: clamp(28px, 9vw, 150px);
}
html[data-theme="editorial"] .login-panel {
  width: min(360px, 100%);
  max-height: none;
  overflow: visible;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  backdrop-filter: none;
  color: var(--ed-text);
  animation-duration: 520ms;
}
html[data-theme="editorial"] .brand {
  justify-items: start;
  gap: 16px;
  margin-bottom: 28px;
  text-align: left;
}
html[data-theme="editorial"] .login-logo {
  width: 40px;
  filter: none;
}
html[data-theme="editorial"] .eyebrow {
  margin-bottom: 8px;
  color: var(--ed-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
html[data-theme="editorial"] h1 {
  color: var(--ed-text);
  font-family: var(--ed-serif);
  font-size: 42px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
}
html[data-theme="editorial"] .client-name,
html[data-theme="editorial"] .help-text,
html[data-theme="editorial"] .footer-text,
html[data-theme="editorial"] .message {
  color: var(--ed-soft);
  text-align: left;
}
html[data-theme="editorial"] .message[data-tone="error"] {
  color: #d5352c;
}
html[data-theme="editorial"] .message[data-tone="success"] {
  justify-content: flex-start;
}
html[data-theme="editorial"] .policy {
  justify-content: flex-start;
}
html[data-theme="editorial"] .providers,
html[data-theme="editorial"] .password-form {
  gap: 0;
}
/* Ogni metodo di accesso è una riga con il filo sotto, come una voce d'indice. */
html[data-theme="editorial"] .provider {
  min-height: 58px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--ed-line);
  border-radius: 0;
  background: none;
  color: var(--ed-text);
  font-size: 17px;
  font-weight: 500;
  grid-template-columns: 44px 1fr 24px;
  filter: none;
  animation-duration: 420ms;
  animation-delay: calc(var(--provider-index, 0) * 50ms);
}
html[data-theme="editorial"] .provider:first-child {
  border-top: 1px solid var(--ed-line);
}
html[data-theme="editorial"] .provider:hover {
  border-color: var(--accent);
  background: none;
  color: var(--accent);
  box-shadow: none;
  transform: none;
}
html[data-theme="editorial"] .provider small {
  color: var(--ed-soft);
}
html[data-theme="editorial"] .credential-header {
  justify-content: flex-start;
}
html[data-theme="editorial"] .credential-header strong {
  color: var(--ed-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
html[data-theme="editorial"] .password-form input {
  min-height: 56px;
  padding: 0 34px 0 32px;
  border: 0;
  border-bottom: 1px solid var(--ed-line);
  border-radius: 0;
  background: none;
  color: var(--ed-text);
  font-size: 17px;
  box-shadow: none;
  caret-color: var(--accent);
}
html[data-theme="editorial"] .password-form input::placeholder {
  color: var(--ed-soft);
}
html[data-theme="editorial"] .password-form input:focus {
  border-bottom-color: var(--accent);
  box-shadow: 0 1px 0 var(--accent);
}
html[data-theme="editorial"] .password-form input:-webkit-autofill,
html[data-theme="editorial"] .password-form input:-webkit-autofill:hover,
html[data-theme="editorial"] .password-form input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ed-text);
  box-shadow: 0 0 0 1000px var(--ed-page) inset;
}
html[data-theme="editorial"] .field-icon {
  left: 2px;
  stroke: var(--ed-soft);
}
html[data-theme="editorial"] .password-form button[type="submit"],
html[data-theme="editorial"] .password-form button:not([type]),
html[data-theme="editorial"] .primary-action {
  min-height: 56px;
  margin-top: 28px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: none;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
html[data-theme="editorial"] .password-form button[type="submit"]:hover,
html[data-theme="editorial"] .primary-action:hover {
  background: color-mix(in srgb, var(--accent) 86%, #000);
}
html[data-theme="editorial"] .password-form .change-method {
  padding: 2px 0;
  color: var(--ed-soft);
  font-weight: 500;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 4px;
}
html[data-theme="editorial"] .password-form .change-method:hover {
  color: var(--ed-text);
  transform: none;
}
html[data-theme="editorial"] .secondary-action {
  border: 1px solid var(--ed-line);
  border-radius: 2px;
  background: none;
  color: var(--ed-text);
  font-weight: 500;
}
html[data-theme="editorial"] .account-panel h2 {
  color: var(--ed-text);
  font-family: var(--ed-serif);
}
@media (max-width: 860px) {
  html[data-theme="editorial"] .shell {
    justify-items: stretch;
    align-items: start;
    padding: 200px 24px 40px;
  }
  html[data-theme="editorial"] .login-panel {
    width: 100%;
  }
  html[data-theme="editorial"] .chrome-right {
    display: grid;
    top: 76px;
    bottom: auto;
    left: 24px;
    max-width: calc(100vw - 48px);
    gap: 10px;
  }
  html[data-theme="editorial"] .chrome-right strong {
    font-size: clamp(2.8rem, 15vw, 4.4rem);
  }
  html[data-theme="editorial"] .chrome-left {
    top: 22px;
    right: 24px;
    left: 24px;
  }
}

/*
 * ---- Tema "halo": fondo pieno e una luce che corre lungo il bordo dello schermo.
 * La luce nasce dal colore principale e reagisce all'accesso: accelera mentre si
 * attende, si accende quando riesce, vira al rosso quando la password è sbagliata.
 */
@property --halo-turn {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}
html[data-theme="halo"] {
  color-scheme: light;
  --ha-page: #ffffff;
  --ha-panel: #ffffff;
  --ha-text: #111113;
  --ha-soft: #6e6e73;
  --ha-field: #f5f5f7;
  --ha-edge: rgba(0, 0, 0, 0.09);
  --ha-glow: 0.6;
  --ha-shadow: 0 30px 80px rgba(0, 0, 0, 0.08);
}
html[data-theme="halo"][data-mode="dark"] {
  color-scheme: dark;
  --ha-page: #000000;
  --ha-panel: #0b0b0d;
  --ha-text: #f5f5f7;
  --ha-soft: #98989f;
  --ha-field: #161618;
  --ha-edge: rgba(255, 255, 255, 0.11);
  --ha-glow: 0.95;
  --ha-shadow: none;
}
@media (prefers-color-scheme: dark) {
  html[data-theme="halo"][data-mode="auto"] {
    color-scheme: dark;
    --ha-page: #000000;
    --ha-panel: #0b0b0d;
    --ha-text: #f5f5f7;
    --ha-soft: #98989f;
    --ha-field: #161618;
    --ha-edge: rgba(255, 255, 255, 0.11);
    --ha-glow: 0.95;
    --ha-shadow: none;
  }
}
html[data-theme="halo"] body {
  overflow: auto;
  background: var(--ha-page);
  color: var(--ha-text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
}
html[data-theme="halo"] .hero {
  background: var(--ha-page);
}
html[data-theme="halo"] .hero-video,
html[data-theme="halo"] .hero-media,
html[data-theme="halo"] .hero-scrim,
html[data-theme="halo"] .chrome-clock {
  display: none;
}
/* Sotto: un cono di colori che ruota. Sopra: il fondo, sfocato ai bordi, che ne lascia
   vedere solo una cornice morbida. */
html[data-theme="halo"] .hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: conic-gradient(
    from var(--halo-turn),
    var(--accent),
    color-mix(in oklab, var(--accent) 45%, #ff3ea5),
    color-mix(in oklab, var(--accent) 40%, #ffb03a),
    color-mix(in oklab, var(--accent) 40%, #2fe6ff),
    var(--accent)
  );
  opacity: var(--ha-glow);
  filter: saturate(1.3);
  animation: halo-turn 12s linear infinite;
  transition: opacity 600ms ease;
}
html[data-theme="halo"] .hero::after {
  content: "";
  position: absolute;
  inset: 16px;
  border-radius: 44px;
  background: var(--ha-page);
  filter: blur(26px);
  transition: inset 700ms cubic-bezier(0.16, 1, 0.3, 1);
}
html[data-theme="halo"] body[data-busy="true"] .hero::before {
  animation-duration: 3.2s;
}
html[data-theme="halo"] body[data-auth-state="success"] .hero::before {
  opacity: 1;
  animation-duration: 2.4s;
}
html[data-theme="halo"] body[data-auth-state="success"] .hero::after {
  inset: 54px;
}
html[data-theme="halo"] body[data-auth-state="error"] .hero::before {
  background: conic-gradient(from var(--halo-turn), #ff3b30, #ff8a80, #ff3b30, #b3261e, #ff3b30);
  opacity: 1;
}
html[data-theme="halo"] .chrome {
  z-index: 1;
  color: var(--ha-text);
  text-shadow: none;
}
html[data-theme="halo"] .chrome-right {
  top: 44px;
  right: 0;
  left: 0;
  gap: 4px;
  text-align: center;
  letter-spacing: 0;
}
html[data-theme="halo"] .chrome-right strong {
  color: var(--ha-text);
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0.01em;
}
html[data-theme="halo"] .chrome-right span {
  color: var(--ha-soft);
  font-size: 12px;
  font-weight: 400;
}
html[data-theme="halo"] .chrome-left {
  right: 0;
  bottom: 44px;
  left: 0;
  color: var(--ha-soft);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-align: center;
}
html[data-theme="halo"] .login-panel {
  width: min(400px, 100%);
  max-height: none;
  padding: 46px 36px 32px;
  border: 1px solid var(--ha-edge);
  border-radius: 30px;
  background: var(--ha-panel);
  box-shadow: var(--ha-shadow);
  backdrop-filter: none;
  color: var(--ha-text);
  animation-duration: 620ms;
}
html[data-theme="halo"] .brand {
  gap: 16px;
  margin-bottom: 28px;
}
html[data-theme="halo"] .login-logo {
  width: 56px;
  border-radius: 14px;
  filter: none;
}
html[data-theme="halo"] .eyebrow {
  color: var(--ha-soft);
  font-size: 13px;
  font-weight: 500;
}
html[data-theme="halo"] h1 {
  color: var(--ha-text);
  font-size: 34px;
  font-weight: 680;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
html[data-theme="halo"] .client-name,
html[data-theme="halo"] .help-text,
html[data-theme="halo"] .footer-text,
html[data-theme="halo"] .message {
  color: var(--ha-soft);
}
html[data-theme="halo"] .message[data-tone="error"] {
  color: #ff453a;
}
html[data-theme="halo"] .providers,
html[data-theme="halo"] .password-form {
  gap: 10px;
}
html[data-theme="halo"] .provider {
  min-height: 52px;
  border: 1px solid var(--ha-edge);
  border-radius: 14px;
  background: var(--ha-field);
  color: var(--ha-text);
  font-size: 16px;
  font-weight: 540;
  filter: none;
}
html[data-theme="halo"] .provider:hover {
  border-color: var(--ha-text);
  background: var(--ha-field);
  color: var(--ha-text);
  box-shadow: none;
  transform: none;
}
html[data-theme="halo"] .provider small {
  color: var(--ha-soft);
}
html[data-theme="halo"] .credential-header strong,
html[data-theme="halo"] .account-panel h2 {
  color: var(--ha-text);
}
html[data-theme="halo"] .password-form input {
  min-height: 52px;
  border: 1px solid var(--ha-edge);
  border-radius: 14px;
  background-color: var(--ha-field);
  color: var(--ha-text);
  font-size: 16px;
  box-shadow: none;
  caret-color: var(--ha-text);
}
html[data-theme="halo"] .password-form input::placeholder {
  color: var(--ha-soft);
}
html[data-theme="halo"] .password-form input:focus {
  border-color: var(--ha-text);
  box-shadow: none;
}
html[data-theme="halo"] .password-form input:-webkit-autofill,
html[data-theme="halo"] .password-form input:-webkit-autofill:hover,
html[data-theme="halo"] .password-form input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ha-text);
  box-shadow: 0 0 0 1000px var(--ha-field) inset;
}
html[data-theme="halo"] .field-icon {
  stroke: var(--ha-soft);
}
/* Il pulsante è in bianco e nero: il colore, in questo tema, è tutto nella luce. */
html[data-theme="halo"] .password-form button[type="submit"],
html[data-theme="halo"] .password-form button:not([type]),
html[data-theme="halo"] .primary-action {
  min-height: 52px;
  margin-top: 8px;
  border-radius: 14px;
  background: var(--ha-text);
  box-shadow: none;
  color: var(--ha-page);
  font-size: 16px;
  font-weight: 620;
}
html[data-theme="halo"] .password-form button[type="submit"]:hover,
html[data-theme="halo"] .primary-action:hover {
  background: var(--ha-text);
  opacity: 0.86;
}
html[data-theme="halo"] .password-form .change-method {
  color: var(--ha-soft);
  font-weight: 500;
}
html[data-theme="halo"] .password-form .change-method:hover {
  color: var(--ha-text);
}
html[data-theme="halo"] .secondary-action {
  border: 1px solid var(--ha-edge);
  border-radius: 14px;
  background: transparent;
  color: var(--ha-text);
  font-weight: 540;
}
@keyframes halo-turn {
  to {
    --halo-turn: 360deg;
  }
}
@media (max-width: 680px) {
  html[data-theme="halo"] .shell {
    padding: 96px 22px 76px;
  }
  html[data-theme="halo"] .hero::after {
    inset: 10px;
    border-radius: 34px;
    filter: blur(18px);
  }
  html[data-theme="halo"] .chrome-right {
    display: grid;
    top: 34px;
  }
  html[data-theme="halo"] .chrome-left {
    top: auto;
    bottom: 30px;
  }
  html[data-theme="halo"] .login-panel {
    padding: 34px 22px 24px;
    border-radius: 26px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html[data-theme="halo"] .hero::before {
    animation: none;
  }
}

/*
 * Vale per tutti i temi: il testo dell'interfaccia non si seleziona e non mostra il
 * cursore di scrittura. Si scrive solo nei campi; si copiano solo i codici dell'account.
 * Un tema nuovo eredita questa regola senza doverla ripetere.
 */
body {
  cursor: default;
  -webkit-user-select: none;
  user-select: none;
}
input,
textarea {
  cursor: text;
  -webkit-user-select: text;
  user-select: text;
}
a,
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
}
.account-panel code,
.account-panel pre {
  cursor: text;
  -webkit-user-select: text;
  user-select: text;
}
