/* nexopt login theme — self-contained. PatternFly is deliberately not loaded
   (stylesCommon is emptied in theme.properties); every class emitted by the
   base templates is remapped to an nx-* class and styled here. */

@font-face {
  font-family: 'Roboto nx';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/Roboto-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Roboto nx';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/Roboto-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Roboto nx';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/Roboto-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Roboto Mono nx';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/RobotoMono-400.woff2') format('woff2');
}

/* ── Tokens ─────────────────────────────────────────────────────────────── */

:root {
  --nx-navy-900: #191a31;
  --nx-navy-800: #21223f;
  --nx-navy-700: #2e3155;

  --nx-orange:     #ffaa53;
  --nx-orange-600: #e88c38;
  --nx-orange-ink: #2a1c0c;

  --nx-surface:   #ffffff;
  --nx-surface-2: #f5f7fb;
  --nx-line:        #dce1ec;
  --nx-line-strong: #c3cbdc;

  --nx-ink:   #1c1d2e;
  --nx-ink-2: #5a6076;
  --nx-ink-3: #858ba3;

  --nx-danger:    #c4362b;
  --nx-danger-bg: #fdf1f0;
  --nx-warning:    #8a5a10;
  --nx-warning-bg: #fdf5e8;
  --nx-success:    #2b7355;
  --nx-success-bg: #edf7f2;
  --nx-info:       #3a4270;
  --nx-info-bg:    #eff2fb;

  --nx-ring: 0 0 0 3px rgba(255, 170, 83, 0.32);

  --nx-seam: clamp(26px, 4.5vw, 84px);
  --nx-radius:    10px;
  --nx-radius-sm: 7px;

  --nx-font: 'Roboto nx', 'Roboto', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --nx-mono: 'Roboto Mono nx', ui-monospace, 'Cascadia Mono', 'Consolas', monospace;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --nx-surface:   #141527;
    --nx-surface-2: #1d1f36;
    --nx-line:        #2b2e4a;
    --nx-line-strong: #3a3e60;

    --nx-ink:   #e9ebf3;
    --nx-ink-2: #a2a8c0;
    --nx-ink-3: #7c8299;

    --nx-danger:    #ff9086;
    --nx-danger-bg: #341d1f;
    --nx-warning:    #f0bd6a;
    --nx-warning-bg: #2f2616;
    --nx-success:    #6fcaa2;
    --nx-success-bg: #122a22;
    --nx-info:       #aeb8e8;
    --nx-info-bg:    #1c1f38;

    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --nx-surface:   #141527;
  --nx-surface-2: #1d1f36;
  --nx-line:        #2b2e4a;
  --nx-line-strong: #3a3e60;

  --nx-ink:   #e9ebf3;
  --nx-ink-2: #a2a8c0;
  --nx-ink-3: #7c8299;

  --nx-danger:    #ff9086;
  --nx-danger-bg: #341d1f;
  --nx-warning:    #f0bd6a;
  --nx-warning-bg: #2f2616;
  --nx-success:    #6fcaa2;
  --nx-success-bg: #122a22;
  --nx-info:       #aeb8e8;
  --nx-info-bg:    #1c1f38;

  color-scheme: dark;
}

:root[data-theme='light'] {
  --nx-surface:   #ffffff;
  --nx-surface-2: #f5f7fb;
  --nx-line:        #dce1ec;
  --nx-line-strong: #c3cbdc;

  --nx-ink:   #1c1d2e;
  --nx-ink-2: #5a6076;
  --nx-ink-3: #858ba3;

  --nx-danger:    #c4362b;
  --nx-danger-bg: #fdf1f0;
  --nx-warning:    #8a5a10;
  --nx-warning-bg: #fdf5e8;
  --nx-success:    #2b7355;
  --nx-success-bg: #edf7f2;
  --nx-info:       #3a4270;
  --nx-info-bg:    #eff2fb;

  color-scheme: light;
}

/* ── Base ───────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

.nx-html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}

.nx-body {
  margin: 0;
  min-height: 100dvh;
  background: var(--nx-surface);
  color: var(--nx-ink);
  font-family: var(--nx-font);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.nx-skip { display: none; }

.nx-sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

a { color: var(--nx-orange-600); }

:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--nx-orange-600);
  outline-offset: 2px;
}

/* ── Icons (mask-based, inherit currentColor) ───────────────────────────── */

