/*
 * SYSMNT Virtual: Keycloak login theme.
 * Layout, spacing, radii and colours follow design/screens/02_login_totp.html and 03_totp_setup.html;
 * colour / radius / motion tokens come from design/tokens.json.
 * Fonts: brand fonts only, no web-font downloads. When the licensed WOFF2 files are added to
 * resources/fonts/, declare them here with @font-face (local url(), never a CDN).
 * Directional properties use logical values so Arabic (RTL) and English (LTR) both work.
 */

:root {
    --sx-blue: #1B459B;
    --sx-blue-dark: #14336F;
    --sx-blue-tint: #E8EDF7;
    --sx-white: #FFFFFF;
    --sx-seashell: #FFFCF9;
    --sx-bone: #E8DFD1;
    --sx-gray1: #F2EFED;
    --sx-gray2: #E6E3E1;
    --sx-gray3: #CCCAC8;
    --sx-gray5: #807E7D;
    --sx-gray6: #403F3E;
    --sx-ink: #111111;
    --sx-muted: #6E6C6B;
    --sx-success-bg: #E6F4EC;
    --sx-success-fg: #1E6B43;
    --sx-warning-bg: #FDE9DB;
    --sx-warning-fg: #A84A06;
    --sx-danger: #B23A12;
    --sx-danger-bg: #FBECE7;
    --sx-ring: 0 0 0 3px rgba(27, 69, 155, 0.28);
    --sx-ring-danger: 0 0 0 3px rgba(178, 58, 18, 0.24);
    --sx-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

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

body.sx-body {
    margin: 0;
    min-height: 100vh;
    background: var(--sx-seashell);
    color: var(--sx-ink);
    font-family: 'FT Sofia Pro', 'GE SS Two', sans-serif;
}

a { color: var(--sx-blue); }
a:hover { color: var(--sx-blue-dark); }

:focus-visible { outline: 3px solid var(--sx-blue); outline-offset: 2px; }

input, button, select, textarea { font: inherit; color: inherit; }

.sx-sr {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.sx-svg { flex: none; display: block; }

/* ---------- Shell: brand panel + form panel (flex-wrap stacks them on narrow screens) ---------- */

.sx-shell {
    display: flex;
    flex-wrap: wrap;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--sx-seashell);
}

.sx-brand {
    flex: 1 1 520px;
    position: relative;
    overflow: hidden;
    background: var(--sx-blue);
    color: var(--sx-white);
    padding: 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 32px;
    min-height: 420px;
}

.sx-brand :focus-visible { outline-color: var(--sx-white); }

.sx-brand__top {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* Logo exactly as supplied: size only, no filter / crop / rotation. */
.sx-brand__logo { display: block; width: 190px; height: auto; }

/* Motif: the design's treatment (invert + 22% opacity). Placed at the panel's inner edge. */
.sx-brand__motif {
    position: absolute;
    inset-inline-end: -60px;
    bottom: -40px;
    width: 560px;
    height: auto;
    opacity: 0.22;
    filter: invert(1);
    pointer-events: none;
    user-select: none;
}

.sx-brand__copy {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 460px;
}

.sx-brand__title { margin: 0; font-size: 44px; font-weight: 700; line-height: 1.2; }
.sx-brand__text { margin: 0; font-size: 17px; line-height: 1.8; opacity: 0.88; }

.sx-brand__foot {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 13px;
    opacity: 0.75;
}

.sx-locale__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 999px;
    color: var(--sx-white);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
.sx-locale__link:hover { color: var(--sx-white); background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.7); }

.sx-main {
    flex: 1 1 520px;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}

.sx-shell--wide .sx-main { flex: 1.3 1 620px; padding: 40px 32px; }

.sx-panel {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    animation: sx-fadeup 0.45s var(--sx-ease) both;
}

.sx-shell--wide .sx-panel { max-width: 640px; gap: 20px; }

@keyframes sx-fadeup { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes sx-grow { from { transform: scaleX(0); } to { transform: none; } }

/* ---------- Steps indicator ---------- */

.sx-steps { display: flex; gap: 8px; margin: 0; padding: 0; list-style: none; }
.sx-steps__item { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.sx-steps__bar { display: block; height: 4px; border-radius: 4px; background: var(--sx-gray2); }
.sx-steps__item.is-done .sx-steps__bar,
.sx-steps__item.is-current .sx-steps__bar { background: var(--sx-blue); }
.sx-steps__item.is-current .sx-steps__bar { transform-origin: right center; animation: sx-grow 0.7s var(--sx-ease) both; }
[dir="ltr"] .sx-steps__item.is-current .sx-steps__bar { transform-origin: left center; }
.sx-steps__label { font-size: 12px; font-weight: 400; color: var(--sx-muted); }
.sx-steps__item.is-current .sx-steps__label { color: var(--sx-blue); font-weight: 600; }

/* ---------- Signed-in account chip ---------- */

.sx-user {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--sx-gray1);
    border-radius: 14px;
    min-height: 55px;      /* the design's two-line chip; Keycloak only exposes the e-mail */
    padding: 10px 14px;
    font-size: 14px;
}
.sx-user__avatar {
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--sx-bone);
    color: var(--sx-blue);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
}
.sx-user__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sx-user__name { font-weight: 700; overflow-wrap: anywhere; text-align: start; }
[dir="rtl"] .sx-user__name { text-align: right; }
.sx-user__change {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    margin: -6px -8px;
    padding: 0 8px;
    border-radius: 10px;
    font-size: 13px;
}

/* ---------- Page heading ---------- */

.sx-head { display: flex; flex-direction: column; gap: 8px; }
.sx-shell--wide .sx-head { gap: 6px; }
.sx-head__icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--sx-blue-tint);
    color: var(--sx-blue);
    display: flex;
    align-items: center;
    justify-content: center;
}
.sx-head__title { margin: 0; font-size: 28px; font-weight: 700; }
.sx-head__intro { margin: 0; font-size: 15px; color: var(--sx-muted); line-height: 1.7; }
.sx-head__intro b, .sx-head__intro strong { color: var(--sx-ink); }
.sx-head__required { margin: 0; font-size: 13px; color: var(--sx-muted); }
.required { color: var(--sx-danger); }

