/* ==========================================================================
   MITN Double-Slider Auth Form
   Inspired by: w3frontend / Jeffrin-Singh double-slider-auth-form
   Adapted to MITN Design System tokens + brand red palette
   Applied on: /tai-khoan/ page AND #login-form-popup (Magnific Popup)
   ========================================================================== */

/* ---------- Wrapper resets (kill Flatsome col2-set defaults) ---------- */
.mitn-auth-wrap {
    max-width: 880px;
    margin: 40px auto;
    padding: 0;
}
.mitn-auth-wrap .account-container,
.mitn-auth-wrap.account-container { padding: 0 !important; }

/* Inside login popup (mfp) — tighter container, full reset */
.mfp-content #login-form-popup.lightbox-content .mitn-auth-wrap {
    margin: 0;
    max-width: 100%;
}
.mfp-content #login-form-popup.lightbox-content {
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    max-width: 880px !important;
    width: calc(100vw - 32px) !important;
}

/* ---------- Container ---------- */
.mitn-auth {
    position: relative;
    width: 100%;
    min-height: 540px;
    overflow: hidden;
    border-radius: var(--mitn-radius-lg, 16px);
    background: #fff;
    box-shadow:
        0 14px 28px rgba(0, 0, 0, 0.18),
        0 10px 10px rgba(0, 0, 0, 0.10);
}

/* ---------- Form containers (absolute, overlap) ---------- */
.mitn-auth__form-container {
    position: absolute;
    top: 0;
    height: 100%;
    width: 50%;
    transition: all 0.6s ease-in-out;
}

.mitn-auth__sign-in {
    left: 0;
    z-index: 2;
}

.mitn-auth__sign-up {
    left: 0;
    opacity: 0;
    z-index: 1;
}

/* Toggle state — slides via .right-panel-active on .mitn-auth */
.mitn-auth.right-panel-active .mitn-auth__sign-in {
    transform: translateX(100%);
}

.mitn-auth.right-panel-active .mitn-auth__sign-up {
    transform: translateX(100%);
    opacity: 1;
    z-index: 5;
    animation: mitnAuthShow 0.6s;
}

@keyframes mitnAuthShow {
    0%, 49.99% { opacity: 0; z-index: 1; }
    50%, 100%  { opacity: 1; z-index: 5; }
}

/* ---------- Forms inside ---------- */
.mitn-auth__form {
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0 48px;
    height: 100%;
    text-align: center;
    margin: 0 !important;
}