.nx-i {
  display: inline-block;
  width: 1em; height: 1em;
  flex: none;
  background-color: currentColor;
  -webkit-mask: var(--nx-i) center / contain no-repeat;
          mask: var(--nx-i) center / contain no-repeat;
}

.nx-i--error   { --nx-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5.5M12 16.4v.1'/%3E%3C/svg%3E"); }
.nx-i--warning { --nx-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.8 2.6 20h18.8z'/%3E%3Cpath d='M12 9.5v4.4M12 17.2v.1'/%3E%3C/svg%3E"); }
.nx-i--success { --nx-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m8 12.2 2.8 2.8L16.2 9.6'/%3E%3C/svg%3E"); }
.nx-i--info    { --nx-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5.5M12 7.6v.1'/%3E%3C/svg%3E"); }
.nx-i--restart { --nx-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E"); }
.nx-i--eye     { --nx-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 12S6 5.8 12 5.8 21.5 12 21.5 12 18 18.2 12 18.2 2.5 12 2.5 12Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); }
.nx-i--eye-off { --nx-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.9 5.9A9.6 9.6 0 0 1 12 5.8c6 0 9.5 6.2 9.5 6.2a17 17 0 0 1-3.4 4.1M6.3 7.9A16.9 16.9 0 0 0 2.5 12S6 18.2 12 18.2a9.5 9.5 0 0 0 3.9-.8'/%3E%3Cpath d='m3 3 18 18'/%3E%3C/svg%3E"); }
.nx-i--key     { --nx-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='12' r='4.2'/%3E%3Cpath d='M12.2 12H21M18 12v3.2M15.2 12v2.4'/%3E%3C/svg%3E"); }
.nx-i--lock    { --nx-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4.5' y='10.5' width='15' height='9.5' rx='2'/%3E%3Cpath d='M8 10.5V7.8a4 4 0 0 1 8 0v2.7'/%3E%3C/svg%3E"); }
.nx-i--mobile  { --nx-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='6.5' y='2.5' width='11' height='19' rx='2.5'/%3E%3Cpath d='M10.8 18.4h2.4'/%3E%3C/svg%3E"); }
.nx-i--list    { --nx-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M9 6.5h11M9 12h11M9 17.5h11M4.2 6.5h.1M4.2 12h.1M4.2 17.5h.1'/%3E%3C/svg%3E"); }
.nx-i--chevron { --nx-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9.5 5.5 7 6.5-7 6.5'/%3E%3C/svg%3E"); }
.nx-i--shield  { --nx-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2.8 4.5 6v6c0 4.5 3.2 7.8 7.5 9.2 4.3-1.4 7.5-4.7 7.5-9.2V6z'/%3E%3Cpath d='m9 12 2.2 2.2L15.2 10'/%3E%3C/svg%3E"); }

/* ── Shell: brand panel + form column, split by a diagonal seam ─────────── */

.nx-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 44fr) minmax(0, 56fr);
  background: var(--nx-surface);
}

/* The seam: the panel is one solid orange plate, the navy inner sits on top of
   it clipped 2px short, so what shows along the diagonal is a hairline rule at
   the angle of the logo chevron. The inner stays in flow (not absolute) so the
   panel can be height-driven by its content when it collapses to a band. */
.nx-brand {
  position: relative;
  z-index: 1;
  display: flex;
  width: calc(100% + var(--nx-seam));
  background: var(--nx-orange);
  clip-path: polygon(0 0, 100% 0, calc(100% - var(--nx-seam)) 100%, 0 100%);
  pointer-events: none;
  overflow: hidden;
}

.nx-brand__inner {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  clip-path: polygon(0 0, calc(100% - 2px) 0, calc(100% - var(--nx-seam) - 2px) 100%, 0 100%);
  background:
    radial-gradient(115% 85% at 6% 106%, rgba(255, 170, 83, 0.16), transparent 58%),
    radial-gradient(85% 65% at 92% -10%, rgba(120, 141, 255, 0.14), transparent 60%),
    linear-gradient(163deg, var(--nx-navy-700) 0%, var(--nx-navy-800) 52%, var(--nx-navy-900) 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: clamp(32px, 5vh, 60px) clamp(32px, 4.4vw, 76px);
  /* the seam only cuts in fully at the bottom edge, so reserving the whole
     offset would leave the copy needlessly narrow */
  padding-right: calc(var(--nx-seam) * 0.7 + clamp(32px, 4.4vw, 76px));
}

/* Fine diagonal ruling at the angle of the logo chevron — texture, not pattern. */
.nx-brand__inner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(114deg,
    rgba(255, 255, 255, 0.032) 0 1px,
    transparent 1px 38px);
  pointer-events: none;
}

.nx-brand__top,
.nx-brand__foot { position: relative; }

.nx-brand__logo {
  display: block;
  width: min(212px, 62%);
  height: auto;
}

.nx-brand__copy { position: relative; }

.nx-brand__headline {
  margin: 0;
  color: #fff;
  font-size: clamp(1.5rem, 1rem + 1.15vw, 2.05rem);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -0.021em;
  text-wrap: balance;
}

.nx-brand__headline em {
  font-style: normal;
  color: var(--nx-orange);
}

.nx-brand__sub {
  margin: 16px 0 0;
  max-width: 34ch;
  color: rgba(226, 230, 244, 0.72);
  font-size: 0.975rem;
  line-height: 1.6;
}

.nx-brand__foot {
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgba(226, 230, 244, 0.5);
  font-family: var(--nx-mono);
  font-size: 0.7rem;
  letter-spacing: 0.02em;
}

.nx-brand__foot .nx-i { font-size: 0.95rem; color: rgba(255, 170, 83, 0.75); }

/* ── Form column ───────────────────────────────────────────────────────── */

.nx-main {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(28px, 6vh, 72px) clamp(20px, 4vw, 64px);
  min-width: 0;
}

/* auto margins centre the panel in the free space and pin .nx-foot to the
   bottom without absolute positioning, so tall forms simply push it down */
.nx-panel {
  width: 100%;
  max-width: 380px;
  margin: auto;
}

.nx-panel__logo {
  display: none;
  width: 148px;
  height: auto;
  margin-bottom: 26px;
}

.nx-panel__head { margin-bottom: 26px; }

#kc-page-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.018em;
  color: var(--nx-ink);
  text-wrap: balance;
}

.nx-lead {
  margin: 8px 0 0;
  color: var(--nx-ink-2);
  font-size: 0.925rem;
  line-height: 1.55;
}

/* Attempted-username chip with a restart-login control */
#kc-username {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 0;
  padding: 7px 8px 7px 14px;
  background: var(--nx-surface-2);
  border: 1px solid var(--nx-line);
  border-radius: 999px;
  max-width: 100%;
}

#kc-attempted-username {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--nx-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#reset-login {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  color: var(--nx-ink-3);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

#reset-login:hover { background: var(--nx-line); color: var(--nx-ink); }
#reset-login .nx-i { font-size: 0.85rem; }
.kc-login-tooltip { display: contents; }
.kc-tooltip-text { display: none; }

/* ── Stack rhythm ──────────────────────────────────────────────────────── */

.nx-stack > * + * { margin-top: 20px; }

.nx-form,
#kc-form,
#kc-form-wrapper { min-width: 0; }

.nx-group { margin-bottom: 18px; }
.nx-group:last-child { margin-bottom: 0; }

#kc-form-buttons { margin-top: 24px; margin-bottom: 0; }

/* ── Alerts ────────────────────────────────────────────────────────────── */

.nx-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 22px;
  padding: 12px 14px;
  border-radius: var(--nx-radius-sm);
  border-left: 3px solid currentColor;
  font-size: 0.875rem;
  line-height: 1.5;
}

.nx-alert .nx-i { font-size: 1.05rem; margin-top: 0.1em; }
.nx-alert__title { color: var(--nx-ink); font-weight: 400; }

.alert-error   { color: var(--nx-danger);  background: var(--nx-danger-bg); }
.alert-warning { color: var(--nx-warning); background: var(--nx-warning-bg); }
.alert-success { color: var(--nx-success); background: var(--nx-success-bg); }
.alert-info    { color: var(--nx-info);    background: var(--nx-info-bg); }

/* ── Fields ────────────────────────────────────────────────────────────── */

.nx-label {
  display: block;
  margin-bottom: 7px;
  color: var(--nx-ink);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.005em;
}

.nx-labelrow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.nx-labelrow .nx-label { margin-bottom: 0; }

.nx-input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--nx-line-strong);
  border-radius: var(--nx-radius-sm);
  background: var(--nx-surface-2);
  color: var(--nx-ink);
  font-family: inherit;
  font-size: 0.975rem;
  line-height: 1.4;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.nx-input::placeholder { color: var(--nx-ink-3); }

.nx-input:hover { border-color: var(--nx-ink-3); }

.nx-input:focus {
  outline: none;
  background: var(--nx-surface);
  border-color: var(--nx-orange-600);
  box-shadow: var(--nx-ring);
}

.nx-input[aria-invalid='true'] {
  border-color: var(--nx-danger);
  background: var(--nx-danger-bg);
}

.nx-input[aria-invalid='true']:focus {
  box-shadow: 0 0 0 3px rgba(196, 54, 43, 0.18);
}

.nx-input--area { min-height: 96px; resize: vertical; }

select.nx-input { appearance: none; padding-right: 38px; }

/* One-time-code field: wide tracking reads as "digits", not a word */
#otp, #totp {
  font-family: var(--nx-mono);
  font-size: 1.15rem;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  font-variant-numeric: tabular-nums;
}

.nx-fielderror,
.pf-v5-c-form__helper-text.pf-m-error,
.nx-help {
  display: block;
  margin-top: 6px;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--nx-danger);
}

.nx-help { color: var(--nx-ink-2); }

/* Input group (password reveal) */
.nx-inputgroup {
  position: relative;
  display: flex;
  align-items: center;
}

.nx-inputgroup .nx-input { padding-right: 46px; }

.nx-reveal {
  position: absolute;
  right: 4px;
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--nx-radius-sm);
  background: transparent;
  color: var(--nx-ink-3);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.nx-reveal:hover { color: var(--nx-ink); background: var(--nx-line); }
.nx-reveal .nx-i { font-size: 1.1rem; }

/* Checkbox / radio */
.nx-choice {
  display: flex;
  align-items: center;
  gap: 9px;
}

.nx-choice__input {
  flex: none;
  width: 16px; height: 16px;
  margin: 0;
  accent-color: var(--nx-orange-600);
  cursor: pointer;
}

.nx-choice__label {
  margin: 0;
  color: var(--nx-ink-2);
  font-size: 0.875rem;
  cursor: pointer;
}

.nx-choice--disabled { opacity: 0.55; }

.nx-options .nx-choice + .nx-choice { margin-top: 8px; }

.required { color: var(--nx-danger); }

/* ── Buttons ───────────────────────────────────────────────────────────── */

.nx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: var(--nx-radius-sm);
  font-family: inherit;
  font-size: 0.975rem;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.nx-btn--block { width: 100%; }
.nx-btn--lg { padding: 12px 22px; }

.nx-btn--primary {
  background: var(--nx-orange);
  color: var(--nx-orange-ink);
  box-shadow: 0 1px 2px rgba(25, 26, 49, 0.16);
}

.nx-btn--primary:hover { background: var(--nx-orange-600); }
.nx-btn--primary:active { box-shadow: none; transform: translateY(1px); }

.nx-btn--ghost {
  background: var(--nx-surface);
  border-color: var(--nx-line-strong);
  color: var(--nx-ink);
}

.nx-btn--ghost:hover { background: var(--nx-surface-2); border-color: var(--nx-ink-3); }

.nx-btn:disabled,
.nx-btn--disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

#kc-form-buttons .nx-btn + .nx-btn { margin-top: 10px; }

/* ── Secondary actions ─────────────────────────────────────────────────── */

.nx-linkbtn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--nx-orange-600);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.nx-linkbtn:hover { text-decoration: underline; }

.nx-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: var(--nx-ink-3);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nx-divider::before,
.nx-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--nx-line);
}

