/* SILLEX login theme — one continuous photograph, one glass panel.
   Spec: docs/design/login-critique.md (Part B). Self-hosted only: Inter variable font and the hero
   renditions live in this theme; no remote fonts, icons or scripts. */

/* @tokens — colours shared with web/app/tokens.css; the on-glass inks are login-specific (B8). */
:root {
  color-scheme: light;
  --photo-fill: #536171;                 /* mean colour of the hero; shown until the image decodes */
  --forest: #1f4d3f;
  --sillex-green: #1f4d3f;              /* alias asserted by scripts/identity_smoke.py */
  --forest-tint: #2f7a62;
  --bronze: #a87842;

  --on-glass: #14201b;
  --on-glass-2: #2f3d36;
  --on-glass-3: #5b6963;
  --accent: #1f4d3f;
  --link: #17392f;
  --danger: #8f1d15;
  --ok: #1f5a36;
  --on-photo: #ffffff;
  --on-photo-2: rgba(255, 255, 255, .78);

  --glass-bg: rgba(255, 255, 255, .66);
  --glass-blur: 28px;
  --glass-saturate: 150%;
  --glass-specular: rgba(255, 255, 255, .32);
  --glass-edge: inset 0 1px 0 rgba(255, 255, 255, .75), inset 0 0 0 1px rgba(255, 255, 255, .40);
  --glass-shadow: 0 20px 50px rgba(6, 12, 18, .28), 0 1px 2px rgba(6, 12, 18, .10);
  --glass-opaque: rgba(255, 255, 255, .94);

  --chip-bg: rgba(10, 16, 22, .46);       /* dark-tinted glass for on-photo controls (locale) */
  --chip-edge: inset 0 0 0 1px rgba(255, 255, 255, .18), inset 0 1px 0 rgba(255, 255, 255, .22);

  --field-bg: rgba(255, 255, 255, .52);
  --field-bg-focus: rgba(255, 255, 255, .72);
  --field-ring: rgba(20, 32, 27, .12);
  --field-ring-hover: rgba(20, 32, 27, .24);
  --inset-bg: rgba(20, 32, 27, .06);
  --inset-bg-hover: rgba(20, 32, 27, .10);
  --danger-inset: rgba(143, 29, 21, .10);

  --primary-bg: #1f4d3f;
  --primary-fg: #ffffff;

  --dim-top: rgba(8, 14, 20, .38);
  --dim-mid: rgba(8, 14, 20, .10);
  --dim-bottom: rgba(8, 14, 20, .22);
  --dim-flat: rgba(8, 14, 20, 0);

  --u: 1;                                 /* UI scale: 1 up to 2400 px CSS width, larger on 4K (see bottom) */
  --content-max: 1920px;                  /* the three rows never spread wider than this (ultrawide) */
  --r-panel: calc(28px * var(--u));
  --r-menu: 16px;
  --r-inset: 12px;
  --r-capsule: 999px;
  --inset-x: calc(18px * var(--u));
  --control-h: calc(48px * var(--u));
  --fs-body: calc(15px * var(--u));
  --fs-small: calc(13px * var(--u));
  --fs-title: calc(24px * var(--u));
  --card-w: calc(420px * var(--u));
  --card-pad: calc(32px * var(--u));
  --stage-pad: calc(24px * var(--u));

  --t-fast: 120ms;
  --t-base: 200ms;
  --t-enter: 480ms;
  --t-settle: 2400ms;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
}
/* Panel luminance is content-driven, not scheme-driven (HIG: glass adapts to what is beneath it). The hero is a
   blue-hour photograph, so the panel is dark glass in BOTH colour schemes; `data-panel` on <html> (theme.properties
   `heroPanel`) flips the set to "light" for a bright hero. Nothing on this page sits off the photo, so
   prefers-color-scheme changes nothing here. */
