/* ============================================================
   MXUBER RIDER AUTH — refinement layer
   Loads after the main stylesheet; adds state + micro-detail
   polish on top of the base .mx-cabauth design system.
   Palette: black #0A0A0A, ink #111, muted #545454,
   fill #F6F6F6, border #E2E2E2, error #E11900.
   ============================================================ */

/* entrance animations + micro-interactions (loads with this
   sheet on every .mx-cabauth page — no blade changes needed) */
@import url("auth-animations.css");

/* ------------------------------------------------------------
   1. INPUT STATES
   ------------------------------------------------------------ */

/* every input transitions its border + fill smoothly */
.mx-cabauth .form-control,
.mx-cabauth .form-select {
    transition: border-color .15s ease, box-shadow .15s ease,
        background-color .15s ease;
}

/* hover: border darkens to ink */
.mx-cabauth .form-control:hover,
.mx-cabauth .form-select:hover,
.mx-cabauth .otp-field:hover {
    border-color: var(--mx-ink);
}

.mx-cabauth__inputrow:hover {
    border-color: var(--mx-ink);
}

/* focus ring: 2px outline + 3px offset (same language as
   auth-animations.css — one ring per control, never two) */
.mx-cabauth .form-control:focus-visible,
.mx-cabauth .form-select:focus-visible,
.mx-cabauth .otp-field:focus-visible {
    border-color: var(--mx-ink);
    outline: 2px solid var(--mx-ink);
    outline-offset: 3px;
}

/* the login field row carries the ring for its borderless input */
.mx-cabauth__inputrow:focus-within {
    border-color: var(--mx-ink);
    outline: 2px solid var(--mx-ink);
    outline-offset: 3px;
}

/* inner borderless field + select2 inside the row defer to it */
.mx-cabauth__inputrow .mx-cabauth__field:focus-visible,
.mx-cabauth__inputrow .select2-container--default .select2-selection--single:focus-visible {
    outline: none;
}

/* placeholders */
.mx-cabauth input::placeholder,
.mx-cabauth .form-control::placeholder,
.mx-cabauth__field::placeholder {
    color: #9A9A9A;
    opacity: 1;
}

/* kill the yellow/blue autofill wash: surface fill, ink text */
.mx-cabauth input:-webkit-autofill,
.mx-cabauth input:-webkit-autofill:hover,
.mx-cabauth input:-webkit-autofill:focus,
.mx-cabauth input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
    -webkit-text-fill-color: #111;
    caret-color: #000;
    transition: background-color 9999s ease-in-out 0s;
}

html[data-theme="dark"] .mx-cabauth input:-webkit-autofill,
html[data-theme="dark"] .mx-cabauth input:-webkit-autofill:hover,
html[data-theme="dark"] .mx-cabauth input:-webkit-autofill:focus,
html[data-theme="dark"] .mx-cabauth input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #1D1D1D inset;
    -webkit-text-fill-color: #ffffff;
    caret-color: #ffffff;
}

/* jQuery validate invalid inputs: 1px error border */
.mx-cabauth .form-control.error,
.mx-cabauth .form-select.error,
.mx-cabauth .otp-field.error {
    border-color: #E11900;
}

/* the login field itself is borderless; its row carries the border */
.mx-cabauth__inputrow:has(.mx-cabauth__field.error) {
    border-color: #E11900;
}

/* validation labels below fields */
.mx-cabauth label.error {
    display: block;
    color: #E11900;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.4;
    margin: 6px 0 0;
    text-align: left;
}

/* server-side error spans share the same scale */
.mx-cabauth .text-danger,
.mx-cabauth .invalid-feedback,
.mx-cabauth__error {
    color: #E11900 !important;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.4;
    display: block;
    margin-top: 6px;
}

/* register phone field: no native spinners, digits read as text */
.mx-cabauth input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.mx-cabauth input[type="number"]::-webkit-outer-spin-button,
.mx-cabauth input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ------------------------------------------------------------
   2. BUTTON FEEL
   ------------------------------------------------------------ */

.mx-cabauth__submit,
.mx-cabauth .otp-btn,
.mx-cabauth .verifyBtn,
#get-otp-btn {
    transition: background-color .15s ease, border-color .15s ease,
        transform .15s ease, opacity .15s ease;
}

/* hover lift — excluded while disabled/AJAX in flight */
.mx-cabauth__submit:hover:not(:disabled),
.mx-cabauth .otp-btn:hover:not(:disabled),
.mx-cabauth .verifyBtn:hover:not(:disabled),
#get-otp-btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.mx-cabauth__submit:active,
.mx-cabauth .otp-btn:active,
.mx-cabauth .verifyBtn:active,
#get-otp-btn:active {
    transform: translateY(1px);
}