/* Passkey entry point — rendered by the base flow as a bare <a> */
#authenticateWebAuthnButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  padding: 11px 20px;
  border: 1px solid var(--nx-line-strong);
  border-radius: var(--nx-radius-sm);
  background: var(--nx-surface);
  color: var(--nx-ink);
  font-size: 0.925rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

#authenticateWebAuthnButton::before {
  content: '';
  width: 1.15em; height: 1.15em;
  background-color: var(--nx-orange-600);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='12' r='4.2'/%3E%3Cpath d='M12.2 12H21M18 12v3.2M15.2 12v2.4'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='12' r='4.2'/%3E%3Cpath d='M12.2 12H21M18 12v3.2M15.2 12v2.4'/%3E%3C/svg%3E") center / contain no-repeat;
}

#authenticateWebAuthnButton:hover { background: var(--nx-surface-2); border-color: var(--nx-ink-3); }

/* "Back to login" and friends on the templates inherited from the parent theme */
#kc-form-options a,
.nx-settings a {
  color: var(--nx-ink-2);
  font-size: 0.8125rem;
  text-decoration: none;
}

#kc-form-options a:hover,
.nx-settings a:hover { color: var(--nx-orange-600); text-decoration: underline; }

#kc-select-try-another-way-form { margin-top: 20px; text-align: center; }

