/* ==========================================================================
   Primex — login page
   Bootstrap 5.3 is loaded first; this file only themes/overrides.
   Palette lives in CSS variables so the dark/light switch is one attribute.
   ========================================================================== */

:root,
html[data-px-theme="light"] {
    --px-card: #ffffff;
    --px-card-border: transparent;
    --px-card-blur: none;
    --px-ink: #16213c;
    --px-muted: #5d6b85;
    --px-faint: #8592a8;
    --px-line: #dbe2ec;
    --px-line-soft: #e8edf4;
    --px-input-bg: #f7f9fc;
    --px-input-bg-focus: #ffffff;
    --px-blue: #1d9bf0;
    --px-blue-hover: #1685d0;
    --px-navy: #12203c;
    --px-dot: rgba(29, 155, 240, .20);
    --px-arc: rgba(120, 190, 250, .20);
    --px-glow: rgba(29, 155, 240, .22);
    --px-card-shadow: 0 40px 90px -30px rgba(0, 0, 0, .80);
    --px-footer-ink: rgba(255, 255, 255, .50);
    --px-toggle-bg: rgba(255, 255, 255, .90);
    --px-toggle-border: rgba(255, 255, 255, .20);
    --px-toggle-ink: #16213c;
    --px-alert-bg: #fdeceb;
    --px-alert-ink: #b3261e;
    --px-logo-color: block;
    --px-logo-white: none;
}

html[data-px-theme="dark"],
html[data-px-theme="auto"].px-prefers-dark {
    --px-card: rgba(18, 26, 43, .72);
    --px-card-border: rgba(255, 255, 255, .12);
    --px-card-blur: blur(18px);
    --px-ink: #eef3fa;
    --px-muted: #9aa8c0;
    --px-faint: #7c8aa3;
    --px-line: rgba(255, 255, 255, .16);
    --px-line-soft: rgba(255, 255, 255, .13);
    --px-input-bg: rgba(255, 255, 255, .06);
    --px-input-bg-focus: rgba(255, 255, 255, .10);
    --px-blue: #1d9bf0;
    --px-blue-hover: #3aabf7;
    --px-navy: #0b1120;
    --px-dot: rgba(58, 171, 247, .22);
    --px-arc: rgba(58, 171, 247, .22);
    --px-glow: rgba(29, 155, 240, .18);
    --px-card-shadow: 0 40px 90px -30px rgba(0, 0, 0, .85);
    --px-footer-ink: rgba(255, 255, 255, .42);
    --px-toggle-bg: rgba(255, 255, 255, .07);
    --px-toggle-border: rgba(255, 255, 255, .16);
    --px-toggle-ink: #c8d4e6;
    --px-alert-bg: rgba(255, 107, 98, .14);
    --px-alert-ink: #ff9b93;
    --px-logo-color: none;
    --px-logo-white: block;
}

/* ---------- stage & background field ---------------------------------- */

html, body {
    height: 100%;
}

.px-body {
    margin: 0;
    background: var(--px-navy);
    color: var(--px-ink);
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.px-stage {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    background: var(--px-navy);
}

.px-field-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.px-dots {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(var(--px-dot) 1px, transparent 1px);
    background-size: 26px 26px;
}

.px-arc {
    position: absolute;
    border-radius: 50%;
    border: 1px solid var(--px-arc);
}

.px-arc-1 {
    left: -140px;
    top: -180px;
    width: 760px;
    height: 760px;
}

.px-arc-2 {
    left: -60px;
    top: -100px;
    width: 640px;
    height: 640px;
    opacity: .55;
}

.px-arc-3 {
    right: -220px;
    bottom: -260px;
    width: 820px;
    height: 820px;
    opacity: .75;
}

.px-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(70% 60% at 50% 45%, var(--px-glow) 0%, rgba(11, 17, 32, 0) 70%);
}

.px-main {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 72px 20px 24px;
}

/* ---------- theme toggle --------------------------------------------- */

.px-toolbar {
    position: absolute;
    top: 24px;
    right: 26px;
    z-index: 2;
}

.px-theme-btn {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 13px;
    border: 1px solid var(--px-toggle-border);
    border-radius: 999px;
    background: var(--px-toggle-bg);
    color: var(--px-toggle-ink);
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1;
}

    .px-theme-btn:hover, .px-theme-btn:focus {
        color: var(--px-toggle-ink);
        border-color: var(--px-blue-hover);
        background: var(--px-toggle-bg);
    }

/* ---------- card ------------------------------------------------------ */

