/* ==========================================================================
   STOX Ledger — authentication pages  (stx-auth.css)

   One stylesheet for Sign in / Sign up / Forgot + Reset password / OTP /
   Lockout / Access denied / e-mail confirmation pages (Views/Shared/_AuthLayout).
   Built only on stx-tokens.css: every colour, radius, font and control height
   comes from --stx-* tokens, so light/dark and every accent follow the shell.
   Replaces: Template theme*.css, identity-layout.css, Login.css,
   AuthSlider.css, VerifyOtp.css and Registration/Index.css on these pages.
   ========================================================================== */

/* ---- Base ------------------------------------------------------------------ */
html[data-auth] { -webkit-text-size-adjust: 100%; color-scheme: light; }
html[data-auth][data-wd-theme="dark"] { color-scheme: dark; }
html[data-auth] *, html[data-auth] *::before, html[data-auth] *::after { box-sizing: border-box; }

.stx-auth-body {
    margin: 0;
    min-height: 100vh;
    background: var(--stx-canvas);
    color: var(--stx-text);
    font-family: var(--stx-font-sans);
    font-size: var(--stx-fs-body);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}
/* resets use :where() (zero specificity) so every component class wins over them */
:where(.stx-auth-body) :where(h1, h2, h3, p) { margin: 0; }
:where(.stx-auth-body) :where(img) { max-width: 100%; display: block; }
:where(.stx-auth-body) :where(button, input, select, textarea) { font: inherit; color: inherit; }
.stx-auth-body [hidden] { display: none !important; }
.stx-auth-body ::selection { background: rgba(var(--stx-accent-rgb), .2); }
.stx-auth-body :focus-visible { outline: 2px solid var(--stx-focus); outline-offset: 2px; }
.stx-auth-body [tabindex="-1"]:focus { outline: none; } /* programmatic focus targets (headings, main) */
.stx-auth-body input:-webkit-autofill,
.stx-auth-body input:-webkit-autofill:hover,
.stx-auth-body input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--stx-text);
    -webkit-box-shadow: 0 0 0 1000px var(--stx-surface) inset;
    caret-color: var(--stx-text);
    transition: background-color 9999s;
}

.stx-sr, .stx-auth-body .visually-hidden {
    position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important;
    margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important;
}
.stx-skip {
    position: absolute; left: 12px; top: -48px; z-index: 100; padding: 8px 14px; border-radius: var(--stx-radius-2);
    background: var(--stx-surface); color: var(--stx-heading); box-shadow: var(--stx-shadow-md); font-weight: 600; text-decoration: none;
}
.stx-skip:focus { top: 12px; }

/* ---- Shell: brand panel + form area ---------------------------------------- */
.stx-auth { display: grid; grid-template-columns: minmax(0, 44fr) minmax(0, 56fr); min-height: 100vh; }
.stx-auth__main { display: flex; flex-direction: column; min-width: 0; background: var(--stx-canvas); }
@media (min-width: 992px) {
    .stx-auth { height: 100vh; }
    .stx-auth__main { overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none; }
    .stx-auth__main::-webkit-scrollbar { display: none; }
}