#try-another-way {
  color: var(--nx-ink-2);
  font-size: 0.8125rem;
  text-decoration: none;
}

#try-another-way:hover { color: var(--nx-orange-600); text-decoration: underline; }

#kc-info,
.nx-signup {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--nx-line);
  color: var(--nx-ink-2);
  font-size: 0.875rem;
  text-align: center;
}

#kc-info a { font-weight: 500; text-decoration: none; }
#kc-info a:hover { text-decoration: underline; }

.nx-backlink {
  margin-top: 22px;
  text-align: center;
  font-size: 0.875rem;
}

.nx-backlink a { color: var(--nx-ink-2); text-decoration: none; }
.nx-backlink a:hover { color: var(--nx-orange-600); text-decoration: underline; }

/* ── select-authenticator ──────────────────────────────────────────────── */

.nx-authlist { display: flex; flex-direction: column; gap: 10px; }

.nx-authlist__item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--nx-line-strong);
  border-radius: var(--nx-radius);
  background: var(--nx-surface);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}

.nx-authlist__item:hover { border-color: var(--nx-orange-600); background: var(--nx-surface-2); }

.nx-authlist__icon {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  flex: none;
  border-radius: 50%;
  background: var(--nx-surface-2);
  color: var(--nx-orange-600);
  font-size: 1.15rem;
}