:root[data-panel="dark"] {
    color-scheme: dark;
    --on-glass: #f2f5f3;
    --on-glass-2: #c9d2cc;
    --on-glass-3: #94a19a;
    --accent: #8fd4b8;
    --link: #9fdcc3;
    --danger: #ffa198;
    --ok: #8bd3a8;

    --glass-bg: rgba(14, 20, 24, .58);
    --glass-saturate: 130%;
    --glass-specular: rgba(255, 255, 255, .10);
    --glass-edge: inset 0 1px 0 rgba(255, 255, 255, .14), inset 0 0 0 1px rgba(255, 255, 255, .08);
    --glass-shadow: 0 20px 50px rgba(0, 0, 0, .45), 0 1px 2px rgba(0, 0, 0, .30);
    --glass-opaque: rgba(14, 20, 24, .94);

    --field-bg: rgba(255, 255, 255, .08);
    --field-bg-focus: rgba(255, 255, 255, .12);
    --field-ring: rgba(255, 255, 255, .16);
    --field-ring-hover: rgba(255, 255, 255, .26);
    --inset-bg: rgba(255, 255, 255, .07);
    --inset-bg-hover: rgba(255, 255, 255, .12);
    --danger-inset: rgba(255, 161, 152, .12);

    --primary-bg: #f2f5f3;
    --primary-fg: #0f1512;

    --dim-flat: rgba(8, 14, 20, .22);
  }
/* @end tokens */

@font-face {
  font-family: "Inter";
  src: url("../fonts/InterVariable.woff2?v=202610021251-16e408f") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html.sillex { height: 100%; -webkit-text-size-adjust: 100%; }
body.sillex-login {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--photo-fill);
  color: var(--on-glass);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: var(--fs-body);
  line-height: 1.5;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 1.5px; }
p { margin: 0 0 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mt { margin-top: 16px; }

/* ---------- Stage: the photograph and the three in-flow rows ---------- */
.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.stage__bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--photo-fill);
}
.stage__bg img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 45%;
  transform-origin: 50% 50%;
  animation: settle var(--t-settle) var(--ease-out) both;
}
.stage__dim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, var(--dim-flat), var(--dim-flat)),
    linear-gradient(180deg, var(--dim-top) 0%, var(--dim-mid) 34%, rgba(8, 14, 20, 0) 58%, var(--dim-bottom) 100%);
}
.stage__top, .stage__main, .stage__foot { position: relative; width: 100%; max-width: var(--content-max); margin-inline: auto; }
.stage__top {
  z-index: 30;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 40px;
}
.stage__main {
  z-index: 10;
  display: flex;
  justify-content: center;
  margin-block: auto;
  padding-block: 24px;            /* padding-block, never the shorthand: the >=1024 rule below sets padding-right */
}
.stage__main + .stage__foot { margin-top: 0; }
.stage__foot {
  z-index: 10;
  margin: 0;
  color: var(--on-photo-2);
  font-size: var(--fs-small);
  line-height: 1.45;
  animation: fade var(--t-enter) var(--ease-out) both;
}
.brand {
  margin: 0;
  color: var(--on-photo);
  font-size: calc(13px * var(--u));
  font-weight: 650;
  letter-spacing: .16em;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}
@media (min-width: 768px) {
  .stage { padding: max(var(--stage-pad), env(safe-area-inset-top)) max(var(--stage-pad), env(safe-area-inset-right)) max(var(--stage-pad), env(safe-area-inset-bottom)) max(var(--stage-pad), env(safe-area-inset-left)); }
  .stage__main { padding-block: 32px; }
  .brand { font-size: calc(14px * var(--u)); }
}
@media (min-width: 1024px) {
  /* Right-of-centre: the card sits over the ridge/rock, the vista stays open on the left (critique B1). */
  .stage__main { justify-content: flex-end; padding-right: clamp(0px, 9vw - 24px, calc(112px * var(--u))); }
}