/* ---------- Content, forms and fields ---------- */

.sx-content, .sx-form { display: flex; flex-direction: column; gap: 22px; }
.sx-shell--wide .sx-content, .sx-shell--wide .sx-form { gap: 20px; }

.sx-field { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; border: 0; min-width: 0; }
.sx-label { padding: 0; font-size: 14px; font-weight: 600; }

.sx-input {
    display: block;
    width: 100%;
    min-height: 52px;
    margin: 0;
    padding: 0 16px;
    border: 1.5px solid var(--sx-gray3);
    border-radius: 14px;
    background: var(--sx-white);
    color: var(--sx-ink);
    font-size: 16px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.sx-input:hover { border-color: var(--sx-gray5); }
.sx-input:focus { outline: none; border-color: var(--sx-blue); box-shadow: var(--sx-ring); }
.sx-input[aria-invalid="true"] { border-color: var(--sx-danger); }
.sx-input[aria-invalid="true"]:focus { box-shadow: var(--sx-ring-danger); }
.sx-input::placeholder { color: var(--sx-muted); opacity: 1; }
.sx-input:-webkit-autofill { -webkit-box-shadow: 0 0 0 100px var(--sx-white) inset; -webkit-text-fill-color: var(--sx-ink); }
.sx-input:-webkit-autofill:focus { -webkit-box-shadow: 0 0 0 100px var(--sx-white) inset, var(--sx-ring); }
.sx-input--code { font-family: ui-monospace, monospace; font-size: 18px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
.sx-input--code::placeholder { font-weight: 400; letter-spacing: 1px; }

.sx-input-group { position: relative; }
.sx-input-group .sx-input { padding-right: 56px; }
.sx-reveal {
    position: absolute;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--sx-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.sx-reveal:hover { color: var(--sx-blue); background: var(--sx-gray1); }
.sx-eye {
    display: block;
    width: 20px;
    height: 20px;
    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='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%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='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
}
.sx-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='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3l18 18'/%3E%3Cpath d='M10.6 5.1A10.4 10.4 0 0 1 12 5c6.4 0 10 7 10 7a17.6 17.6 0 0 1-3.2 4.1'/%3E%3Cpath d='M6.6 6.6C3.9 8.4 2 12 2 12s3.6 7 10 7c1.7 0 3.2-.5 4.5-1.2'/%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='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3l18 18'/%3E%3Cpath d='M10.6 5.1A10.4 10.4 0 0 1 12 5c6.4 0 10 7 10 7a17.6 17.6 0 0 1-3.2 4.1'/%3E%3Cpath d='M6.6 6.6C3.9 8.4 2 12 2 12s3.6 7 10 7c1.7 0 3.2-.5 4.5-1.2'/%3E%3Cpath d='M9.9 9.9a3 3 0 0 0 4.2 4.2'/%3E%3C/svg%3E");
}

.sx-hint {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 13px;
    color: var(--sx-muted);
    line-height: 1.6;
}
.sx-hint svg { flex: none; }

.sx-field-error {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--sx-danger);
}
.sx-field-error .sx-svg { margin-top: 2px; }

.sx-options { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.sx-options__link { font-size: 14px; }

.sx-check {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    font-size: 14px;
    color: var(--sx-gray6);
    cursor: pointer;
}
.sx-check input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--sx-blue); cursor: pointer; }
.sx-check--confirm {
    padding: 4px 14px;
    border: 1px solid var(--sx-gray2);
    border-radius: 14px;
    background: var(--sx-white);
    color: var(--sx-ink);
    font-weight: 600;
}