/* disabled CTAs (AJAX in flight, OTP incomplete) */
.mx-cabauth__submit:disabled,
.mx-cabauth .otp-btn:disabled,
.mx-cabauth .verifyBtn:disabled,
#get-otp-btn:disabled {
    background: #8D8D8D !important;
    border-color: #8D8D8D !important;
    color: #ffffff !important;
    cursor: not-allowed;
    transform: none;
}

/* demo credential chip: same press + hover language */
.mx-cabauth__demo {
    transition: background-color .15s ease, border-color .15s ease,
        transform .15s ease;
}

.mx-cabauth__demo:hover {
    border-color: var(--mx-ink) !important;
    background-color: var(--mx-surface-2) !important;
}

.mx-cabauth__demo:active {
    transform: translateY(1px);
}

/* ------------------------------------------------------------
   3. OTP FIELDS + HINT CHIP
   ------------------------------------------------------------ */

.mx-cabauth .otp-field {
    caret-color: #000;
    transition: border-color .15s ease, box-shadow .15s ease,
        opacity .15s ease;
}

.mx-cabauth .otp-field:disabled {
    opacity: .35;
}

/* demo OTP hint: centered gray pill */
.mx-cabauth__otp-hint {
    display: flex;
    width: fit-content;
    align-items: center;
    margin: 0 auto 16px;
    padding: 0 16px;
    height: 32px;
    background: #F6F6F6;
    border-radius: 99px;
    color: #545454;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .01em;
    white-space: nowrap;
}

/* ------------------------------------------------------------
   4. FOCUS ORDER + LINK AFFORDANCE
   ------------------------------------------------------------ */

.mx-cabauth a {
    border-radius: 2px;
}

.mx-cabauth a:focus-visible {
    outline: 2px solid var(--mx-ink);
    outline-offset: 3px;
}

.mx-cabauth__demo:focus-visible {
    outline: 2px solid var(--mx-ink);
    outline-offset: 3px;
}

/* ------------------------------------------------------------
   5. DIVIDER + LINK ROW SCALE
   ------------------------------------------------------------ */

.mx-cabauth__divider span,
.mx-cabauth .or-box span {
    white-space: nowrap;
}

/* signup/signin rows: one scale across all three pages */
.mx-cabauth__signup,
.mx-cabauth .new-account {
    font-size: 14px;
    font-weight: 400;
    color: var(--mx-ink-2);
    text-align: center;
    margin: 18px 0 0;
    line-height: 1.6;
}

.mx-cabauth__signup a,
.mx-cabauth .new-account a {
    color: var(--mx-ink);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ------------------------------------------------------------
   6. MOBILE (max-width 560px)
   ------------------------------------------------------------ */

@media (max-width: 560px) {

    .mx-cabauth {
        padding: 28px 18px;
        /* keep CTA breathing room clear of the home indicator */
        padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
    }

    .mx-cabauth__title {
        font-size: 26px;
    }

    .mx-cabauth .otp-inputs {
        gap: 8px;
    }

    .mx-cabauth .otp-field {
        width: 46px;
        height: 46px;
        font-size: 20px;
    }

    /* CTA spacing holds steady on small screens */
    .mx-cabauth__submit,
    .mx-cabauth .otp-btn,
    .mx-cabauth .verifyBtn {
        margin-top: 16px;
    }

    .mx-cabauth__divider {
        margin: 18px 0;
    }
}

/* ------------------------------------------------------------
   7. MX2 LOGIN SPLIT — two-column auth: form | photo + features
   ------------------------------------------------------------ */

.authentication-section.mx2-loginsplit {
    padding: 0 !important;
    margin: 0 !important;
    background: var(--mx-bg) !important;
    border: none !important;
}

.mx2-loginsplit__grid {
    display: grid;
    grid-template-columns: minmax(420px, 540px) 1fr;
    align-items: stretch;
    min-height: calc(100vh - 96px);
    min-height: calc(100svh - 96px);
}

/* the form column IS the page now — neutralize any base card styling */
.mx2-loginsplit .mx-cabauth {
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: none;
    width: auto;
    margin: 0;
    padding: 64px 48px;
    background: var(--mx-bg);
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.mx2-loginsplit__inner {
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
}

.mx2-loginsplit__logo {
    display: inline-block;
    margin-bottom: 40px;
}

.mx2-loginsplit__logo img {
    display: block;
    height: 28px;
    width: auto;
}

/* flat accent CTA in the split layout (replaces the theme gradient;
   --mx-accent flips to white in dark mode per the token system) */
.mx2-loginsplit .mx-cabauth__submit {
    background: var(--mx-accent) !important;
    background-color: var(--mx-accent) !important;
    color: var(--mx-on-accent) !important;
    border: 0 !important;
    border-radius: 9999px !important;
    height: 48px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0;
}

.mx2-loginsplit .mx-cabauth__submit:hover:not(:disabled) {
    background: var(--mx-accent-hover) !important;
    background-color: var(--mx-accent-hover) !important;
    color: var(--mx-on-accent) !important;
}

.mx2-loginsplit__legal {
    margin: 28px 0 0;
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--mx-ink-3);
    text-align: center;
}

.mx2-loginsplit__legal a {
    color: var(--mx-ink);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* --- visual column --- */

.mx2-loginsplit__visual {
    position: relative;
    overflow: hidden;
    background: #0A0A0A;
    min-height: 560px;
}

.mx2-loginsplit__visual img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(.88) contrast(1.05);
}

.mx2-loginsplit__visual::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(6, 7, 9, .18) 0%,
        transparent 30%,
        rgba(6, 7, 9, .9) 100%);
}