/* ---------- Glass recipe (one panel) ---------- */
.glass {
  position: relative;
  isolation: isolate;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  box-shadow: var(--glass-edge), var(--glass-shadow);
  border-radius: var(--r-panel);
}
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, var(--glass-specular), rgba(255, 255, 255, 0) 40%);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: var(--glass-opaque); }
}
@media (prefers-reduced-transparency: reduce) {
  .glass { background: var(--glass-opaque); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .chip, .locale__menu { background: rgba(10, 16, 22, .92); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  .glass { box-shadow: 0 0 0 1px var(--on-glass), var(--glass-shadow); }
  .input, .button--ghost { box-shadow: inset 0 0 0 1px var(--on-glass); }
}

/* ---------- Card ---------- */
.card {
  width: 100%;
  max-width: var(--card-w);
  padding: 24px;
  border-radius: 24px;
  animation: reveal var(--t-enter) var(--ease-out) 80ms both;
}
@media (min-width: 768px) { .card { padding: var(--card-pad); border-radius: var(--r-panel); } }
.card__header { margin: 0 0 24px; }
/* One text column (critique B2, Part E8): every text on the card — title included — starts at the 18 px inset;
   only boxes (capsules, buttons, alerts, the key and QR tiles) sit at the card edge. text-align is start everywhere. */
#kc-page-title {
  margin: 0;
  padding: 0 var(--inset-x);
  font-size: var(--fs-title);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--on-glass);
}
.card__title-wrap .subtitle { display: block; margin-bottom: 4px; padding: 0 var(--inset-x); font-size: 13px; color: var(--on-glass-2); }
.required { color: var(--danger); }
.card__help {
  margin: 20px 0 0;
  padding: 0 var(--inset-x);
  font-size: var(--fs-small);
  line-height: 1.45;
  color: var(--on-glass-2);
}
.card__info, #kc-info-message, #kc-error-message { font-size: 14px; color: var(--on-glass-2); }
.card__info { margin-top: 16px; padding: 0 var(--inset-x); }
.instruction { margin: 0 0 16px; padding: 0 var(--inset-x); font-size: 15px; color: var(--on-glass); }
.instruction--muted { font-size: 13px; color: var(--on-glass-2); }
.message p:last-child { margin-bottom: 0; }
/* The one action of an error / info / page-expired page: a full-width button in the box column, 20 px below the text */
.message__actions { margin: 20px 0 0; }
.message__actions + .instruction { margin-top: 20px; }

/* Attempted username (password step / step-up) */
#kc-username.attempted { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; }
#kc-attempted-username { font-size: 14px; font-weight: 500; color: var(--on-glass-2); }
#reset-login .kc-login-tooltip { position: relative; display: inline-flex; }
#reset-login .kc-tooltip-text {
  position: absolute; left: 50%; top: calc(100% + 6px); transform: translateX(-50%);
  white-space: nowrap; padding: 4px 8px; border-radius: 8px;
  background: var(--on-glass); color: var(--glass-opaque); font-size: 12px; opacity: 0; pointer-events: none;
  transition: opacity var(--t-fast) var(--ease-out);
}
#reset-login:hover .kc-tooltip-text, #reset-login:focus-visible .kc-tooltip-text { opacity: 1; }