/* brand */
.stx-brand {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding: 40px clamp(32px, 4vw, 56px);
    color: #fff;
    background: #0b1733;
    --stx-brand-mix: color-mix(in srgb, rgb(var(--stx-accent-rgb)) 78%, #0b1733);
}
.stx-brand__bg { position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(120% 80% at 100% 100%, var(--stx-brand-mix) 0%, transparent 60%),
        radial-gradient(70% 60% at 0% 0%, rgba(255, 255, 255, .06) 0%, transparent 70%),
        linear-gradient(160deg, #0a1530 0%, #0e2452 55%, var(--stx-brand-mix) 120%);
}
.stx-brand__bg::after { /* subtle ledger grid */
    content: ""; position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(90% 70% at 30% 35%, #000 0%, transparent 85%);
    mask-image: radial-gradient(90% 70% at 30% 35%, #000 0%, transparent 85%);
}
.stx-brand__logo { display: inline-flex; align-self: flex-start; border-radius: var(--stx-radius-1); }
.stx-brand__logo img { height: 44px; width: auto; }
.stx-brand__body { flex: 1; display: flex; align-items: center; }
.stx-brand__variant { display: none; max-width: 440px; }
.stx-auth[data-mode="signin"]   [data-brand-for="signin"],
.stx-auth[data-mode="register"] [data-brand-for="register"],
.stx-auth[data-mode="recovery"] [data-brand-for="recovery"],
.stx-auth[data-mode="reset"]    [data-brand-for="reset"],
.stx-auth[data-mode="verify"]   [data-brand-for="verify"],
.stx-auth[data-mode="notice"]   [data-brand-for="notice"] { display: block; animation: stx-fade-in var(--stx-dur-3) var(--stx-ease); }
.stx-brand__eyebrow {
    display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px;
    font-size: var(--stx-fs-xs); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .8);
}
.stx-brand__eyebrow::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: currentColor; opacity: .8; }
.stx-brand__title { font-size: clamp(1.75rem, 2.4vw, 2.25rem); line-height: 1.15; font-weight: 800; letter-spacing: -.025em; color: #fff; }
.stx-brand__lead { margin-top: 10px; font-size: 1rem; color: rgba(255, 255, 255, .82); }
.stx-brand__features { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 18px; }
.stx-brand__features li { display: flex; gap: 14px; align-items: flex-start; }
.stx-brand__features strong { display: block; font-size: var(--stx-fs-body); font-weight: 650; color: #fff; }
.stx-brand__features li > span:last-child > span { display: block; font-size: var(--stx-fs-sm); color: rgba(255, 255, 255, .78); }
.stx-brand__ficon {
    flex: none; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
    border-radius: var(--stx-radius-2); background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14); font-size: 1.05rem;
}
.stx-brand__trust { display: flex; align-items: center; gap: 8px; font-size: var(--stx-fs-xs); color: rgba(255, 255, 255, .78); letter-spacing: .02em; }

/* form area */
.stx-auth__topbar { display: flex; align-items: center; gap: 12px; padding: 12px clamp(16px, 3vw, 28px); }
.stx-auth__mlogo { display: none; margin-right: auto; border-radius: var(--stx-radius-1); }
.stx-auth__mlogo img { height: 36px; width: auto; }
.stx-auth__tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.stx-logo-dark { display: none !important; }
html[data-wd-theme="dark"] .stx-logo-light { display: none !important; }
html[data-wd-theme="dark"] .stx-logo-dark { display: block !important; }

.stx-auth__stage {
    flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 4px clamp(16px, 3vw, 28px) 16px; outline: 0;
}
.stx-auth__foot { padding: 0 24px 14px; text-align: center; font-size: var(--stx-fs-xs); color: var(--stx-text-muted); }

/* Tablet: brand becomes a short top banner (logo + headline) */
@media (max-width: 991.98px) {
    .stx-auth { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
    .stx-brand { flex-direction: row; align-items: center; gap: 24px; padding: 18px 28px; }
    .stx-brand__logo img { height: 34px; }
    .stx-brand__body { justify-content: flex-end; }
    .stx-brand__variant { max-width: none; text-align: right; }
    .stx-brand__eyebrow, .stx-brand__lead, .stx-brand__features, .stx-brand__trust { display: none; }
    .stx-brand__title { font-size: 1.25rem; }
}
/* Mobile: no brand panel, logo above the card, 44px touch targets */
@media (max-width: 767.98px) {
    html[data-auth] { --stx-control-h: 44px; }
    .stx-icon-btn, .stx-help__btn { width: 44px; height: 44px; }
    .stx-check, .stx-step { min-height: 44px; }
    .stx-upload__actions .stx-btn { height: 40px; }
    .stx-brand { display: none; }
    .stx-auth { grid-template-rows: 1fr; }
    .stx-auth__mlogo { display: inline-flex; }
    .stx-auth__topbar { padding: 14px 16px 6px; }
    .stx-auth__stage { justify-content: flex-start; padding: 8px 16px 20px; }
}

/* ---- Top-bar tools: theme toggle + help ------------------------------------ */
.stx-icon-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0;
    border: 1px solid transparent; border-radius: var(--stx-radius-2); background: transparent; color: var(--stx-text-muted);
    cursor: pointer; font-size: 1.05rem; transition: background-color var(--stx-dur-1) var(--stx-ease), color var(--stx-dur-1) var(--stx-ease);
}
.stx-icon-btn:hover { background: var(--stx-nav-hover); color: var(--stx-heading); }
.stx-when-dark { display: none !important; }
html[data-wd-theme="dark"] .stx-when-dark { display: inline-block !important; }
html[data-wd-theme="dark"] .stx-when-light { display: none !important; }

.stx-help { position: relative; }
.stx-help__btn {
    display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; list-style: none; cursor: pointer;
    border-radius: var(--stx-radius-2); color: var(--stx-text-muted); font-size: var(--stx-fs-sm); font-weight: 600; user-select: none;
}
.stx-help__btn::-webkit-details-marker { display: none; }
.stx-help__btn:hover, .stx-help[open] .stx-help__btn { background: var(--stx-nav-hover); color: var(--stx-heading); }
.stx-help__menu {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 280px; padding: 6px;
    background: var(--stx-surface); border: 1px solid var(--stx-border); border-radius: var(--stx-radius-3); box-shadow: var(--stx-shadow-md);
    animation: stx-pop var(--stx-dur-2) var(--stx-ease);
}
.stx-help__menu a, .stx-help__menu p {
    display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: var(--stx-radius-2);
    color: var(--stx-text); text-decoration: none; font-size: var(--stx-fs-sm);
}
.stx-help__menu a:hover { background: var(--stx-surface-2); color: var(--stx-heading); }
.stx-help__menu p { color: var(--stx-text-muted); border-top: 1px solid var(--stx-border); border-radius: 0; margin-top: 4px; padding-top: 11px; }
.stx-help__menu i { color: var(--stx-text-faint); margin-top: 1px; }
@media (max-width: 479.98px) { .stx-help__btn span { display: none; } .stx-help__btn { width: 44px; height: 44px; justify-content: center; padding: 0; } }

/* ---- Card ------------------------------------------------------------------ */
.stx-card {
    width: 100%;
    max-width: 440px;
    background: var(--stx-surface);
    border: 1px solid var(--stx-border);
    border-radius: var(--stx-radius-3);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 32px rgba(16, 24, 40, .07);
    padding: clamp(20px, 2.6vw, 28px);
}
html[data-wd-theme="dark"] .stx-card { box-shadow: var(--stx-shadow-md); }
.stx-card--wide { max-width: 560px; }
.stx-card--center { text-align: center; }
.stx-card__head { margin-bottom: 18px; }
.stx-card__head--row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stx-card__title { font-size: 1.25rem; line-height: 1.25; font-weight: 750; letter-spacing: -.02em; color: var(--stx-heading); }
.stx-card__sub { margin-top: 4px; color: var(--stx-text-muted); font-size: var(--stx-fs-sm); }
.stx-card__sub strong { color: var(--stx-heading); font-weight: 650; }
.stx-card__icon {
    display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; margin-bottom: 14px;
    border-radius: 50%; font-size: 1.3rem; background: var(--stx-accent-soft); color: var(--stx-accent-strong);
    box-shadow: 0 0 0 6px rgba(var(--stx-accent-rgb), .06);
}
html[data-wd-theme="dark"] .stx-card__icon { color: var(--stx-accent); }
.stx-card--center .stx-card__icon { margin-left: auto; margin-right: auto; }
.stx-card__icon--success { background: var(--stx-success-bg); color: var(--stx-success) !important; box-shadow: 0 0 0 6px color-mix(in srgb, var(--stx-success) 8%, transparent); }
.stx-card__icon--danger  { background: var(--stx-danger-bg);  color: var(--stx-danger) !important;  box-shadow: 0 0 0 6px color-mix(in srgb, var(--stx-danger) 8%, transparent); }
.stx-card__icon--warning { background: var(--stx-warning-bg); color: var(--stx-warning) !important; box-shadow: 0 0 0 6px color-mix(in srgb, var(--stx-warning) 8%, transparent); }
.stx-card__foot { margin-top: 16px; text-align: center; color: var(--stx-text-muted); font-size: var(--stx-fs-sm); }
.stx-card__actions { display: grid; gap: 10px; margin-top: 22px; }
.stx-card__actions--row { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.stx-card__note { margin-top: 14px; font-size: var(--stx-fs-sm); color: var(--stx-text-muted); }
.stx-card__note strong { color: var(--stx-heading); }

/* Panels (single-page Sign in / Sign up / Forgot / OTP) */
.stx-panel { width: 100%; display: flex; flex-direction: column; align-items: center; }
.stx-panel.is-entering { animation: stx-panel-in var(--stx-dur-3) var(--stx-ease) both; }

/* ---- Inline alerts --------------------------------------------------------- */
.stx-alert {
    display: flex; gap: 10px; align-items: flex-start; margin-bottom: 18px; padding: 10px 12px;
    border: 1px solid transparent; border-radius: var(--stx-radius-2); font-size: var(--stx-fs-sm); line-height: 1.45;
    animation: stx-fade-in var(--stx-dur-2) var(--stx-ease);
}
.stx-alert > i { font-size: 1rem; line-height: 1.3; flex: none; }
.stx-alert__body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.stx-alert__body a { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.stx-alert ul { margin: 0; padding-left: 18px; }
.stx-alert--danger  { background: var(--stx-danger-bg);  color: var(--stx-danger);  border-color: color-mix(in srgb, var(--stx-danger) 22%, transparent); }
.stx-alert--success { background: var(--stx-success-bg); color: var(--stx-success); border-color: color-mix(in srgb, var(--stx-success) 22%, transparent); }
.stx-alert--warning { background: var(--stx-warning-bg); color: var(--stx-warning); border-color: color-mix(in srgb, var(--stx-warning) 22%, transparent); }
.stx-alert--info    { background: var(--stx-info-bg);    color: var(--stx-info);    border-color: color-mix(in srgb, var(--stx-info) 22%, transparent); }

/* ---- Fields ------------------------------------------------------------------ */
.stx-form { display: block; }
.stx-field { margin-bottom: 2px; min-width: 0; }
.stx-field__row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.stx-label { display: block; margin-bottom: 5px; font-size: 12.5px; font-weight: 600; color: var(--stx-text); }
.stx-opt { font-weight: 500; color: var(--stx-text-muted); }
.stx-label .stx-req { color: var(--stx-danger); margin-left: 2px; }
.stx-field__row .stx-link { font-size: var(--stx-fs-sm); }
.stx-hint { display: block; margin-top: 4px; font-size: var(--stx-fs-xs); color: var(--stx-text-muted); }
.stx-field__msg {
    min-height: 19px; padding-top: 3px; display: flex; gap: 5px; align-items: flex-start;
    font-size: var(--stx-fs-xs); line-height: 1.35; color: var(--stx-danger);
}
.stx-field__msg:empty::before { content: ""; }
.stx-field__msg i { margin-top: 1px; }
.stx-field__msg + .stx-hint, .stx-hint + .stx-field__msg { margin-top: 0; }
.stx-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 14px; }
.stx-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 12px; }
@media (max-width: 575.98px) { .stx-grid-2, .stx-grid-3 { grid-template-columns: minmax(0, 1fr); } }

.stx-input { position: relative; display: flex; align-items: center; }
.stx-input__icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%); z-index: 1;
    color: var(--stx-text-faint); font-size: .95rem; pointer-events: none; line-height: 1;
    transition: color var(--stx-dur-1) var(--stx-ease);
}
.stx-input__control {
    display: block; width: 100%; height: var(--stx-control-h); margin: 0;
    padding: 0 var(--stx-control-px);
    background: var(--stx-surface); color: var(--stx-text);
    border: 1px solid var(--stx-border-strong); border-radius: var(--stx-radius-2);
    font-size: var(--stx-fs-body); line-height: 1.4;
    transition: border-color var(--stx-dur-1) var(--stx-ease), box-shadow var(--stx-dur-1) var(--stx-ease), background-color var(--stx-dur-1) var(--stx-ease);
    -webkit-appearance: none; appearance: none;
}
@media (max-width: 767.98px) { .stx-input__control { font-size: 16px; } } /* no iOS zoom on focus */
.stx-input__icon ~ .stx-input__control, .stx-input--icon .stx-input__control { padding-left: 38px; }
.stx-input--btn .stx-input__control { padding-right: 44px; }
.stx-input__control::placeholder { color: var(--stx-text-faint); opacity: 1; }
.stx-input__control:hover:not(:focus):not(:disabled):not([readonly]) { border-color: color-mix(in srgb, var(--stx-border-strong) 55%, var(--stx-text-faint)); }
.stx-input__control:focus, .stx-input__control:focus-visible, .stx-input__control.is-open {
    outline: 0; border-color: rgba(var(--stx-accent-rgb), .7); box-shadow: 0 0 0 3px rgba(var(--stx-accent-rgb), .2);
}
.stx-input:focus-within .stx-input__icon { color: var(--stx-accent); }
.stx-input__control[readonly], .stx-input__control:disabled { background: var(--stx-surface-2); color: var(--stx-text-muted); cursor: not-allowed; }
.stx-input__control[readonly] { cursor: default; }
.stx-input__btn {
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
    display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; max-height: calc(var(--stx-control-h) - 6px);
    border: 0; border-radius: var(--stx-radius-1); background: transparent; color: var(--stx-text-muted); cursor: pointer;
}
.stx-input__btn:hover { color: var(--stx-heading); background: var(--stx-nav-hover); }
.stx-input__btn:focus-visible { outline: 2px solid var(--stx-focus); outline-offset: 0; }

/* validation state — red only after a check, green only after the user typed a valid value */
.stx-field.is-invalid .stx-input__control { border-color: var(--stx-danger); }
.stx-field.is-invalid .stx-input__control:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--stx-danger) 20%, transparent); border-color: var(--stx-danger); }
.stx-field.is-invalid .stx-input__icon { color: var(--stx-danger); }
.stx-field.is-valid .stx-input__control { border-color: color-mix(in srgb, var(--stx-success) 70%, var(--stx-border-strong)); }