.mx2-loginsplit__feat {
    position: absolute;
    left: 48px;
    right: 48px;
    bottom: 48px;
    z-index: 1;
    color: #fff;
}

.mx2-loginsplit__feat h2 {
    font-family: var(--mx-font-display, "Inter Tight", "Inter", sans-serif);
    font-size: 40px;
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.02em;
    margin: 0 0 24px;
}

.mx2-loginsplit__feat ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.mx2-loginsplit__feat li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 15px;
    line-height: 1.5;
    color: rgba(255, 255, 255, .86);
    max-width: 44ch;
}

.mx2-loginsplit__feat li i {
    font-size: 16px;
    line-height: 1.45;
    color: #fff;
    flex: none;
}

.mx2-loginsplit__foot {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, .16);
    font-size: 12.5px;
    letter-spacing: .02em;
    color: rgba(255, 255, 255, .6);
}

@media (max-width: 900px) {

    .mx2-loginsplit__grid {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .mx2-loginsplit .mx-cabauth {
        padding: 48px 20px 56px;
        justify-content: flex-start;
    }

    /* visual becomes a compact banner above the form */
    .mx2-loginsplit__visual {
        order: -1;
        min-height: 0;
        height: 220px;
    }

    .mx2-loginsplit__feat {
        left: 24px;
        right: 24px;
        bottom: 24px;
    }

    .mx2-loginsplit__feat h2 {
        font-size: 26px;
        margin-bottom: 0;
    }

    .mx2-loginsplit__feat ul,
    .mx2-loginsplit__foot {
        display: none;
    }
}

/* ------------------------------------------------------------
   8. TALL FORMS + DARK-MODE COMPLETION
   ------------------------------------------------------------ */

/* register: the form column overflows the viewport — top-align it so
   vertical centering can never clip the first field out of scroll */
.mx2-loginsplit--tall .mx-cabauth {
    justify-content: flex-start;
}

/* register/otp inputs: base sheet hardcodes white :focus fills; re-pin
   them to tokens in dark so focus never flashes white */
html[data-theme="dark"] .mx-cabauth .form-control,
html[data-theme="dark"] .mx-cabauth .form-select {
    background: var(--mx-surface-2);
    border-color: var(--mx-border);
    color: var(--mx-ink);
}

html[data-theme="dark"] .mx-cabauth .form-control:focus,
html[data-theme="dark"] .mx-cabauth .form-select:focus {
    background: var(--mx-surface-2);
    border-color: var(--mx-ink);
    color: var(--mx-ink);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .12);
}

/* OTP cells */
html[data-theme="dark"] .mx-cabauth .otp-field {
    background: var(--mx-surface-2);
    border-color: var(--mx-border);
    color: var(--mx-ink);
}

html[data-theme="dark"] .mx-cabauth .otp-field:focus {
    border-color: var(--mx-ink);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .12);
    outline: none;
}

/* dividers ("or" rules) + demo hint chip */
html[data-theme="dark"] .mx-cabauth__divider,
html[data-theme="dark"] .mx-cabauth .or-box {
    color: var(--mx-ink-3);
}

html[data-theme="dark"] .mx-cabauth__divider::before,
html[data-theme="dark"] .mx-cabauth__divider::after,
html[data-theme="dark"] .mx-cabauth .or-box::before,
html[data-theme="dark"] .mx-cabauth .or-box::after {
    background: var(--mx-border);
}

html[data-theme="dark"] .mx-cabauth__otp-hint {
    background: var(--mx-surface-2);
    color: var(--mx-ink-2);
}

/* login demo-credential chip */
html[data-theme="dark"] .demo-credential .mx-cabauth__demo {
    background: var(--mx-surface-2) !important;
    border-color: var(--mx-border) !important;
    color: var(--mx-ink) !important;
}

html[data-theme="dark"] .mx-cabauth__demo:hover {
    background: var(--mx-surface-3) !important;
    border-color: var(--mx-ink) !important;
}

/* select2 country-code dropdown (register renders it at body level) */
html[data-theme="dark"] .select2-dropdown {
    background: var(--mx-surface);
    border-color: var(--mx-border);
}

html[data-theme="dark"] .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: var(--mx-surface-2);
    color: var(--mx-ink);
}