/* ---------- Locale: dark glass capsule, top-right, menu above everything ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px 0 14px;
  border: 0;
  border-radius: var(--r-capsule);
  background: var(--chip-bg);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  box-shadow: var(--chip-edge);
  color: var(--on-photo);
  font: inherit;
  font-size: var(--fs-small);
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background-color var(--t-base) var(--ease-out);
}
@media (hover: hover) { .chip:hover { background: rgba(10, 16, 22, .62); } }
.chip[aria-expanded="true"] { background: rgba(10, 16, 22, .62); }
.chip:focus-visible { outline-color: var(--on-photo); }
.chip::after {
  content: "";
  width: 7px; height: 7px;
  border: solid currentColor; border-width: 0 1.5px 1.5px 0;
  transform: translateY(-2px) rotate(45deg);
  opacity: .8;
}
@media (min-width: 768px) { .chip { min-height: calc(36px * var(--u)); } }
@media (pointer: coarse) { .chip { min-height: 40px; } }
.locale { position: relative; margin-left: auto; }
.locale__dropdown { position: relative; }
.locale__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  display: none;
  margin: 0;
  padding: 6px;
  min-width: 168px;
  list-style: none;
  border-radius: var(--r-menu);
  background: var(--chip-bg);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  backdrop-filter: blur(24px) saturate(140%);
  box-shadow: var(--chip-edge), 0 16px 40px rgba(0, 0, 0, .35);
  animation: menu-in 160ms var(--ease-out) both;
}
/* Opened by menu-button-links.js (inline display:block); keyboard focus keeps it open. No :hover opening. */
.locale__dropdown.focus .locale__menu { display: block; }
.locale__item { margin: 0; }
.locale__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  padding: 0 10px 0 12px;
  border-radius: 10px;
  color: var(--on-photo);
  font-size: 14px;
  text-decoration: none;
  transition: background-color var(--t-fast) var(--ease-out);
}
.locale__link:focus-visible, .locale__link:hover { background: rgba(255, 255, 255, .14); text-decoration: none; outline-offset: -2px; outline-color: var(--on-photo); }
.locale__link[aria-current="true"]::after {
  content: "";
  flex: 0 0 auto;
  width: 14px; height: 14px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* ---------- Fields ---------- */
.form { display: block; }
.field { margin: 0 0 16px; }
.field:last-child { margin-bottom: 0; }
.field__label-wrap { display: flex; align-items: baseline; gap: 4px; padding: 0 var(--inset-x); }
.field__label-wrap .field__label { padding: 0; }
.field__label {
  display: block;
  margin-bottom: 8px;
  padding: 0 var(--inset-x);
  font-size: var(--fs-small);
  font-weight: 500;
  line-height: 1.45;
  color: var(--on-glass-2);
}
.field__control { display: block; }
.input, .input--textarea {
  display: block;
  width: 100%;
  height: var(--control-h);
  padding: 0 var(--inset-x);
  border: 0;
  border-radius: var(--r-capsule);
  background: var(--field-bg);
  box-shadow: inset 0 0 0 1px var(--field-ring);
  color: var(--on-glass);
  font: inherit;
  font-size: var(--fs-body);
  transition: box-shadow var(--t-base) var(--ease-out), background-color var(--t-base) var(--ease-out);
}
.input--textarea { height: auto; min-height: 96px; padding: 12px var(--inset-x); border-radius: 20px; }
.input::placeholder { color: var(--on-glass-3); }
@media (hover: hover) { .input:hover { box-shadow: inset 0 0 0 1px var(--field-ring-hover); } }
.input:focus { background: var(--field-bg-focus); box-shadow: inset 0 0 0 1px var(--field-ring-hover); outline: 2px solid var(--accent); outline-offset: 1px; }
.input[aria-invalid="true"] { box-shadow: inset 0 0 0 1.5px var(--danger); }
.input:-webkit-autofill, .input:-webkit-autofill:hover, .input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--on-glass);
  -webkit-box-shadow: inset 0 0 0 1px var(--field-ring), inset 0 0 0 100px var(--field-bg-focus);
  transition: background-color 9999s;
}
.input--code { font-variant-numeric: tabular-nums; letter-spacing: .12em; }
.field__hint { display: block; margin-top: 8px; padding: 0 var(--inset-x); font-size: var(--fs-small); color: var(--on-glass-2); }
.field__error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 8px;
  padding: 0 var(--inset-x);
  color: var(--danger);
  font-size: var(--fs-small);
  font-weight: 500;
  line-height: 1.45;
}
.field__error::before {
  content: "";
  flex: 0 0 auto;
  width: 14px; height: 14px;
  margin-top: 2px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 8v5M12 16v.5'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 8v5M12 16v.5'/%3E%3C/svg%3E") no-repeat center / contain;
}
.input-group { position: relative; display: block; }
.input-group .input { padding-right: calc(var(--control-h) + 6px); }
/* Positioned with offsets (not a transform) so the :active scale does not displace the button mid-click. */
.input-group .button-icon { position: absolute; top: calc((var(--control-h) - 36px) / 2); right: 6px; }
@media (pointer: coarse) {
  .input-group .button-icon { width: 44px; height: 44px; top: calc((var(--control-h) - 44px) / 2); right: 2px; }
}