.nx-authlist__item:hover .nx-authlist__icon { background: var(--nx-surface); }
.nx-authlist__body { flex: 1 1 auto; min-width: 0; }
.nx-authlist__title { margin: 0; font-size: 0.95rem; font-weight: 500; color: var(--nx-ink); }
.nx-authlist__desc,
.nx-authlist__lead { margin: 2px 0 0; font-size: 0.8125rem; color: var(--nx-ink-2); }
.nx-authlist__arrow { flex: none; color: var(--nx-ink-3); font-size: 1rem; }

/* ── OTP credential tiles ──────────────────────────────────────────────── */

.nx-tile__input { position: absolute; opacity: 0; pointer-events: none; }

.nx-tile {
  display: block;
  margin-bottom: 8px;
  padding: 12px 14px;
  border: 1px solid var(--nx-line-strong);
  border-radius: var(--nx-radius-sm);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.nx-tile:hover { background: var(--nx-surface-2); }

.nx-tile__input:checked + .nx-tile {
  border-color: var(--nx-orange-600);
  background: var(--nx-surface-2);
  box-shadow: var(--nx-ring);
}

.nx-tile__head { display: flex; align-items: center; gap: 10px; }
.nx-tile__icon { color: var(--nx-orange-600); font-size: 1.1rem; display: grid; place-items: center; }
.nx-tile__title { font-size: 0.9rem; font-weight: 500; }

/* ── TOTP setup ────────────────────────────────────────────────────────── */

#kc-totp-settings {
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  counter-reset: nxstep;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

#kc-totp-settings > li {
  counter-increment: nxstep;
  position: relative;
  padding-left: 34px;
  font-size: 0.9rem;
  color: var(--nx-ink-2);
}