.px-card {
    width: 100%;
    min-width: 400px;
    max-width: 424px;
    background: var(--px-card);
    border: 1px solid var(--px-card-border) !important;
    border-radius: 18px;
    box-shadow: var(--px-card-shadow);
    backdrop-filter: var(--px-card-blur);
    -webkit-backdrop-filter: var(--px-card-blur);
}

.px-card-body {
    padding: 36px 34px 30px;
}

.px-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 28px;
}

.px-logo {
    height: 55px;
    width: auto;
}

.px-logo-color {
    display: var(--px-logo-color);
}

.px-logo-white {
    display: var(--px-logo-white);
}

.px-sub {
    margin: 0 0 22px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--px-muted);
    text-wrap: pretty;
}

    .px-sub strong {
        color: var(--px-ink);
        font-weight: 600;
    }

.px-rules {
    margin: -6px 0 18px;
    padding-left: 0;
    list-style: none;
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--px-muted);
}

    .px-rules li {
        display: flex;
        align-items: center;
        gap: 8px;
        margin: 3px 0;
        transition: color .15s ease;
    }

        .px-rules li i {
            width: 14px;
            font-size: 12px;
            text-align: center;
            color: var(--px-faint);
        }

    .px-rules li.is-met {
        color: var(--px-ink);
    }

        .px-rules li.is-met i {
            color: #1e9e5a;
        }

html[data-px-theme="dark"] .px-rules li.is-met i,
html[data-px-theme="auto"].px-prefers-dark .px-rules li.is-met i {
    color: #3ddc84;
}

.px-btn.btn:disabled,
.px-btn.btn[disabled] {
    opacity: .5;
    cursor: not-allowed;
}

.px-back {
    display: inline-block;
    margin-bottom: 14px;
}

/* ---------- fields --------------------------------------------------- */

.px-label {
    margin-bottom: 7px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--px-muted);
}

.px-input.form-control {
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--px-line);
    border-radius: 10px;
    background: var(--px-input-bg);
    color: var(--px-ink);
    font-size: 15px;
    box-shadow: none;
}

    .px-input.form-control:focus {
        border-color: var(--px-blue);
        background: var(--px-input-bg-focus);
        color: var(--px-ink);
        box-shadow: 0 0 0 3px rgba(29, 155, 240, .18);
    }

    .px-input.form-control::placeholder {
        color: var(--px-faint);
    }

/* password reveal — keep Bootstrap's input-group from squaring the corners */
.px-input-group {
    position: relative;
}

    .px-input-group .px-input.form-control {
        border-radius: 10px !important;
    }

.px-reveal {
    position: absolute;
    top: 50%;
    right: 6px;
    z-index: 5;
    transform: translateY(-50%);
    height: 34px;
    width: 36px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--px-faint);
    line-height: 1;
}

    .px-reveal:hover, .px-reveal:focus {
        color: var(--px-blue);
        background: var(--px-input-bg);
    }

.px-invalid {
    display: block;
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--px-alert-ink);
}

/* asp:CheckBox renders <span class="px-check-inner"><input><label> */
.px-check {
    padding-left: 0;
}

.px-check-inner {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13.5px;
    color: var(--px-muted);
}

    .px-check-inner input[type="checkbox"] {
        width: 17px;
        height: 17px;
        margin: 0;
        accent-color: var(--px-blue);
        cursor: pointer;
    }

    .px-check-inner label {
        margin: 0;
        cursor: pointer;
    }

/* ---------- buttons & links ------------------------------------------ */

.px-btn.btn {
    height: 48px;
    border: 0;
    border-radius: 10px;
    background: var(--px-blue);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
}

    .px-btn.btn:hover, .px-btn.btn:focus {
        background: var(--px-blue-hover);
        color: #fff;
    }

    .px-btn.btn:focus-visible {
        box-shadow: 0 0 0 3px rgba(29, 155, 240, .35);
    }

/* Button busy state — centered spinner, label hidden, not clickable.
   The selectors carry .btn and spell out :hover/:focus/:disabled on purpose: the rules above
   use the `background` SHORTHAND, which resets background-image to none. At plain
   `.px-btn.is-loading` (0,2,0) a focused button — and a click leaves it focused — would beat
   this rule and wipe the spinner, leaving a blank blue button. Matching their specificity and
   sitting later in the file keeps the spinner painted in every state.
   The spinner is a background image, not a ::before, because these are <input type="submit">
   elements and inputs cannot carry pseudo-elements. */
