/*
 * Partner panel — Login / Sign up / Forgot & Reset password: responsive layout.
 * Loaded LAST on those pages (after their inline <style>), so it can correct them.
 *
 * Problems this fixes
 *  - The pages were locked to the window height (height:100vh; overflow:hidden). On phones,
 *    in "Desktop site" mode and on small laptops the form column became shorter than the form,
 *    was centred and clipped: the Login / Sign-up fields and buttons were cut off and could not
 *    be scrolled to.
 *  - The sign-up step bar was a fixed 540 px wide → the form slid off the left of the screen.
 */

/* ---------- every size: never clip a centred column (auto margins instead of justify-center) ---------- */
.login-form-column,
.why-sell-section {
    justify-content: flex-start !important;
}
.login-form-column > :first-child,
.why-sell-section > :first-child {
    margin-top: auto;
}
.login-form-column > :last-child,
.why-sell-section > :last-child {
    margin-bottom: auto;
}
.login-form-column,
.signup-form-column,
.why-sell-section {
    min-height: 0;
}

/* ---------- phones, tablets, "Desktop site" on phones, small laptops: one column, normal scrolling ---------- */
@media (max-width: 1099.98px) {
    html,
    body,
    body.body,
    #wrapper,
    #page {
        height: auto !important;
        min-height: 100%;
        overflow: visible !important;
        overflow-x: hidden !important;
    }
    #page {
        display: block !important;
    }

    .login-container,
    .signup-container {
        flex-direction: column !important;
        height: auto !important;
        min-height: 100vh;
        overflow: visible !important;
    }

    /* form first, full width */
    .login-form-column,
    .signup-form-column {
        order: 1 !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        padding: 28px 20px 40px !important;
        margin-top: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }
    .login-form-column > :first-child,
    .login-form-column > :last-child {
        margin-top: 0;
        margin-bottom: 0;
    }
    .signup-form-column::before,
    .signup-form-column::after {
        display: none !important;
    }
    .login-form-column > .flex-grow,
    .signup-form-column > .flex-grow {
        width: 100% !important;
        gap: 22px !important;
    }

    .login-form-column .login-box {
        width: 100% !important;
        max-width: 460px !important;
        margin: 0 auto !important;
    }
    .signup-form-column .login-box {
        display: block !important;
        width: 100% !important;
        max-width: 620px !important;
        margin: 0 auto !important;
    }

    /* "Why sell on Xotic?" below the form */
    .why-sell-section {
        order: 2 !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        padding: 36px 16px 48px !important;
        border-top: 1px solid #ece6fb;
    }
    .why-sell-section > :first-child,
    .why-sell-section > :last-child {
        margin-top: 0;
        margin-bottom: 0;
    }
    .why-sell-section::after {
        display: none !important;
    }
    .why-sell-content {
        max-width: 760px !important;
    }

    #logo_header {
        height: 56px !important;
    }

    /* sign-up step bar: shrink with the screen instead of a fixed 540 px */
    .step-indicator {
        width: 100%;
        margin: 26px 0 44px !important;
    }
    .step-item {
        flex: 0 0 40px !important;
        width: 40px !important;
    }
    .step-circle {
        width: 40px !important;
        height: 40px !important;
        font-size: 17px !important;
    }
    .join-step {
        flex: 1 1 auto !important;
        width: auto !important;
        min-width: 14px;
        margin-top: 20px !important;
    }
    .step-label {
        top: 48px !important;
        width: 84px !important;
        white-space: normal !important;
        font-size: 12px !important;
        line-height: 1.25 !important;
    }

    /* forgot / reset password card */
    .wrap-login-page {
        min-height: 100vh;
        max-width: 480px;
        padding: 24px 16px 30px !important;
        justify-content: flex-start !important;
        gap: 24px !important;
    }
    .wrap-login-page .login-box {
        padding: 24px 20px !important;
        gap: 26px !important;
        box-shadow: 0 6px 30px rgba(124, 58, 237, 0.08);
    }

    /* comfortable touch targets */
    .tf-button {
        min-height: 48px;
    }
}

/* ---------- 2 columns of "Why sell" cards on tablets ---------- */
@media (min-width: 640px) and (max-width: 1099.98px) {
    .why-sell-section .row {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 16px !important;
    }
    .why-sell-section .row > .column {
        flex: 1 1 calc(50% - 16px) !important;
        min-width: 260px;
    }
}

/* ---------- phones ---------- */
@media (max-width: 639.98px) {
    .why-sell-section .row > .column {
        flex: 1 1 100% !important;
    }
    .why-sell-section h1,
    .why-sell-section h2 {
        font-size: 30px !important;
        line-height: 1.2 !important;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .login-form-column h3,
    .signup-form-column h3,
    .wrap-login-page h3 {
        font-size: 24px !important;
        line-height: 1.25 !important;
    }
    .step-label {
        width: 66px !important;
        font-size: 11px !important;
    }
    /* input + "Send OTP" button inside it */
    .input-with-button-wrapper input {
        padding-right: 112px !important;
    }
    .input-with-button-wrapper .inside-btn {
        padding: 0 12px !important;
        min-width: 96px !important;
        font-size: 13px !important;
    }
    #logo_header {
        height: 46px !important;
    }
}