#kc-totp-settings > li::before {
  content: counter(nxstep);
  position: absolute;
  left: 0; top: 0;
  display: grid;
  place-items: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--nx-surface-2);
  border: 1px solid var(--nx-line);
  color: var(--nx-ink);
  font-size: 0.75rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

#kc-totp-settings p { margin: 0 0 8px; }
#kc-totp-settings ul { margin: 8px 0 0; padding-left: 18px; }
#kc-totp-settings li li { margin-bottom: 3px; }

#kc-totp-secret-qr-code {
  display: block;
  margin: 4px 0 10px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--nx-line);
  border-radius: var(--nx-radius-sm);
}

#kc-totp-secret-key {
  display: inline-block;
  padding: 8px 12px;
  background: var(--nx-surface-2);
  border: 1px solid var(--nx-line);
  border-radius: var(--nx-radius-sm);
  font-family: var(--nx-mono);
  font-size: 0.85rem;
  word-break: break-all;
}

#kc-totp-supported-apps { color: var(--nx-ink); }

#kc-totp-settings a {
  color: var(--nx-orange-600);
  font-weight: 500;
  text-decoration: none;
}

#kc-totp-settings a:hover { text-decoration: underline; }

/* ── Recovery codes ────────────────────────────────────────────────────── */

.nx-codes__warning { margin-bottom: 16px; }

.nx-codes__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 16px;
  margin: 0 0 18px;
  padding: 14px;
  list-style: none;
  background: var(--nx-surface-2);
  border: 1px solid var(--nx-line);
  border-radius: var(--nx-radius-sm);
  font-family: var(--nx-mono);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.nx-codes__actions { display: flex; gap: 10px; margin-bottom: 18px; }
.nx-codes__actions > * { flex: 1; }

/* ── Locale switcher ───────────────────────────────────────────────────── */

.nx-locale {
  position: absolute;
  top: clamp(20px, 4vh, 40px);
  right: clamp(20px, 4vw, 64px);
  z-index: 10;
}

.nx-locale__dd { position: relative; }

#kc-current-locale-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--nx-line);
  border-radius: 999px;
  background: var(--nx-surface);
  color: var(--nx-ink-2);
  font-family: inherit;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
}

#kc-current-locale-link:hover { color: var(--nx-ink); border-color: var(--nx-line-strong); }

#kc-current-locale-link::after {
  content: '';
  width: 0.85em; height: 0.85em;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9.5 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9.5 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
}

.nx-locale__list {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  min-width: 148px;
  margin: 0;
  padding: 5px;
  list-style: none;
  background: var(--nx-surface);
  border: 1px solid var(--nx-line);
  border-radius: var(--nx-radius-sm);
  box-shadow: 0 8px 26px rgba(25, 26, 49, 0.14);
}

.nx-locale__list[aria-hidden='true'],
.nx-locale__dd:not(.active) .nx-locale__list { display: none; }

.nx-locale__item {
  display: block;
  padding: 8px 12px;
  border-radius: 5px;
  color: var(--nx-ink);
  font-size: 0.875rem;
  text-decoration: none;
}

.nx-locale__item:hover { background: var(--nx-surface-2); }

/* ── Social providers (no IdPs configured today; kept sane) ─────────────── */

.nx-social { margin-top: 22px; display: flex; flex-direction: column; gap: 10px; }
.nx-social__section { margin-top: 22px; }
.nx-social__link { display: flex; align-items: center; gap: 9px; }

/* ── Message pages ─────────────────────────────────────────────────────── */
/* error, info, login-page-expired, login-verify-email, login-idp-link-email
   and logout-confirm all render as a headline plus an .instruction paragraph,
   optionally followed by a link out. They carry no form, so without this they
   fall back to bare browser defaults. */

.instruction {
  margin: 0 0 22px;
  color: var(--nx-ink-2);
  font-size: 0.95rem;
  line-height: 1.6;
}