/* caps lock */
.stx-caps {
    display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 3px 8px; border-radius: var(--stx-radius-1);
    background: var(--stx-warning-bg); color: var(--stx-warning); font-size: var(--stx-fs-xs); font-weight: 600;
}

/* checkbox */
.stx-check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: var(--stx-fs-sm); color: var(--stx-text); user-select: none; min-height: 24px; }
.stx-check input {
    flex: none; width: 18px; height: 18px; margin: 0; cursor: pointer; display: grid; place-content: center;
    -webkit-appearance: none; appearance: none; border: 1px solid var(--stx-border-strong); border-radius: 5px; background: var(--stx-surface);
    transition: background-color var(--stx-dur-1) var(--stx-ease), border-color var(--stx-dur-1) var(--stx-ease);
}
.stx-check input::after { content: ""; width: 9px; height: 5px; border: 2px solid var(--stx-on-accent); border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg) scale(0); transition: transform var(--stx-dur-1) var(--stx-ease); }
.stx-check input:checked { background: var(--stx-accent); border-color: var(--stx-accent); }
.stx-check input:checked::after { transform: translateY(-1px) rotate(-45deg) scale(1); }
.stx-check input:focus-visible { outline: 2px solid var(--stx-focus); outline-offset: 2px; }
.stx-form__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; }