/* Checkboxes (remember me, logout other sessions) */
.checkbox label, .check { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-small); color: var(--on-glass-2); cursor: pointer; }
.checkbox input, .check__input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }

/* Options row (forgot password / remember me): aligned to the capsule text inset */
.form__settings { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 8px 16px; margin: 12px 0 24px; padding: 0 var(--inset-x); }
.form__settings #kc-form-options:empty, .form__settings #kc-form-options:not(:has(*)) { display: none; }   /* whitespace-only when remember-me is off: no phantom flex item, no 16 px gap before the link */
.form__options-inner { font-size: var(--fs-small); }
/* Options row (forgot password / remember me): everything in the text column — no right-pushed link (Part E8). */
.form__settings .form__options-inner { margin-left: 0; }
.form__options { margin: 0 0 12px; padding: 0 var(--inset-x); }
.form__settings .form__options { margin: 0; padding: 0; }          /* the row is already inset: no double inset, no stray margin */
/* A quiet line under the buttons (reset page: "back to sign in"): left, in the text column, 16 px below */
.form__after { display: block; margin: 16px 0 0; padding: 0 var(--inset-x); }
.form__after .form__options-inner { margin-left: 0; }
.form__buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.form__buttons > .button:not(.button--block) { flex: 1 1 auto; }
#kc-form-buttons + .field { margin-top: 16px; }

/* Submitting: the base onsubmit disables the submit control; make "working" legible. */
.form:has(.button--primary:disabled) .input { opacity: .7; }
.form:has(.button--primary:disabled) { cursor: progress; }