.mitn-auth__title {
    font-family: var(--font-heading, inherit);
    font-weight: 700;
    font-size: 26px;
    line-height: 1.2;
    margin: 0 0 6px;
    color: var(--mitn-c-ink, #111);
    letter-spacing: 0.01em;
}

.mitn-auth__hint {
    font-size: 13px;
    color: var(--mitn-ms-muted, #6b7280);
    margin: 0 0 18px;
}

.mitn-auth__notice {
    font-size: 12px;
    color: var(--mitn-ms-muted, #6b7280);
    background: #f6f7f9;
    border-radius: 8px;
    padding: 8px 12px;
    margin: 0 0 12px;
    width: 100%;
}

/* ---------- Inputs ---------- */
.mitn-auth__field {
    width: 100%;
    margin: 6px 0;
}

.mitn-auth__input {
    width: 100%;
    height: 46px;
    background: #f1f3f5;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 0 14px;
    font-size: 14px;
    line-height: 46px;
    color: var(--mitn-c-ink, #111);
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    box-shadow: none;
    margin: 0;
}

.mitn-auth__input:focus {
    outline: none;
    background: #fff;
    border-color: var(--mitn-c-red, #DD3333);
    box-shadow: 0 0 0 3px rgba(221, 51, 51, 0.15);
}

.mitn-auth__input::placeholder {
    color: #98a2b3;
}

/* ---------- Remember me + lost link ---------- */
.mitn-auth__remember {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--mitn-ms-muted, #6b7280);
    margin: 8px 0 4px;
    cursor: pointer;
    user-select: none;
}
.mitn-auth__remember input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0;
    accent-color: var(--mitn-c-red, #DD3333);
}

.mitn-auth__lost {
    display: inline-block;
    color: var(--mitn-ms-muted, #6b7280);
    font-size: 12px;
    text-decoration: none;
    margin: 4px 0 14px;
    transition: color 0.18s ease;
}
.mitn-auth__lost:hover {
    color: var(--mitn-c-red, #DD3333);
    text-decoration: underline;
}

/* ---------- Buttons ---------- */
.mitn-auth__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    border: 1px solid var(--mitn-c-red, #DD3333);
    background: var(--mitn-c-red, #DD3333);
    color: #fff !important;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 12px 36px;
    margin-top: 4px;
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.18s ease, background 0.18s ease;
    box-shadow: 0 4px 12px rgba(221, 51, 51, 0.25);
}
.mitn-auth__btn:hover {
    background: #c12828;
    border-color: #c12828;
    box-shadow: 0 6px 16px rgba(221, 51, 51, 0.32);
}
.mitn-auth__btn:active {
    transform: scale(0.97);
}
.mitn-auth__btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(221, 51, 51, 0.25);
}

/* Ghost buttons (inside overlay) */
.mitn-auth__ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    background: transparent;
    border: 1.5px solid #fff;
    color: #fff !important;
    border-radius: 24px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 12px 36px;
    margin-top: 8px;
    cursor: pointer;
    transition: transform 0.08s ease, background 0.18s ease;
}
.mitn-auth__ghost:hover {
    background: rgba(255, 255, 255, 0.12);
}
.mitn-auth__ghost:active {
    transform: scale(0.97);
}
.mitn-auth__ghost:focus,
.mitn-auth__ghost:focus-visible {
    outline: none !important;
    outline-offset: 0 !important;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.4);
}
.mitn-auth__ghost {
    -webkit-tap-highlight-color: transparent;
}

/* ---------- Overlay container ---------- */
.mitn-auth__overlay-container {
    position: absolute;
    top: 0;
    left: 50%;
    width: 50%;
    height: 100%;
    overflow: hidden;
    transition: transform 0.6s ease-in-out;
    z-index: 100;
}

.mitn-auth.right-panel-active .mitn-auth__overlay-container {
    transform: translateX(-100%);
}

.mitn-auth__overlay {
    position: relative;
    left: -100%;
    height: 100%;
    width: 200%;
    transform: translateX(0);
    transition: transform 0.6s ease-in-out;
    background: linear-gradient(135deg, #DD3333 0%, #8b1818 100%);
    color: #fff;
}

.mitn-auth.right-panel-active .mitn-auth__overlay {
    transform: translateX(50%);
}

/* Panels inside overlay */
.mitn-auth__overlay-panel {
    position: absolute;
    top: 0;
    height: 100%;
    width: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 36px;
    text-align: center;
    transform: translateX(0);
    transition: transform 0.6s ease-in-out;
}

.mitn-auth__overlay-left {
    transform: translateX(-20%);
}
.mitn-auth.right-panel-active .mitn-auth__overlay-left {
    transform: translateX(0);
}

.mitn-auth__overlay-right {
    right: 0;
    transform: translateX(0);
}
.mitn-auth.right-panel-active .mitn-auth__overlay-right {
    transform: translateX(20%);
}

.mitn-auth__overlay-title {
    font-family: var(--font-heading, inherit);
    font-weight: 700;
    font-size: 28px;
    line-height: 1.15;
    color: #fff;
    margin: 0 0 12px;
    letter-spacing: 0.01em;
}

.mitn-auth__overlay-desc {
    font-size: 13px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.92);
    margin: 0 0 20px;
    max-width: 280px;
}

/* ---------- Solo mode (registration disabled) ---------- */
.mitn-auth.mitn-auth--solo {
    min-height: 420px;
}
.mitn-auth__sign-in--solo {
    position: relative !important;
    width: 100% !important;
    transform: none !important;
}

/* ---------- Mobile: keep horizontal slide; overlay becomes top banner ---------- */
@media (max-width: 720px) {
    .mitn-auth {
        min-height: 600px;
        overflow: hidden;
    }

    /* Overlay container = compact top banner, full width, no slide */
    .mitn-auth__overlay-container {
        top: 0;
        left: 0;
        width: 100%;
        height: 180px;
        transform: none !important;
        z-index: 10;
    }
    .mitn-auth__overlay {
        position: absolute;
        inset: 0;
        left: 0;
        width: 100%;
        height: 100%;
        transform: none !important;
        background: linear-gradient(135deg, #DD3333 0%, #8b1818 100%);
    }
    .mitn-auth__overlay-panel {
        position: absolute;
        inset: 0;
        width: 100% !important;
        height: 100%;
        padding: 16px 22px;
        transform: none !important;
        transition: opacity 0.35s ease;
    }
    .mitn-auth__overlay-right {
        opacity: 1;
        pointer-events: auto;
        right: auto;
    }
    .mitn-auth__overlay-left {
        opacity: 0;
        pointer-events: none;
    }
    .mitn-auth.right-panel-active .mitn-auth__overlay-right { opacity: 0; pointer-events: none; }
    .mitn-auth.right-panel-active .mitn-auth__overlay-left { opacity: 1; pointer-events: auto; }

    /* Form containers occupy the area below the banner; slide horizontally */
    .mitn-auth__form-container {
        top: 180px;
        left: 0;
        width: 100%;
        height: calc(100% - 180px);
        transition: transform 0.55s ease-in-out;
        animation: none !important;
    }

    /* Login: visible at translateX(0); Register: off-screen right at translateX(100%) */
    .mitn-auth__sign-in {
        transform: translateX(0);
        opacity: 1;
        z-index: 2;
    }
    .mitn-auth__sign-up {
        transform: translateX(100%);
        opacity: 1;
        z-index: 2;
    }
    .mitn-auth.right-panel-active .mitn-auth__sign-in {
        transform: translateX(-100%);
    }
    .mitn-auth.right-panel-active .mitn-auth__sign-up {
        transform: translateX(0);
        opacity: 1;
        z-index: 2;
        animation: none !important;
    }

    /* Compact form layout for mobile */
    .mitn-auth__form {
        padding: 22px 22px 18px;
        justify-content: flex-start;
    }
    .mitn-auth__title {
        font-size: 22px;
        margin: 4px 0 4px;
    }
    .mitn-auth__hint {
        font-size: 12px;
        margin: 0 0 14px;
    }
    .mitn-auth__field { margin: 5px 0; }
    .mitn-auth__input {
        height: 42px;
        line-height: 42px;
        font-size: 13px;
    }
    .mitn-auth__btn {
        padding: 10px 28px;
        font-size: 11px;
        margin-top: 8px;
    }
    .mitn-auth__remember,
    .mitn-auth__lost { font-size: 11px; }

    /* Banner content */
    .mitn-auth__overlay-title {
        font-size: 18px;
        margin: 0 0 6px;
    }
    .mitn-auth__overlay-desc {
        font-size: 11px;
        line-height: 1.45;
        margin: 0 0 10px;
        max-width: none;
    }
    .mitn-auth__ghost {
        padding: 8px 24px;
        font-size: 11px;
        margin-top: 4px;
    }

    /* Solo mode (no register) — no banner, full-height form */
    .mitn-auth.mitn-auth--solo { min-height: 420px; }
    .mitn-auth.mitn-auth--solo .mitn-auth__form-container {
        top: 0;
        height: 100%;
    }
}

/* Override the input height adjustment for mobile inside #customer_login override block */
@media (max-width: 720px) {
    #customer_login.mitn-auth input.mitn-auth__input,
    #customer_login.mitn-auth input[type="text"].mitn-auth__input,
    #customer_login.mitn-auth input[type="email"].mitn-auth__input,
    #customer_login.mitn-auth input[type="password"].mitn-auth__input {
        height: 42px;
        min-height: 42px;
        line-height: 42px;
        font-size: 13px;
    }
    #customer_login.mitn-auth button.mitn-auth__btn {
        padding: 10px 28px;
        font-size: 11px;
    }
    #customer_login.mitn-auth button.mitn-auth__ghost {
        padding: 8px 24px;
        font-size: 11px;
    }
}

/* ============================================================================
   Overrides: neutralize older #customer_login rules from page-account.css
   (those targeted Flatsome's u-columns/.form-row layout — our new markup
   reuses #customer_login but with .mitn-auth__* classes, so we need higher
   specificity for inputs/headings/buttons to win.)
   ============================================================================ */

/* Heading — kill the underline-and-uppercase block applied by old rules */
#customer_login.mitn-auth h2.mitn-auth__title {
    text-transform: none;
    border-bottom: 0;
    padding-bottom: 0;
    display: block;
    width: 100%;
    font-size: 26px;
    margin: 0 0 6px;
}

/* Inputs — pill style wins */
#customer_login.mitn-auth input.mitn-auth__input,
#customer_login.mitn-auth input[type="text"].mitn-auth__input,
#customer_login.mitn-auth input[type="email"].mitn-auth__input,
#customer_login.mitn-auth input[type="password"].mitn-auth__input {
    height: 46px;
    min-height: 46px;
    background: #f1f3f5;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 0 14px;
    font-size: 14px;
    line-height: 46px;
}
#customer_login.mitn-auth input.mitn-auth__input:focus,
#customer_login.mitn-auth input.mitn-auth__input:focus-visible {
    background: #fff;
    border-color: var(--mitn-c-red, #DD3333);
    box-shadow: 0 0 0 3px rgba(221, 51, 51, 0.15);
}

/* Buttons — pill style wins over old full-width brand block */
#customer_login.mitn-auth button.mitn-auth__btn,
#customer_login.mitn-auth button.mitn-auth__btn[type="submit"] {
    width: auto;
    min-height: 0;
    padding: 12px 36px;
    border-radius: 24px;
    font-size: 12px;
    letter-spacing: 0.08em;
}