/* ---------- Six-box code field: ONE real input over six decorative boxes ---------- */

.sx-otp {
    --sx-otp-box-max: 52px;
    --sx-otp-box: min(var(--sx-otp-box-max), (100cqw - 30px) / 6);
    position: relative;
    align-self: stretch;
    height: 60px;
    overflow: hidden;      /* clips the input's spare width (see .sx-otp__input) */
    container-type: inline-size;
    direction: ltr;
}
.sx-otp--setup { --sx-otp-box-max: 50px; align-self: flex-start; width: min(100%, 350px); }
/* Design 03 lays the boxes out in a dir="ltr" row, so they sit at the left edge in Arabic too. */
[dir="rtl"] .sx-otp--setup { align-self: flex-end; }

.sx-otp__boxes {
    display: flex;
    justify-content: space-between;
    height: 60px;
    pointer-events: none;
}
.sx-otp__box {
    flex: none;
    width: 52px;           /* fallback without container units */
    width: var(--sx-otp-box);
    height: 60px;
    border-radius: 14px;
    border: 1.5px solid var(--sx-gray3);
    background: var(--sx-white);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.sx-otp__box.is-filled { border-color: var(--sx-blue); }
/* Focus: the box that receives the next digit gets a 3px blue frame, drawn inside the box. */
.sx-otp__box.is-active { border-color: var(--sx-blue); box-shadow: inset 0 0 0 1.5px var(--sx-blue), inset 0 0 0 6px rgba(27, 69, 155, 0.08); }
.sx-otp:not(.sx-otp--js):focus-within .sx-otp__box { border-color: var(--sx-blue); box-shadow: inset 0 0 0 1.5px var(--sx-blue); }
.sx-otp--error .sx-otp__box,
.sx-otp--error .sx-otp__box.is-filled { border-color: var(--sx-danger); }
.sx-otp--error .sx-otp__box.is-active { border-color: var(--sx-danger); box-shadow: inset 0 0 0 1.5px var(--sx-danger), inset 0 0 0 6px rgba(178, 58, 18, 0.08); }

/*
 * The digits are typed into one transparent input whose character pitch equals the box pitch:
 * advance per digit = 1ch + letter-spacing = (container width - box width) / 5.
 * The input is wider than the boxes so the browser never scrolls its text; the excess is clipped.
 */
.sx-otp__input {
    position: absolute;
    top: 0;
    left: 0;
    right: -64px;
    height: 60px;
    margin: 0;
    padding: 0 0 0 calc((var(--sx-otp-box) - 1ch) / 2);
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--sx-ink);
    caret-color: var(--sx-blue);
    font-family: ui-monospace, monospace;
    font-size: 24px;
    font-weight: 600;
    line-height: 60px;
    letter-spacing: 12px; /* fallback without container units */
    letter-spacing: calc((100cqw - var(--sx-otp-box)) / 5 - 1ch);
    text-align: left;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}