/* ---------- Buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-h);
  padding: 0 22px;
  border: 0;
  border-radius: var(--r-capsule);
  background: transparent;
  color: var(--on-glass);
  font: inherit;
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: transform var(--t-base) var(--ease-out), filter var(--t-base) var(--ease-out),
              background-color var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out);
}
@media (hover: hover) { .button:hover { filter: brightness(1.06); text-decoration: none; } }
.button:active { transform: scale(.98); transition-duration: var(--t-fast); }
.button:disabled, .button.is-disabled, .button[aria-disabled="true"] { opacity: .55; cursor: progress; transform: none; filter: none; }
.button--primary { background: var(--primary-bg); color: var(--primary-fg); }
.button--ghost { background: var(--field-bg); box-shadow: inset 0 0 0 1px var(--field-ring); color: var(--on-glass); }
@media (hover: hover) { .button--ghost:hover { box-shadow: inset 0 0 0 1px var(--field-ring-hover); } }
.button--block { width: 100%; flex: 1 1 100%; }
.button--sm { min-height: 36px; padding: 0 12px; font-size: var(--fs-small); }
input.button::-moz-focus-inner { border: 0; }
.button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--r-capsule);
  background: transparent;
  color: var(--on-glass-2);
  cursor: pointer;
  transition: background-color var(--t-base) var(--ease-out), color var(--t-base) var(--ease-out);
}
@media (hover: hover) { .button-icon:hover { background: var(--inset-bg-hover); color: var(--on-glass); } }
.button-icon:active { transform: scale(.94); }

/* ---------- Icons (inline SVG masks; no icon font) ---------- */
.icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  background-color: currentColor;
  -webkit-mask: no-repeat center / contain;
  mask: no-repeat center / contain;
  vertical-align: middle;
}
.icon--eye { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); }
.icon--eye-off { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3l18 18'/%3E%3Cpath d='M10.6 5.2A10.8 10.8 0 0 1 12 5c6.5 0 10 7 10 7a17.6 17.6 0 0 1-3.2 4.1M6.6 6.6A17 17 0 0 0 2 12s3.5 7 10 7a9.8 9.8 0 0 0 4.4-1'/%3E%3Cpath d='M9.9 9.9a3 3 0 0 0 4.2 4.2'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3l18 18'/%3E%3Cpath d='M10.6 5.2A10.8 10.8 0 0 1 12 5c6.5 0 10 7 10 7a17.6 17.6 0 0 1-3.2 4.1M6.6 6.6A17 17 0 0 0 2 12s3.5 7 10 7a9.8 9.8 0 0 0 4.4-1'/%3E%3Cpath d='M9.9 9.9a3 3 0 0 0 4.2 4.2'/%3E%3C/svg%3E"); }
.icon--restart { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 1 0 3-6.7'/%3E%3Cpath d='M3 4v5h5'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 1 0 3-6.7'/%3E%3Cpath d='M3 4v5h5'/%3E%3C/svg%3E"); }
.icon--device { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='7' y='2.5' width='10' height='19' rx='2'/%3E%3Cpath d='M11 18h2'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='7' y='2.5' width='10' height='19' rx='2'/%3E%3Cpath d='M11 18h2'/%3E%3C/svg%3E"); }
.icon--chevron { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E"); }

/* ---------- Alerts (page-level messages) ---------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: var(--r-menu);
  background: var(--inset-bg);
  color: var(--on-glass);
  font-size: 14px;
  line-height: 1.45;
}
.alert__icon-wrap { flex: 0 0 auto; display: inline-flex; margin-top: 1px; }
.alert__icon { display: inline-block; width: 18px; height: 18px; border-radius: 50%; position: relative; background: var(--on-glass-2); }
.alert__icon::before, .alert__icon::after { content: ""; position: absolute; left: 50%; background: var(--glass-opaque); transform: translateX(-50%); border-radius: 1px; }
.alert__icon::before { top: 4px; width: 2px; height: 6px; }
.alert__icon::after { top: 12px; width: 2px; height: 2px; }
.alert--error { background: var(--danger-inset); color: var(--danger); }
.alert--error .alert__icon { background: var(--danger); }
.alert--warning .alert__icon { background: var(--bronze); }
.alert--success .alert__icon, .alert--info .alert__icon { background: var(--ok); }
.alert--success .alert__icon::before { top: 8px; width: 8px; height: 2px; transform: translateX(-50%) rotate(45deg); left: 40%; }
.alert--success .alert__icon::after { top: 6px; width: 2px; height: 8px; transform: translateX(-50%) rotate(45deg); left: 62%; }
.alert__title { flex: 1 1 auto; font-weight: 500; }

/* ---------- OTP credential tiles / TOTP setup / select-authenticator ---------- */
.otp-tiles { display: grid; gap: 8px; margin-bottom: 4px; }
.otp-tile__input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.otp-tile { display: block; padding: 12px 16px; border-radius: var(--r-menu); background: var(--field-bg); box-shadow: inset 0 0 0 1px var(--field-ring); cursor: pointer; }
.otp-tile__header { display: inline-flex; align-items: center; gap: 10px; }
.otp-tile__icon { display: inline-flex; color: var(--on-glass-2); }
.otp-tile__title { font-size: 14px; font-weight: 500; }
.otp-tile__input:checked + .otp-tile { box-shadow: inset 0 0 0 1.5px var(--accent); }
.otp-tile__input:focus-visible + .otp-tile { outline: 2px solid var(--accent); outline-offset: 1px; }
/* ---------- First-login sequence: update password, configure authenticator, one-time code ----------
   Spec: docs/design/login-critique.md, Part E. The card never scrolls: on login-config-totp the QR code / manual
   key live in a second glass panel of the same shape (the "aside"), left of the card on desktop, above it on
   narrow viewports; the card keeps the form only. */
.card__subtitle { margin: 0 0 16px; padding: 0 var(--inset-x); font-size: calc(17px * var(--u)); font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; color: var(--on-glass); }
.steps { margin: 0; padding: 0 var(--inset-x); list-style: none; counter-reset: step; font-size: 14px; line-height: 1.45; color: var(--on-glass-2); }
.steps__item { position: relative; margin: 0 0 16px; padding-left: 32px; counter-increment: step; }   /* marker in the text column, text 32 px after it */
.steps__item:last-child { margin-bottom: 0; }
.steps__item::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--inset-bg);
  box-shadow: inset 0 0 0 1px var(--field-ring);
  color: var(--on-glass);
  font-size: 12px; font-weight: 600; line-height: 22px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.steps__item > p { margin: 0 0 8px; }
.steps__apps { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.steps__apps li { padding: 3px 10px; border-radius: var(--r-capsule); background: var(--inset-bg); font-size: 13px; color: var(--on-glass); }
.steps__switch { margin: 12px 0 0; font-size: var(--fs-small); }
.steps__policy { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.steps__policy li { display: contents; }
.steps__policy li span { color: var(--on-glass-3); }
.steps__policy li span + * { color: var(--on-glass); }
.qr-tile { display: inline-block; padding: 12px; margin: 4px 0 0; background: #fff; border-radius: 16px; box-shadow: 0 1px 2px rgba(6, 12, 18, .12); }
.qr { display: block; width: 200px; height: 200px; image-rendering: pixelated; }
.key { margin: 4px 0 0; padding: 14px var(--inset-x); border-radius: var(--r-menu); background: var(--inset-bg); box-shadow: inset 0 0 0 1px var(--field-ring); }
.key__value {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: calc(17px * var(--u));
  line-height: 1.5;
  letter-spacing: .06em;
  word-spacing: .3em;
  overflow-wrap: anywhere;
  color: var(--on-glass);
  user-select: all;
  -webkit-user-select: all;
}
.key__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.key__actions .button { flex: 1 1 auto; }
.button.is-done { color: var(--ok); }
.code { display: inline-block; padding: 6px 12px; border-radius: var(--r-capsule); background: var(--field-bg); box-shadow: inset 0 0 0 1px var(--field-ring); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; letter-spacing: .06em; color: var(--on-glass); user-select: all; }

/* Large digits for the one-time code (login-otp, login-config-totp) */
.input--code { text-align: center; padding-inline: var(--inset-x); font-size: calc(22px * var(--u)); font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: .24em; }
.input--code::placeholder { letter-spacing: .24em; }

/* Password policy hints (login-update-password) */
.hints { margin: 8px 0 0; padding: 0 var(--inset-x); list-style: none; display: grid; gap: 4px; font-size: var(--fs-small); line-height: 1.45; color: var(--on-glass-2); }
.hints__item { display: flex; align-items: flex-start; gap: 8px; transition: color var(--t-base) var(--ease-out); }
.hints__item::before {
  content: "";
  flex: 0 0 auto;
  width: 14px; height: 14px;
  margin-top: 2px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--on-glass-3);
  transition: box-shadow var(--t-base) var(--ease-out), background-color var(--t-base) var(--ease-out);
}
/* Rules the page cannot test live (not-your-e-mail, history) are listed with a plain dot, not an empty check. */
.hints__item:not([data-value])::before { width: 5px; height: 5px; margin: 7px 4.5px 0; box-shadow: none; background: var(--on-glass-3); }
.hints__item.is-met { color: var(--on-glass); }
.hints__item.is-met::before {
  box-shadow: none;
  background: var(--ok);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='11' fill='%23000' stroke='none'/%3E%3Cpath d='M7 12.5l3.2 3.2L17 9' stroke='%23fff'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='11' fill='%23000' stroke='none'/%3E%3Cpath d='M7 12.5l3.2 3.2L17 9' stroke='%23fff'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* The "need access?" help line belongs to the sign-in step; the required actions already have an account. */
body[data-page-id="login-login-update-password"] .card__help,
body[data-page-id="login-login-config-totp"] .card__help { display: none; }

/* Two panels of the same shape: aside (QR / key) + card (form). DOM order aside -> card = visual order. */
body[data-page-id="login-login-config-totp"] .stage__main { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.card--aside { display: flex; flex-direction: column; animation: reveal-aside var(--t-enter) var(--ease-out) 200ms both; }
.card--aside .steps { display: flex; flex-direction: column; flex: 1 1 auto; }
.card--aside .steps__item:nth-child(2) { flex: 1 1 auto; }
.totp-qr-only { display: none; }
.totp-key-only { display: block; }
span.totp-key-only { display: inline; }
@media (min-width: 768px) {
  .totp-qr-only { display: block; }
  span.totp-qr-only { display: inline; }
  .totp-key-only, span.totp-key-only { display: none; }
}
/* Phone landscape / very short windows count as phones even when wide: show the key, not a QR to scan. */
@media (max-width: 1023px) and (max-height: 520px) {
  .totp-qr-only, span.totp-qr-only { display: none; }
  .totp-key-only { display: block; }
  span.totp-key-only { display: inline; }
}
@media (min-width: 1024px) {
  body[data-page-id="login-login-config-totp"] .stage__main { flex-direction: row; align-items: stretch; justify-content: flex-end; }
  .card--aside { flex: 0 1 var(--card-w); }
  body[data-page-id="login-login-config-totp"] .card:not(.card--aside) { flex: 0 1 var(--card-w); }
}
/* Desktop windows shorter than 800 px: tighter vertical rhythm so the three-step panels stay inside the viewport. */
@media (min-width: 1024px) and (max-height: 800px) {
  .stage__main { padding-block: 8px; }
  .stage__top { min-height: 36px; }
  body[data-page-id="login-login-config-totp"] .card,
  body[data-page-id="login-login-update-password"] .card { padding: 28px; }
  body[data-page-id="login-login-config-totp"] .card__header,
  body[data-page-id="login-login-update-password"] .card__header { margin-bottom: 16px; }
}

.select-auth { display: grid; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.select-auth__item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; border-radius: var(--r-menu); border: 0; background: var(--field-bg); box-shadow: inset 0 0 0 1px var(--field-ring); color: inherit; font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.select-auth__item:hover { box-shadow: inset 0 0 0 1px var(--field-ring-hover); text-decoration: none; }
.select-auth__icon { color: var(--on-glass-2); display: inline-flex; }
.select-auth__body { flex: 1 1 auto; }
.select-auth__heading { font-size: 15px; font-weight: 600; color: var(--on-glass); }
.select-auth__desc { font-size: 13px; color: var(--on-glass-2); }
.select-auth__arrow { color: var(--on-glass-3); }
.social { margin-top: 20px; }
.social hr { border: 0; border-top: 1px solid var(--field-ring); margin: 0 0 12px; }
.social h2, .social h4 { margin: 0 0 10px; font-size: 13px; font-weight: 500; color: var(--on-glass-2); }
.social__list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
#kc-select-try-another-way-form, #kc-switch-organization-form { margin-top: 12px; padding: 0 var(--inset-x); font-size: var(--fs-small); }

/* Short viewports (phone landscape 844x390, small windows): tighten the vertical rhythm, drop the tagline. */
@media (max-height: 520px) {
  .stage { padding-top: max(12px, env(safe-area-inset-top)); padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .stage__top { min-height: 32px; }
  .stage__main { padding-block: 12px; }
  .stage__foot { display: none; }
  .card { padding: 20px; }
  .card__header { margin-bottom: 16px; }
  .field { margin-bottom: 12px; }
  .form__settings { margin: 8px 0 16px; }
  .card__help { margin-top: 16px; }
}

/* ---------- Large displays ----------
   CSS-pixel width >= 2400 (4K at 150 % or 5K) gets a mild scale; a true 4K at 100 % (>= 3200 x 1800 CSS px) gets
   1.4 so the card and type keep their apparent size. Ultrawide 3440x1440 stays at 1.1 (same density as 2560x1440)
   and is capped by --content-max so the card does not drift to the far edge. */
@media (min-width: 2400px) { :root { --u: 1.1; --content-max: 2200px; } }
@media (min-width: 3200px) and (min-height: 1800px) { :root { --u: 1.4; --content-max: 2800px; } }

/* ---------- Motion ---------- */
@keyframes reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes settle { from { transform: scale(1.03); } to { transform: none; } }
@keyframes reveal-aside { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .card, .card--aside, .stage__foot, .stage__bg img, .locale__menu { animation: none !important; }
  *, *::before, *::after { transition-duration: 0ms !important; }
  .button:active, .button-icon:active { transform: none; }
}