/* Ghost buttons inside overlay must NOT inherit brand red */
#customer_login.mitn-auth button.mitn-auth__ghost,
#customer_login.mitn-auth button.mitn-auth__ghost[type="button"] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    width: auto;
    min-height: 0;
    background: transparent !important;
    background-image: none !important;
    border: 1.5px solid #fff !important;
    color: #fff !important;
    box-shadow: none !important;
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
    padding: 12px 36px;
    border-radius: 24px;
    font-size: 12px;
    letter-spacing: 0.08em;
}
#customer_login.mitn-auth button.mitn-auth__ghost:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    box-shadow: none !important;
    outline: none !important;
}
#customer_login.mitn-auth button.mitn-auth__ghost:focus,
#customer_login.mitn-auth button.mitn-auth__ghost:focus-visible,
#customer_login.mitn-auth button.mitn-auth__ghost:active {
    outline: none !important;
    outline-offset: 0 !important;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.4) !important;
    background: rgba(255, 255, 255, 0.12) !important;
}

/* Kill the auto-padding the old block puts on lightbox-inner */
.account-container.lightbox-inner.mitn-auth-wrap,
#login-form-popup .account-container.lightbox-inner.mitn-auth-wrap {
    padding: 0 !important;
    background: transparent !important;
}

/* Old block sets max-width 920px on popup with rounded corners — keep size, let
   .mitn-auth carry the shadow/radius. Make popup transparent. */
.mfp-content #login-form-popup.lightbox-content {
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
}

/* ---------- Notices / errors from WC ---------- */
.mitn-auth .woocommerce-notices-wrapper,
.mitn-auth-wrap > .woocommerce-notices-wrapper {
    width: 100%;
    margin-bottom: 14px;
}
.mitn-auth .woocommerce-error,
.mitn-auth .woocommerce-message,
.mitn-auth .woocommerce-info,
.mitn-auth-wrap .woocommerce-error,
.mitn-auth-wrap .woocommerce-message,
.mitn-auth-wrap .woocommerce-info {
    border-radius: 10px;
    font-size: 13px;
    padding: 12px 14px;
    margin: 0 0 12px;
    list-style: none;
}