.sx-otp__input:-webkit-autofill,
.sx-otp__input:autofill {
    -webkit-text-fill-color: var(--sx-ink);
    transition: background-color 600000s 0s, color 600000s 0s;
}

/* ---------- Buttons and links ---------- */

.sx-actions { display: flex; flex-direction: column; gap: 12px; }

.sx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
    margin: 0;
    padding: 0 20px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.sx-btn:focus-visible { outline-offset: 3px; }
.sx-btn--primary { width: 100%; border: 0; background: var(--sx-blue); color: var(--sx-white); -webkit-appearance: none; appearance: none; }
.sx-btn--primary:hover { background: var(--sx-blue-dark); color: var(--sx-white); }
.sx-btn--primary:disabled { opacity: 0.45; cursor: not-allowed; }
.sx-btn--primary:disabled:hover { background: var(--sx-blue); }
.sx-btn--secondary {
    min-height: 44px;
    padding: 0 18px;
    border-radius: 12px;
    border: 1px solid var(--sx-gray3);
    background: var(--sx-white);
    color: var(--sx-ink);
    font-size: 14.5px;
}
.sx-btn--secondary:hover { border-color: var(--sx-blue); color: var(--sx-blue); }
.sx-btn--block { width: 100%; }
.sx-btn--ghost { width: 100%; border: 1px solid var(--sx-gray3); background: transparent; color: var(--sx-ink); }
.sx-btn--ghost:hover { border-color: var(--sx-blue); color: var(--sx-blue); }

/* 44px target, but only the text's height counts towards the 22px rhythm of the design. */
.sx-switch { display: flex; justify-content: center; margin: -11px 0; }
.sx-linkbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 10px;
    border: 0;
    border-radius: 10px;
    background: none;
    color: var(--sx-blue);
    font-size: 14px;
    text-align: center;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}
.sx-linkbtn:hover { color: var(--sx-blue-dark); }

/* ---------- Notes and messages ---------- */

.sx-note {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: var(--sx-gray1);
    border-radius: 14px;
    padding: 14px;
    font-size: 13px;
    color: var(--sx-gray6);
    line-height: 1.7;
}

.sx-alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.7;
    animation: sx-fadeup 0.4s var(--sx-ease) both;
}
.sx-alert .sx-svg { margin-top: 2px; }
.sx-alert--error { background: var(--sx-danger-bg); color: var(--sx-danger); }
.sx-alert--warning { background: var(--sx-warning-bg); color: var(--sx-warning-fg); }
.sx-alert--success { background: var(--sx-success-bg); color: var(--sx-success-fg); }
.sx-alert--info { background: var(--sx-blue-tint); color: var(--sx-blue); }
.sx-alert a { color: inherit; font-weight: 600; }

/* ---------- Authenticator setup (QR + manual key + numbered steps) ---------- */