.px-btn.btn.is-loading,
.px-btn.btn.is-loading:hover,
.px-btn.btn.is-loading:focus,
.px-btn.btn.is-loading:disabled {
    color: transparent !important;
    pointer-events: none;
    opacity: 1;
    background-color: var(--px-blue);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 50 50'%3E%3Ccircle cx='25' cy='25' r='20' fill='none' stroke='%23ffffff' stroke-width='5' stroke-linecap='round' stroke-dasharray='80 160'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 25 25' to='360 25 25' dur='0.7s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

a, .px-link, .px-link-sm {
    color: var(--px-blue-hover);
    text-decoration: none;
    font-weight: 500;
}

    a:hover, .px-link:hover, .px-link-sm:hover {
        color: var(--px-blue);
        text-decoration: underline;
    }

.px-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 13.5px;
}

.px-link-sm {
    font-size: 12.5px;
}

.px-or {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 15px;
}

    .px-or::before, .px-or::after {
        content: "";
        flex: 1;
        height: 1px;
        background: var(--px-line-soft);
    }

    .px-or span {
        font-size: 11px;
        letter-spacing: .1em;
        text-transform: uppercase;
        color: var(--px-faint);
    }

.px-ms-mark {
    display: grid;
    grid-template-columns: 7px 7px;
    grid-template-rows: 7px 7px;
    gap: 2px;
}

    .px-ms-mark i:nth-child(1) {
        background: #f25022;
    }

    .px-ms-mark i:nth-child(2) {
        background: #7fba00;
    }

    .px-ms-mark i:nth-child(3) {
        background: #00a4ef;
    }

    .px-ms-mark i:nth-child(4) {
        background: #ffb900;
    }

/* ---------- alert, OTP, progress, footer ----------------------------- */

.px-alert {
    background: var(--px-alert-bg);
    color: var(--px-alert-ink);
    border: 0;
    border-radius: 10px;
    padding: 11px 13px;
    margin-bottom: 18px;
    font-size: 13px;
    line-height: 1.45;
}

/* yellow / warning variant */
.px-alert-warn {
    background: #fdf4d8;
    color: #8a6a12;
}

html[data-px-theme="dark"] .px-alert-warn,
html[data-px-theme="auto"].px-prefers-dark .px-alert-warn {
    background: rgba(255, 196, 61, .14);
    color: #f2c265;
}

.px-otp {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-bottom: 18px;
}

.px-otp-box.form-control {
    height: 56px;
    padding: 0;
    text-align: center;
    border: 1px solid var(--px-line);
    border-radius: 10px;
    background: var(--px-input-bg);
    color: var(--px-ink);
    font-size: 22px;
    font-weight: 600;
    box-shadow: none;
}

    .px-otp-box.form-control:focus {
        border-color: var(--px-blue);
        background: var(--px-input-bg-focus);
        box-shadow: 0 0 0 3px rgba(29, 155, 240, .18);
    }

.px-foot-note {
    margin: 16px 0 0;
    text-align: center;
    font-size: 13px;
    color: var(--px-muted);
}

.px-progress {
    margin-top: 14px;
    text-align: center;
    font-size: 13px;
    color: var(--px-footer-ink);
}

.px-footer {
    width: 100%;
    max-width: 424px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px 16px;
    font-size: 12px;
    color: var(--px-footer-ink);
}

    .px-footer a {
        color: var(--px-footer-ink);
        font-weight: 400;
    }

        .px-footer a:hover {
            color: #fff;
        }

/* ---------- mobile ---------------------------------------------------- */

@media (max-width: 575.98px) {
    .px-main {
        justify-content: flex-start;
        padding: 68px 16px 20px;
        gap: 16px;
    }

    .px-toolbar {
        top: 16px;
        right: 16px;
    }

    .px-card {
        min-width: 0;
        max-width: 100%;
        border-radius: 16px;
    }

    .px-card-body {
        padding: 28px 22px 24px;
    }

    .px-logo {
        height: 36px;
    }

    .px-arc-1, .px-arc-2, .px-arc-3 {
        opacity: .4;
    }

    .px-otp {
        gap: 6px;
    }

    .px-otp-box.form-control {
        height: 52px;
        font-size: 19px;
    }
    /* 16px keeps iOS Safari from zooming on focus */
    .px-input.form-control, .px-btn.btn {
        font-size: 16px;
    }

    .px-input.form-control {
        height: 50px;
    }

    .px-btn.btn {
        height: 52px;
    }

    .px-link, .px-link-sm {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}