/* ---- Buttons & links --------------------------------------------------------- */
.stx-btn {
    position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: calc(var(--stx-control-h) + 4px); padding: 0 18px; margin: 0;
    border: 1px solid transparent; border-radius: var(--stx-radius-2);
    font-family: var(--stx-font-sans); font-size: var(--stx-fs-body); font-weight: 650; line-height: 1; letter-spacing: .005em;
    text-decoration: none; white-space: nowrap; cursor: pointer; user-select: none;
    transition: background-color var(--stx-dur-1) var(--stx-ease), border-color var(--stx-dur-1) var(--stx-ease), color var(--stx-dur-1) var(--stx-ease), box-shadow var(--stx-dur-1) var(--stx-ease), transform var(--stx-dur-1) var(--stx-ease);
}
.stx-btn:active:not(:disabled) { transform: translateY(1px); }
.stx-btn--block { width: 100%; }
.stx-btn--primary { background: var(--stx-accent); color: var(--stx-on-accent); box-shadow: 0 1px 2px rgba(var(--stx-accent-rgb), .3); }
.stx-btn--primary:hover:not(:disabled) { background: var(--stx-accent-hover); color: var(--stx-on-accent); box-shadow: 0 4px 12px rgba(var(--stx-accent-rgb), .28); }
.stx-btn--outline { background: var(--stx-surface); color: var(--stx-text); border-color: var(--stx-border-strong); }
.stx-btn--outline:hover:not(:disabled) { background: var(--stx-surface-2); color: var(--stx-heading); }
.stx-btn--ghost { background: transparent; color: var(--stx-text-muted); }
.stx-btn--ghost:hover:not(:disabled) { background: var(--stx-nav-hover); color: var(--stx-heading); }
.stx-btn:focus-visible { outline: 0; box-shadow: 0 0 0 3px rgba(var(--stx-accent-rgb), .35); }
.stx-btn:disabled, .stx-btn[aria-disabled="true"] { opacity: .62; cursor: not-allowed; box-shadow: none; }
.stx-btn.is-loading { opacity: 1; cursor: progress; }
.stx-btn img { width: 18px; height: 18px; }
.stx-spinner {
    display: inline-block; flex: none; width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid currentColor; border-right-color: transparent; animation: stx-spin .7s linear infinite;
}
.stx-spinner--sm { width: 13px; height: 13px; border-width: 2px; }