.sx-totp { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.sx-qr {
    flex: none;
    margin: 0;
    padding: 16px;
    background: var(--sx-white);
    border: 1px solid var(--sx-gray2);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
/*
 * Keycloak's QR PNG (246px) carries its own white quiet zone (>= 16px of it at 4 px/module).
 * Drawing it at 172px and letting that white margin overlap the card's white padding gives the
 * design's ~150px code while the card padding still provides the quiet zone scanners need.
 */
.sx-qr img { display: block; width: 172px; height: 172px; margin: -11px; }
.sx-qr figcaption { font-size: 12px; color: var(--sx-muted); }
.sx-howto {
    flex: 1 1 260px;
    min-width: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.sx-howto li { display: flex; gap: 10px; }
.sx-howto__n {
    flex: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--sx-blue-tint);
    color: var(--sx-blue);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sx-howto__text { min-width: 0; font-size: 14.5px; line-height: 1.7; }
.sx-howto--actions { flex: none; gap: 12px; }
.sx-howto--actions .sx-howto__text { padding-top: 2px; font-size: 15px; font-weight: 600; }
.sx-key {
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    font-family: ui-monospace, monospace;
    font-weight: 600;
    background: var(--sx-gray1);
    border-radius: 6px;
    padding: 2px 8px;
    overflow-wrap: anywhere;
    user-select: all;
    -webkit-user-select: all;
}

/* ---------- Recovery codes ---------- */

.sx-codes {
    background: var(--sx-white);
    border: 1px solid var(--sx-gray2);
    border-radius: 20px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.sx-codes__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.sx-codes__title { margin: 0; font-size: 16px; font-weight: 700; }
.sx-codes__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sx-codes__note { margin: 0; font-size: 13px; color: var(--sx-muted); line-height: 1.6; }
.sx-codes__list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.sx-codes__item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
    padding: 7px 6px;
    border-radius: 8px;
    background: var(--sx-gray1);
}
.sx-codes__item code {
    font-family: ui-monospace, monospace;
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: 1px;
    white-space: nowrap;
}
.sx-codes__n { flex: none; min-width: 2ch; font-size: 11.5px; font-weight: 600; color: var(--sx-muted); text-align: end; }
.sx-codes__status { margin: 0; min-height: 1em; font-size: 13px; color: var(--sx-success-fg); }
.sx-codes__status:empty { display: none; }

/* ---------- Choose another method ---------- */

.sx-choices { display: flex; flex-direction: column; gap: 12px; }
.sx-choice {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 72px;
    margin: 0;
    padding: 14px 16px;
    border: 1px solid var(--sx-gray2);
    border-radius: 14px;
    background: var(--sx-white);
    color: var(--sx-ink);
    text-align: start;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.sx-choice:hover { border-color: var(--sx-blue); box-shadow: 0 10px 24px -18px rgba(17, 17, 17, 0.35); }
.sx-choice__icon {
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--sx-blue-tint);
    color: var(--sx-blue);
    display: flex;
    align-items: center;
    justify-content: center;
}
.sx-choice__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sx-choice__title { font-size: 15px; font-weight: 700; }
.sx-choice__text { font-size: 13px; color: var(--sx-muted); line-height: 1.6; }
.sx-choice__arrow { flex: none; color: var(--sx-muted); }
[dir="ltr"] .sx-choice__arrow .sx-svg { transform: scaleX(-1); }

/* ---------- Several authenticators: device picker ---------- */

.sx-devices__list { display: flex; flex-wrap: wrap; gap: 8px; }
.sx-device {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--sx-gray3);
    border-radius: 12px;
    background: var(--sx-white);
    font-size: 14px;
    cursor: pointer;
}
.sx-device input { width: 18px; height: 18px; margin: 0; accent-color: var(--sx-blue); }
.sx-device:has(input:checked) { border-color: var(--sx-blue); color: var(--sx-blue); }

/* ---------- Social providers (not used by the platform; kept usable) ---------- */

.sx-social { display: flex; flex-direction: column; gap: 12px; }
.sx-social__title { margin: 0; font-size: 14px; font-weight: 600; color: var(--sx-muted); }
.sx-social__list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.sx-social .is-disabled { pointer-events: none; opacity: 0.5; }

/* ---------- Keycloak pages this theme does not override (info, error, expired, logout, ...) ---------- */

.sx-content .instruction { margin: 0; font-size: 15px; line-height: 1.7; color: var(--sx-gray6); }
.sx-content #kc-info-message,
.sx-content #kc-error-message,
.sx-content #kc-logout-confirm,
.sx-content .form-actions { display: flex; flex-direction: column; gap: 16px; margin: 0; }
.sx-content #kc-info-message p,
.sx-content #kc-error-message p { margin: 0; }
.sx-content #kc-info-message b { color: var(--sx-ink); }
.sx-content #kc-info-message a,
.sx-content #kc-error-message a,
.sx-content input[type="submit"]:not(.sx-btn),
.sx-content button[type="submit"]:not(.sx-btn):not(.sx-linkbtn):not(.sx-choice) {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    padding: 0 20px;
    border: 0;
    border-radius: 14px;
    background: var(--sx-blue);
    color: var(--sx-white);
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}
.sx-content #kc-info-message a:hover,
.sx-content #kc-error-message a:hover,
.sx-content input[type="submit"]:not(.sx-btn):hover { background: var(--sx-blue-dark); color: var(--sx-white); }
.sx-content #kc-decline { background: transparent; color: var(--sx-ink); border: 1px solid var(--sx-gray3); }
.sx-content input[type="text"]:not(.sx-input):not(.sx-otp__input),
.sx-content input[type="email"]:not(.sx-input),
.sx-content input[type="password"]:not(.sx-input),
.sx-content select,
.sx-content textarea {
    width: 100%;
    min-height: 52px;
    padding: 0 16px;
    border: 1.5px solid var(--sx-gray3);
    border-radius: 14px;
    background: var(--sx-white);
    font-size: 16px;
}
.sx-content label:not(.sx-check):not(.sx-device):not(.sx-label) { font-size: 14px; font-weight: 600; }
.sx-content #instruction1 a, .sx-content .instruction a { font-weight: 600; }

/* ---------- Responsive: stacked panels, then a compact brand panel on phones ---------- */

/* Stacked: pack the two rows at the top so short pages don't stretch the brand panel. */
@media (max-width: 1039px) {
    .sx-shell { align-content: flex-start; }
    .sx-brand { min-height: 0; padding: 40px; }
    .sx-brand__copy { max-width: 560px; }
}
@media (max-width: 1139px) {
    .sx-shell--wide { align-content: flex-start; }
    .sx-shell--wide .sx-brand { min-height: 0; padding: 40px; }
}

@media (max-width: 719px) {
    .sx-brand,
    .sx-shell--wide .sx-brand { padding: 16px 20px 24px; gap: 14px; }
    .sx-brand__logo { width: 140px; }
    .sx-brand__motif { width: 340px; bottom: -150px; inset-inline-end: -70px; }
    .sx-brand__copy { gap: 8px; }
    .sx-brand__title { font-size: 26px; }
    .sx-brand__text { font-size: 14px; line-height: 1.7; }
    .sx-brand__foot { display: none; }
    .sx-locale__link { padding: 0 14px; font-size: 13.5px; }

    .sx-main,
    .sx-shell--wide .sx-main { align-items: flex-start; padding: 28px 20px 40px; }
    .sx-codes { padding: 16px; }
    .sx-codes__list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
    .sx-codes__item { gap: 6px; padding: 7px 4px; }
    .sx-codes__item code { font-size: 13px; letter-spacing: 0.5px; }
    .sx-codes__actions { width: 100%; }
    .sx-codes__actions .sx-btn { flex: 1 1 0; padding: 0 10px; }
}

/* ---------- Windows High Contrast: box-shadow focus rings are dropped there, use outlines ---------- */

@media (forced-colors: active) {
    .sx-input:focus, .sx-choice:focus-visible { outline: 2px solid Highlight; outline-offset: 2px; }
    .sx-otp__box.is-active, .sx-otp:not(.sx-otp--js):focus-within .sx-otp__box { outline: 2px solid Highlight; outline-offset: -6px; }
    .sx-btn--primary:disabled { opacity: 1; color: GrayText; border: 1px solid GrayText; }
}

/* ---------- Motion and print ---------- */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

@media print {
    body.sx-body, .sx-shell { background: #FFFFFF; min-height: 0; }
    .sx-brand, .sx-steps, .sx-user, .sx-head__icon, .sx-switch, .sx-note { display: none !important; }
    .sx-main { padding: 0; }
    .sx-panel { max-width: none; animation: none; }
    [data-page-id="login-login-recovery-authn-code-config"] .sx-head__intro,
    [data-page-id="login-login-recovery-authn-code-config"] .sx-codes__actions,
    [data-page-id="login-login-recovery-authn-code-config"] .sx-codes__status,
    [data-page-id="login-login-recovery-authn-code-config"] .sx-check,
    [data-page-id="login-login-recovery-authn-code-config"] .sx-alert,
    [data-page-id="login-login-recovery-authn-code-config"] #kc-recovery-codes-settings-form { display: none !important; }
    .sx-codes { border-color: #999999; }
    .sx-codes__item { border: 1px solid #CCCCCC; }
}