.instruction:last-child { margin-bottom: 0; }

#kc-info-message:empty { display: none; }
#kc-info-message p:not(.instruction) { margin: 10px 0 0; }

/* the link out is the page's secondary action — on logout-confirm it is the
   way back, so it gets the same weight as a cancel button */
#kc-info-message p:not(.instruction) > a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 20px;
  border: 1px solid var(--nx-line-strong);
  border-radius: var(--nx-radius-sm);
  background: var(--nx-surface);
  color: var(--nx-ink);
  font-size: 0.975rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

#kc-info-message p:not(.instruction) > a:hover {
  background: var(--nx-surface-2);
  border-color: var(--nx-ink-3);
}

/* ── Inline note (passkey hint on the OTP step) ─────────────────────────── */

.nx-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 24px;
  padding: 13px 15px;
  background: var(--nx-surface-2);
  border: 1px solid var(--nx-line);
  border-radius: var(--nx-radius-sm);
}

.nx-note > .nx-i {
  font-size: 1.05rem;
  margin-top: 0.15em;
  color: var(--nx-orange-600);
}

.nx-note p {
  margin: 0;
  color: var(--nx-ink-2);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.nx-note p + p {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--nx-line);
}

.nx-note strong { color: var(--nx-ink); font-weight: 500; }
.nx-note a { color: var(--nx-orange-600); font-weight: 500; text-decoration: none; }
.nx-note a:hover { text-decoration: underline; }

/* ── Footer ────────────────────────────────────────────────────────────── */

.nx-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 24px 0 0;
  color: var(--nx-ink-3);
  font-family: var(--nx-mono);
  font-size: 0.7rem;
  letter-spacing: 0.015em;
}

.nx-foot .nx-i { font-size: 0.9rem; }

/* Help link in the footer: same muted weight as the hostname beside it, so the
   footer stays a footer. Only the link brightens on hover. */
.nx-foot__sep { opacity: 0.5; }

.nx-foot__help {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--nx-ink-3);
}

.nx-foot__help:hover,
.nx-foot__help:focus-visible {
  color: var(--nx-orange-600);
  text-decoration-color: var(--nx-orange-600);
}

/* ── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .nx-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .nx-brand {
    width: 100%;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 26px), 0 100%);
  }

  .nx-brand__inner {
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 28px), 0 calc(100% - 2px));
    justify-content: center;
    gap: 12px;
    padding: 24px clamp(20px, 6vw, 40px) 48px;
  }

  .nx-brand__logo { width: 158px; }
  .nx-brand__headline { font-size: 1.15rem; letter-spacing: -0.012em; }
  .nx-brand__sub,
  .nx-brand__foot { display: none; }

  /* on a phone the form should sit under the band, not float mid-screen */
  .nx-main { padding: 34px clamp(20px, 6vw, 40px) 32px; }
  .nx-panel { max-width: 420px; margin: 0 auto; }
  .nx-foot { margin-top: auto; padding-top: 32px; }

  /* absolute placement would collide with the page title on a narrow column */
  .nx-locale {
    position: static;
    display: flex;
    justify-content: flex-end;
    margin-bottom: 14px;
  }
}

@media (max-width: 420px) {
  #kc-page-title { font-size: 1.35rem; }
  .nx-codes__list { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  .nx-btn--primary:active { transform: none; }
}

@media (forced-colors: active) {
  .nx-input, .nx-btn, .nx-authlist__item, .nx-tile { border: 1px solid CanvasText; }
  .nx-i { background-color: CanvasText; }
}

/* ── Language switch (DE | EN) ─────────────────────────────────────────── */

.nx-langswitch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--nx-line);
  border-radius: 999px;
  background: var(--nx-surface);
}

.nx-langswitch__opt {
  min-width: 2.6em;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--nx-ink-2);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-align: center;
  text-decoration: none;
}

.nx-langswitch__opt:hover { color: var(--nx-ink); }
.nx-langswitch__opt:focus-visible { outline: none; box-shadow: var(--nx-ring); }

.nx-langswitch__opt.is-current {
  background: var(--nx-orange);
  color: var(--nx-orange-ink);
}