.stx-link {
    color: var(--stx-accent-strong); font-weight: 650; text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer;
    text-underline-offset: 3px; border-radius: 3px;
}
html[data-wd-theme="dark"] .stx-link { color: var(--stx-accent); }
.stx-link:hover { text-decoration: underline; }
.stx-link:disabled { color: var(--stx-text-faint); cursor: default; text-decoration: none; }
.stx-link--muted { color: var(--stx-text-muted) !important; font-weight: 600; }

.stx-divider { display: flex; align-items: center; gap: 12px; margin: 14px 0; color: var(--stx-text-muted); font-size: var(--stx-fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.stx-divider::before, .stx-divider::after { content: ""; flex: 1; height: 1px; background: var(--stx-border); }

/* ---- Password strength meter + rule list ------------------------------------- */
.stx-pw { margin-top: 2px; }
.stx-pw__bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.stx-pw__bar span { height: 4px; border-radius: 4px; background: var(--stx-surface-3); transition: background-color var(--stx-dur-2) var(--stx-ease); }
.stx-pw__meta { display: flex; justify-content: space-between; align-items: center; margin-top: 5px; font-size: var(--stx-fs-xs); color: var(--stx-text-muted); }
.stx-pw__label { font-weight: 700; }
.stx-pw[data-level="1"] .stx-pw__bar span:nth-child(-n+1) { background: var(--stx-danger); }
.stx-pw[data-level="2"] .stx-pw__bar span:nth-child(-n+2) { background: #d97706; }
.stx-pw[data-level="3"] .stx-pw__bar span:nth-child(-n+3) { background: color-mix(in srgb, var(--stx-success) 70%, #84cc16); }
.stx-pw[data-level="4"] .stx-pw__bar span { background: var(--stx-success); }
.stx-pw[data-level="1"] .stx-pw__label { color: var(--stx-danger); }
.stx-pw[data-level="2"] .stx-pw__label { color: var(--stx-warning); }
.stx-pw[data-level="3"] .stx-pw__label, .stx-pw[data-level="4"] .stx-pw__label { color: var(--stx-success); }
.stx-pw__rules { list-style: none; margin: 6px 0 4px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 12px; font-size: var(--stx-fs-xs); color: var(--stx-text-muted); }
.stx-pw__rules li { display: flex; align-items: center; gap: 6px; transition: color var(--stx-dur-1) var(--stx-ease); }
.stx-pw__rules li::before {
    content: ""; flex: none; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--stx-border-strong);
    background: transparent center / 10px no-repeat;
    transition: background-color var(--stx-dur-1) var(--stx-ease), border-color var(--stx-dur-1) var(--stx-ease);
}
.stx-pw__rules li.is-met { color: var(--stx-success); }
.stx-pw__rules li.is-met::before {
    border-color: var(--stx-success); background-color: var(--stx-success);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' d='m3.5 8.5 3 3 6-6.5'/%3E%3C/svg%3E");
}
html[data-wd-theme="dark"] .stx-pw__rules li.is-met::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%2312291f' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' d='m3.5 8.5 3 3 6-6.5'/%3E%3C/svg%3E");
}
.stx-match { display: inline-flex; align-items: center; gap: 5px; font-size: var(--stx-fs-xs); font-weight: 600; }
.stx-match.is-ok { color: var(--stx-success); }
.stx-match.is-bad { color: var(--stx-danger); }

/* ---- Stepper (Sign up) ----------------------------------------------------- */
.stx-stepper { display: flex; align-items: center; gap: 10px; list-style: none; margin: 0 0 10px; padding: 0; }
.stx-stepper__line { flex: 1; height: 2px; border-radius: 2px; background: var(--stx-border); position: relative; overflow: hidden; }
.stx-stepper__line::after { content: ""; position: absolute; inset: 0; width: 0; background: var(--stx-accent); transition: width var(--stx-dur-3) var(--stx-ease); }
.stx-stepper__line.is-done::after { width: 100%; }
.stx-step {
    display: inline-flex; align-items: center; gap: 8px; padding: 2px 6px 2px 2px; margin: 0;
    border: 0; border-radius: var(--stx-radius-full); background: transparent; cursor: pointer; color: var(--stx-text-muted);
    font-size: var(--stx-fs-sm); font-weight: 650; min-height: 34px; white-space: nowrap;
}
.stx-step:hover:not(:disabled) { color: var(--stx-heading); }
.stx-step:disabled { cursor: default; }
.stx-step__num {
    display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; flex: none;
    border: 1.5px solid var(--stx-border-strong); background: var(--stx-surface); color: var(--stx-text-muted); font-size: var(--stx-fs-sm); font-weight: 700;
    transition: all var(--stx-dur-2) var(--stx-ease);
}
.stx-step__text small { display: block; font-size: var(--stx-fs-xs); font-weight: 500; color: var(--stx-text-muted); }
.stx-step.is-active { color: var(--stx-heading); }
.stx-step.is-active .stx-step__num { border-color: var(--stx-accent); background: var(--stx-accent); color: var(--stx-on-accent); box-shadow: 0 0 0 4px rgba(var(--stx-accent-rgb), .15); }
.stx-step.is-done .stx-step__num { border-color: var(--stx-accent); background: var(--stx-accent-soft); color: var(--stx-accent-strong); }
html[data-wd-theme="dark"] .stx-step.is-done .stx-step__num { color: var(--stx-accent); }
.stx-step.is-done .stx-step__num span { display: none; }
.stx-step.is-done .stx-step__num::after { content: "\F633"; font-family: bootstrap-icons; font-size: 1rem; }
.stx-progress { height: 3px; border-radius: 3px; background: var(--stx-surface-2); overflow: hidden; margin: 4px 0 16px; }
.stx-progress > span { display: block; height: 100%; width: 25%; background: var(--stx-accent); border-radius: 4px; transition: width var(--stx-dur-3) var(--stx-ease); }
.stx-wizard__step.is-entering { animation: stx-panel-in var(--stx-dur-3) var(--stx-ease) both; }
.stx-wizard__actions { display: flex; align-items: center; gap: 10px; margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--stx-border); }
.stx-wizard__actions .stx-card__note { margin: 0; }
.stx-step-title { margin: 0 0 12px; font-size: var(--stx-fs-body); font-weight: 700; color: var(--stx-heading); letter-spacing: -.005em; }
.stx-wizard__actions .stx-btn--primary { margin-left: auto; min-width: 150px; }
.stx-section-title { margin: 4px 0 12px; font-size: var(--stx-fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--stx-text-muted); }
@media (max-width: 767.98px) {
    .stx-wizard__actions {
        position: sticky; bottom: 0; z-index: 5; margin: 6px calc(-1 * clamp(22px, 3.2vw, 32px)) calc(-1 * clamp(22px, 3.2vw, 32px));
        padding: 12px clamp(22px, 3.2vw, 32px) calc(12px + env(safe-area-inset-bottom));
        background: color-mix(in srgb, var(--stx-surface) 92%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
        border-radius: 0 0 var(--stx-radius-3) var(--stx-radius-3);
    }
    .stx-wizard__actions .stx-btn--primary { flex: 1; }
    .stx-step__text small { display: none; }
}
@media (max-width: 575.98px) {
    .stx-step:not(.is-active) .stx-step__label { display: none; } /* numbers only, except the current step */
    .stx-stepper { gap: 6px; }
}

/* ---- Avatar / logo uploader -------------------------------------------------- */
.stx-upload { display: flex; align-items: center; gap: 14px; padding: 10px 12px; margin-bottom: 14px; border: 1px dashed var(--stx-border-strong); border-radius: var(--stx-radius-3); background: var(--stx-surface); transition: border-color var(--stx-dur-1) var(--stx-ease), background-color var(--stx-dur-1) var(--stx-ease); }
.stx-upload.is-drag { border-color: var(--stx-accent); background: rgba(var(--stx-accent-rgb), .05); }
.stx-upload.is-invalid { border-color: var(--stx-danger); }
.stx-upload__preview {
    position: relative; flex: none; width: 54px; height: 54px; border-radius: 50%; overflow: hidden; display: inline-flex; align-items: center; justify-content: center;
    background: var(--stx-surface-2); color: var(--stx-text-faint); font-size: 1.6rem; border: 1px solid var(--stx-border);
}
.stx-upload--square .stx-upload__preview { border-radius: var(--stx-radius-2); }
.stx-upload__preview img { width: 100%; height: 100%; object-fit: cover; }
.stx-upload__body { min-width: 0; flex: 1; }
.stx-upload__title { font-size: var(--stx-fs-sm); font-weight: 650; color: var(--stx-heading); }
.stx-upload__hint { font-size: var(--stx-fs-xs); color: var(--stx-text-muted); }
.stx-upload__hint.is-error { color: var(--stx-danger); }
.stx-upload__actions { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.stx-upload__actions .stx-btn { height: 30px; padding: 0 12px; font-size: var(--stx-fs-sm); }
.stx-upload input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ---- Searchable dropdown (enhanced native <select>) -------------------------- */
.stx-combo { position: relative; }
.stx-combo > select { position: absolute; inset: auto 0 0 0; width: 100%; height: 1px; opacity: 0; pointer-events: none; }
.stx-combo__btn { display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer; padding-right: 36px !important; }
.stx-combo__value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stx-combo__value.is-placeholder { color: var(--stx-text-muted); }
.stx-combo__caret { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--stx-text-faint); pointer-events: none; transition: transform var(--stx-dur-1) var(--stx-ease); }
.stx-combo.is-open .stx-combo__caret { transform: translateY(-50%) rotate(180deg); }
.stx-combo .stx-spinner { position: absolute; right: 12px; top: 50%; margin-top: -7px; width: 14px; height: 14px; color: var(--stx-accent); }
.stx-combo.is-loading .stx-combo__caret { display: none; }
.stx-combo__btn:disabled { cursor: not-allowed; }
.stx-combo__pop {
    position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40; padding: 6px; min-width: 220px;
    background: var(--stx-surface); border: 1px solid var(--stx-border); border-radius: var(--stx-radius-2); box-shadow: var(--stx-shadow-md);
    animation: stx-pop var(--stx-dur-1) var(--stx-ease);
}
.stx-combo.is-up .stx-combo__pop { top: auto; bottom: calc(100% + 4px); }
.stx-combo__search { height: 34px !important; margin-bottom: 6px; font-size: var(--stx-fs-sm) !important; }
.stx-combo__list { list-style: none; margin: 0; padding: 0; max-height: 228px; overflow-y: auto; overscroll-behavior: contain; }
.stx-combo__opt { padding: 8px 10px; border-radius: var(--stx-radius-1); cursor: pointer; font-size: var(--stx-fs-sm); color: var(--stx-text); display: flex; align-items: center; gap: 8px; }
.stx-combo__opt.is-active { background: rgba(var(--stx-accent-rgb), .1); color: var(--stx-heading); }
.stx-combo__opt[aria-selected="true"] { font-weight: 650; }
.stx-combo__opt[aria-selected="true"]::after { content: "\F633"; font-family: bootstrap-icons; margin-left: auto; color: var(--stx-accent); }
.stx-combo__empty { padding: 10px; font-size: var(--stx-fs-sm); color: var(--stx-text-muted); text-align: center; }
.stx-field.is-invalid .stx-combo__btn { border-color: var(--stx-danger); }

/* ---- OTP ------------------------------------------------------------------- */
.stx-otp { display: flex; justify-content: center; gap: clamp(6px, 1.6vw, 10px); margin: 6px 0 4px; }
.stx-otp__box {
    width: clamp(40px, 11vw, 50px); height: clamp(48px, 13vw, 56px); padding: 0; text-align: center;
    font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--stx-heading);
    background: var(--stx-surface); border: 1px solid var(--stx-border-strong); border-radius: var(--stx-radius-2);
    caret-color: var(--stx-accent); transition: border-color var(--stx-dur-1) var(--stx-ease), box-shadow var(--stx-dur-1) var(--stx-ease), background-color var(--stx-dur-1) var(--stx-ease);
    -webkit-appearance: none; appearance: none;
}
.stx-otp__box:focus { outline: 0; border-color: rgba(var(--stx-accent-rgb), .75); box-shadow: 0 0 0 3px rgba(var(--stx-accent-rgb), .2); }
.stx-otp__box.is-filled { border-color: rgba(var(--stx-accent-rgb), .55); background: rgba(var(--stx-accent-rgb), .04); }
.stx-otp__box:disabled { background: var(--stx-surface-2); color: var(--stx-text-muted); }
.stx-otp.is-error .stx-otp__box { border-color: var(--stx-danger); }
.stx-otp.is-shake { animation: stx-shake .42s var(--stx-ease); }
.stx-otp-msg { min-height: 42px; text-align: center; font-size: var(--stx-fs-sm); color: var(--stx-danger); margin: 6px 0 2px; }
.stx-otp-msg i { margin-right: 4px; }
.stx-otp-meta { display: flex; justify-content: center; align-items: center; gap: 6px; flex-wrap: wrap; font-size: var(--stx-fs-sm); color: var(--stx-text-muted); }
.stx-otp-meta strong { color: var(--stx-heading); font-variant-numeric: tabular-nums; }
.stx-otp-meta .is-expired { color: var(--stx-danger); }
.stx-otp-badge {
    display: inline-flex; align-items: center; gap: 6px; margin: 0 auto 14px; padding: 4px 10px; border-radius: var(--stx-radius-full);
    background: var(--stx-accent-soft); color: var(--stx-accent-strong); font-size: var(--stx-fs-xs); font-weight: 700; letter-spacing: .02em;
}
html[data-wd-theme="dark"] .stx-otp-badge { color: var(--stx-accent); }
.stx-otp-links { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--stx-border); font-size: var(--stx-fs-sm); color: var(--stx-text-muted); }
.stx-countdown { font-variant-numeric: tabular-nums; }

/* ---- Notyf toasts on the STOX tokens ---------------------------------------- */
html[data-auth] .notyf { z-index: 9999; padding: 16px; }
html[data-auth] .notyf__toast { border-radius: var(--stx-radius-2); box-shadow: var(--stx-shadow-md); font-family: var(--stx-font-sans); max-width: 380px; }
html[data-auth] .notyf__wrapper { padding: 12px 6px; }
html[data-auth] .notyf__message { font-size: var(--stx-fs-sm); font-weight: 600; line-height: 1.4; }
html[data-auth] .notyf__icon i { font-size: 1.05rem; color: #fff; }
html[data-auth] .notyf__dismiss-btn { opacity: .5; }

/* ---- Motion ---------------------------------------------------------------- */
@keyframes stx-spin { to { transform: rotate(360deg); } }
@keyframes stx-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes stx-pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes stx-panel-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes stx-panel-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes stx-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }

@media (prefers-reduced-motion: reduce) {
    html[data-auth][data-motion="system"] .stx-panel.is-entering,
    html[data-auth][data-motion="system"] .stx-wizard__step.is-entering { animation-name: stx-panel-fade; }
    html[data-auth][data-motion="system"] .stx-otp.is-shake { animation: none; }
    html[data-auth][data-motion="system"] *, html[data-auth][data-motion="system"] *::before, html[data-auth][data-motion="system"] *::after { transition-duration: .01ms !important; }
}
html[data-auth][data-motion="reduce"] .stx-panel.is-entering,
html[data-auth][data-motion="reduce"] .stx-wizard__step.is-entering { animation-name: stx-panel-fade; }
html[data-auth][data-motion="reduce"] .stx-otp.is-shake,
html[data-auth][data-motion="off"] .stx-otp.is-shake { animation: none; }
html[data-auth][data-motion="off"] *, html[data-auth][data-motion="off"] *::before, html[data-auth][data-motion="off"] *::after { animation: none !important; transition: none !important; }
.stx-spinner { animation: stx-spin .7s linear infinite !important; } /* a busy indicator must keep moving */

/* ==ICONS== */
/* ---- Bootstrap Icons subset (generated from Template/css/vendor.min.css; re-run tools/icons.py when icons change) ---- */
@font-face { font-display: block; font-family: bootstrap-icons; src: url("/Template/css/fonts/bootstrap-iconsd862.woff2?8d200481aa7f02a2d63a331fc782cfaf") format("woff2"), url("/Template/css/fonts/bootstrap-iconsd862.woff?8d200481aa7f02a2d63a331fc782cfaf") format("woff"); }
.stx-auth-body .bi::before, .stx-auth-body [class^="bi-"]::before, .stx-auth-body [class*=" bi-"]::before { display: inline-block; font-family: bootstrap-icons !important; font-style: normal; font-weight: 400 !important; font-variant: normal; text-transform: none; line-height: 1; vertical-align: -.125em; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
.bi-arrow-left::before { content: "\f12f"; }
.bi-arrow-repeat::before { content: "\f130"; }
.bi-arrow-right::before { content: "\f138"; }
.bi-box-arrow-in-right::before { content: "\f1be"; }
.bi-box-seam::before { content: "\f1c7"; }
.bi-building::before { content: "\f1dd"; }
.bi-capslock-fill::before { content: "\f222"; }
.bi-check-circle-fill::before { content: "\f26a"; }
.bi-check2-circle::before { content: "\f270"; }
.bi-chevron-down::before { content: "\f282"; }
.bi-clock-history::before { content: "\f292"; }
.bi-envelope::before { content: "\f32f"; }
.bi-envelope-check::before { content: "\f68c"; }
.bi-envelope-exclamation::before { content: "\f692"; }
.bi-envelope-paper::before { content: "\f73d"; }
.bi-exclamation-circle-fill::before { content: "\f332"; }
.bi-exclamation-octagon-fill::before { content: "\f336"; }
.bi-exclamation-triangle-fill::before { content: "\f33a"; }
.bi-eye::before { content: "\f341"; }
.bi-eye-slash::before { content: "\f340"; }
.bi-fingerprint::before { content: "\f671"; }
.bi-geo-alt::before { content: "\f3e8"; }
.bi-globe2::before { content: "\f3ef"; }
.bi-graph-up-arrow::before { content: "\f673"; }
.bi-grid-1x2::before { content: "\f3f4"; }
.bi-hdd-stack::before { content: "\f411"; }
.bi-hourglass-split::before { content: "\f41f"; }
.bi-info-circle-fill::before { content: "\f430"; }
.bi-journal-text::before { content: "\f444"; }
.bi-key::before { content: "\f44f"; }
.bi-lightning-charge::before { content: "\f46d"; }
.bi-link-45deg::before { content: "\f470"; }
.bi-lock::before { content: "\f47b"; }
.bi-lock-fill::before { content: "\f47a"; }
.bi-moon-stars::before { content: "\f496"; }
.bi-patch-check::before { content: "\f4b6"; }
.bi-person::before { content: "\f4e1"; }
.bi-person-badge::before { content: "\f4d3"; }
.bi-person-check::before { content: "\f4d6"; }
.bi-person-workspace::before { content: "\f67a"; }
.bi-phone::before { content: "\f4e7"; }
.bi-question-circle::before { content: "\f505"; }
.bi-safe::before { content: "\f65a"; }
.bi-shield-check::before { content: "\f52f"; }
.bi-shield-lock::before { content: "\f538"; }
.bi-shield-x::before { content: "\f53e"; }
.bi-shuffle::before { content: "\f544"; }
.bi-sun::before { content: "\f5a2"; }
.bi-telephone::before { content: "\f5c1"; }
.bi-upload::before { content: "\f603"; }
/* ==/ICONS== */
