/* =========================================================
   ZeroMaxShop authentication page
   Loaded after style.css to keep this page isolated.
========================================================= */

:root {
    --zmx-auth-orange: #ef5b43;
    --zmx-auth-blue: #2f9ed8;
    --zmx-auth-navy: #171b32;
    --zmx-auth-text: #17181d;
    --zmx-auth-muted: #747883;
    --zmx-auth-border: #e7e8ed;
}

body.zmx-auth-page-body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(
            circle at 8% 8%,
            rgba(47, 158, 216, 0.055),
            transparent 30%
        ),
        radial-gradient(
            circle at 92% 12%,
            rgba(239, 91, 67, 0.05),
            transparent 28%
        ),
        #ffffff;
}

/* =========================================================
   Header
========================================================= */

body.zmx-auth-page-body .zmx-auth-header {
    position: relative;
    z-index: 20;
    display: flex;
    width: 100%;
    min-height: 66px;
    align-items: center;
    padding: 9px 24px;
    border-bottom: 1px solid var(--zmx-auth-border);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 5px 18px rgba(15, 23, 42, 0.035);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

body.zmx-auth-page-body .zmx-auth-brand {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
    color: var(--zmx-auth-text);
    text-decoration: none;
}

body.zmx-auth-page-body .zmx-auth-brand:hover,
body.zmx-auth-page-body .zmx-auth-brand:focus {
    color: var(--zmx-auth-text);
    text-decoration: none;
}

body.zmx-auth-page-body .zmx-auth-brand-logo {
    display: block;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    object-fit: contain;
}

body.zmx-auth-page-body .zmx-auth-brand-copy {
    display: grid;
    min-width: 0;
    gap: 4px;
}

body.zmx-auth-page-body .zmx-auth-brand-name {
    display: inline-flex;
    align-items: baseline;
    overflow: visible;
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        sans-serif;
    font-size: 23px;
    font-weight: 950;
    letter-spacing: -0.065em;
    line-height: 1;
    white-space: nowrap;
}

body.zmx-auth-page-body .zmx-auth-brand-zero {
    color: var(--zmx-auth-orange);
}

body.zmx-auth-page-body .zmx-auth-brand-max {
    color: var(--zmx-auth-blue);
}

body.zmx-auth-page-body .zmx-auth-brand-shop {
    color: var(--zmx-auth-navy);
}

body.zmx-auth-page-body .zmx-auth-brand-subtitle {
    display: block;
    color: var(--zmx-auth-muted);
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        sans-serif;
    font-size: 10.5px;
    font-weight: 760;
    letter-spacing: 0.055em;
    line-height: 1;
    text-transform: lowercase;
    white-space: nowrap;
}

/* =========================================================
   Fix the excessive space above the authentication card
========================================================= */

body.zmx-auth-page-body .auth-page {
    display: flex;
    width: 100%;
    min-height: calc(100vh - 66px);
    align-items: flex-start;
    justify-content: center;
    margin: 0 !important;
    padding:
        clamp(22px, 4vh, 42px)
        16px
        40px !important;
}

body.zmx-auth-page-body .auth-card {
    margin-top: 0 !important;
}

/* Keep the existing form design but prevent legacy topbar spacing rules. */
body.zmx-auth-page-body > .topbar {
    display: none !important;
}

/* =========================================================
   Mobile
========================================================= */

@media (max-width: 768px) {
    body.zmx-auth-page-body .zmx-auth-header {
        min-height: 60px;
        justify-content: center;
        padding: 8px 14px;
    }

    /* Mobile uses the wordmark without the image logo. */
    body.zmx-auth-page-body .zmx-auth-brand-logo {
        display: none;
    }

    body.zmx-auth-page-body .zmx-auth-brand {
        justify-content: center;
    }

    body.zmx-auth-page-body .zmx-auth-brand-copy {
        justify-items: center;
        gap: 4px;
    }

    body.zmx-auth-page-body .zmx-auth-brand-name {
        font-size: clamp(21px, 6.2vw, 25px);
    }

    body.zmx-auth-page-body .zmx-auth-brand-subtitle {
        font-size: 10px;
        letter-spacing: 0.065em;
    }

    body.zmx-auth-page-body .auth-page {
        min-height: calc(100vh - 60px);
        padding:
            16px
            12px
            max(28px, env(safe-area-inset-bottom)) !important;
    }

    body.zmx-auth-page-body .auth-card {
        width: min(100%, 460px);
    }
}

@media (max-width: 390px) {
    body.zmx-auth-page-body .zmx-auth-header {
        min-height: 58px;
    }

    body.zmx-auth-page-body .zmx-auth-brand-name {
        font-size: 20px;
    }

    body.zmx-auth-page-body .auth-page {
        min-height: calc(100vh - 58px);
        padding-top: 12px !important;
    }
}


/* =========================================================
   Auth page v2 adjustments
========================================================= */

@media (max-width: 768px) {
    /* Keep the brand aligned to the left like the rest of the site. */
    body.zmx-auth-page-body .zmx-auth-header {
        justify-content: flex-start !important;
        padding-inline: 14px !important;
    }

    body.zmx-auth-page-body .zmx-auth-brand {
        justify-content: flex-start !important;
    }

    body.zmx-auth-page-body .zmx-auth-brand-copy {
        justify-items: start !important;
        text-align: left !important;
    }

    /*
       Leave a little breathing room below the header without recreating
       the oversized gap from the original page.
    */
    body.zmx-auth-page-body .auth-page {
        padding-top: 28px !important;
    }
}

@media (max-width: 390px) {
    body.zmx-auth-page-body .auth-page {
        padding-top: 24px !important;
    }
}


/* =========================================================
   Authentication header consistency
========================================================= */

body.zmx-auth-page-body .zmx-auth-header {
    justify-content: space-between !important;
    gap: 16px;
}

body.zmx-auth-page-body .zmx-auth-back-link {
    display: inline-flex;
    min-height: 40px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 14px;
    border: 1px solid #e7e8ed;
    border-radius: 14px;
    background: #ffffff;
    color: #1c1e24;
    font-size: 12px;
    font-weight: 850;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 5px 14px rgba(15, 23, 42, 0.035);
    transition:
        border-color 160ms ease,
        background 160ms ease,
        transform 160ms ease,
        box-shadow 160ms ease;
}

body.zmx-auth-page-body .zmx-auth-back-link:hover,
body.zmx-auth-page-body .zmx-auth-back-link:focus {
    border-color: #d5c8f2;
    background: #faf8ff;
    color: #1c1e24;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.07);
}

body.zmx-auth-page-body .zmx-auth-back-arrow {
    font-size: 16px;
    line-height: 1;
}

@media (max-width: 768px) {
    body.zmx-auth-page-body .zmx-auth-header {
        justify-content: space-between !important;
        padding-inline: 14px !important;
    }

    body.zmx-auth-page-body .zmx-auth-brand-logo {
        display: none !important;
    }

    body.zmx-auth-page-body .zmx-auth-brand,
    body.zmx-auth-page-body .zmx-auth-brand-copy {
        justify-content: flex-start !important;
        justify-items: start !important;
        text-align: left !important;
    }

    body.zmx-auth-page-body .zmx-auth-brand-subtitle {
        display: block !important;
        color: #737782 !important;
    }

    body.zmx-auth-page-body .zmx-auth-back-link {
        min-height: 36px;
        padding: 0 10px;
        border-radius: 12px;
        font-size: 11px;
    }
}

@media (max-width: 390px) {
    body.zmx-auth-page-body .zmx-auth-back-link span:last-child {
        display: none;
    }

    body.zmx-auth-page-body .zmx-auth-back-link {
        width: 36px;
        padding: 0;
    }
}

/* =========================================================
   Authentication fixed top bar + dashboard-consistent mobile drawer
========================================================= */

:root {
    --zmx-auth-header-height: 66px;
}

body.zmx-auth-page-body {
    padding-top: var(--zmx-auth-header-height);
}

body.zmx-auth-page-body .zmx-auth-header {
    position: fixed !important;
    inset: 0 0 auto 0 !important;
    top: 0 !important;
    z-index: 5000 !important;
    height: var(--zmx-auth-header-height);
    min-height: var(--zmx-auth-header-height);
    isolation: isolate;
}

body.zmx-auth-page-body .auth-page {
    padding-top: 18px !important;
}

body.zmx-auth-page-body .zmx-auth-header-brand-side {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
}

body.zmx-auth-page-body .zmx-auth-menu-toggle {
    display: none;
}

/* Dark overlay without blurring the drawer or page into one layer. */
body.zmx-auth-page-body .zmx-auth-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9500;
    display: block;
    visibility: hidden;
    background: rgba(12, 14, 20, 0.42);
    opacity: 0;
    pointer-events: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transition:
        opacity 260ms ease,
        visibility 0s linear 260ms;
}

body.zmx-auth-page-body
.zmx-auth-menu-backdrop.is-mounted {
    visibility: visible;
    transition-delay: 0s;
}

body.zmx-auth-page-body
.zmx-auth-menu-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

body.zmx-auth-page-body .zmx-auth-menu-panel {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    z-index: 9600 !important;
    display: block !important;
    visibility: hidden;
    width: min(86vw, 340px) !important;
    height: 100dvh !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
    border-radius: 0 24px 24px 0 !important;
    background: #ffffff !important;
    box-shadow: 18px 0 55px rgba(15, 23, 42, 0.22) !important;
    opacity: 0;
    transform: translate3d(-108%, 0, 0) !important;
    transition:
        transform 320ms cubic-bezier(0.2, 0.82, 0.2, 1),
        opacity 190ms ease,
        visibility 0s linear 320ms !important;
    will-change: transform;
}

body.zmx-auth-page-body
.zmx-auth-menu-panel.is-mounted {
    visibility: visible;
    transition-delay: 0s !important;
}

body.zmx-auth-page-body
.zmx-auth-menu-panel.is-open {
    opacity: 1;
    transform: translate3d(0, 0, 0) !important;
}

body.zmx-auth-page-body .zmx-auth-menu-panel-inner {
    height: 100%;
    padding:
        max(18px, env(safe-area-inset-top))
        17px
        max(22px, env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

body.zmx-auth-page-body
.zmx-auth-menu-panel
.mobile-menu-header {
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: -2px -2px 14px;
    padding: 8px 2px 14px;
    background: rgba(255, 255, 255, 0.95);
    color: #111318;
    font-size: 14px;
    font-weight: 800;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

body.zmx-auth-page-body
.zmx-auth-menu-panel
.mobile-menu-close {
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--zmx-auth-border);
    border-radius: 13px;
    background: #ffffff;
    color: #111318;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
}

body.zmx-auth-page-body
.zmx-auth-menu-panel
.mobile-menu-section {
    padding: 14px;
    border: 1px solid #e5e6eb;
    border-radius: 20px;
    background: #ffffff;
    box-shadow:
        0 10px 28px rgba(15, 23, 42, 0.045),
        inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

body.zmx-auth-page-body
.zmx-auth-menu-panel
.mobile-menu-section
+ .mobile-menu-section {
    margin-top: 13px;
}

body.zmx-auth-page-body
.zmx-auth-menu-panel
.mobile-menu-heading {
    margin: 0 0 10px;
    color: #777985;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.065em;
    line-height: 1;
    text-transform: uppercase;
}

body.zmx-auth-page-body
.zmx-auth-menu-panel
.mobile-menu-section
> .mobile-menu-link {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 12px;
    border: 1px solid #e5e6eb;
    border-radius: 14px;
    background: #ffffff;
    color: #111318;
    font-size: 14px;
    font-weight: 850;
    line-height: 1.2;
    text-decoration: none;
    box-shadow: 0 4px 13px rgba(15, 23, 42, 0.025);
}

body.zmx-auth-page-body
.zmx-auth-menu-panel
.mobile-menu-section
> .mobile-menu-link
+ .mobile-menu-link {
    margin-top: 7px;
}

body.zmx-auth-page-body
.zmx-auth-menu-panel
.mobile-menu-section
> .mobile-menu-link:hover,
body.zmx-auth-page-body
.zmx-auth-menu-panel
.mobile-menu-section
> .mobile-menu-link:focus-visible {
    border-color: #d7d9df;
    background: #f8f8fa;
    color: #111318;
    text-decoration: none;
}

body.zmx-auth-page-body
.zmx-auth-menu-panel
.mobile-menu-section
> .mobile-menu-link[aria-current="page"] {
    border-color: #d7c6fb;
    background: #f7f3ff;
    color: #4f279f;
}

body.zmx-auth-page-body
.zmx-auth-menu-panel
.mobile-menu-link:focus-visible,
body.zmx-auth-page-body
.zmx-auth-menu-panel
.mobile-category-summary:focus-visible,
body.zmx-auth-page-body
.zmx-auth-menu-panel
.mobile-category-link:focus-visible {
    outline: 3px solid rgba(113, 69, 214, 0.16);
    outline-offset: 2px;
}

body.zmx-auth-page-body
.zmx-auth-menu-panel
.mobile-menu-badge {
    display: inline-flex;
    min-width: 20px;
    height: 20px;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: #e60023;
    color: #ffffff;
    font-size: 10px;
    font-weight: 950;
    line-height: 1;
}

body.zmx-auth-page-body
.zmx-auth-menu-panel
.mobile-menu-like-left {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

body.zmx-auth-page-body
.zmx-auth-menu-panel
.mobile-menu-like-icon {
    font-size: 16px;
}

/* Outlined expandable category card. */
body.zmx-auth-page-body
.zmx-auth-menu-panel
.mobile-category-dropdown {
    overflow: hidden;
    border: 1px solid #e5e6eb;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 4px 13px rgba(15, 23, 42, 0.025);
}

body.zmx-auth-page-body
.zmx-auth-menu-panel
.mobile-category-summary {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 12px;
    color: #111318;
    font-size: 14px;
    font-weight: 900;
    list-style: none;
    cursor: pointer;
}

body.zmx-auth-page-body
.zmx-auth-menu-panel
.mobile-category-summary::-webkit-details-marker {
    display: none;
}

body.zmx-auth-page-body
.zmx-auth-menu-panel
.mobile-category-summary-right {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #777985;
    font-size: 12px;
    font-weight: 900;
}

body.zmx-auth-page-body
.zmx-auth-menu-panel
.mobile-category-summary-right i {
    font-size: 13px;
    transition: transform 180ms ease;
}

body.zmx-auth-page-body
.zmx-auth-menu-panel
.mobile-category-list {
    max-height: 0;
    padding: 0;
    overflow: hidden;
    border-top: 0 solid #e5e6eb;
    background: #ffffff;
    opacity: 0;
    transform: translateY(-4px);
    transition:
        max-height 240ms ease,
        padding 240ms ease,
        border-width 240ms ease,
        opacity 180ms ease,
        transform 180ms ease;
}

body.zmx-auth-page-body
.zmx-auth-menu-panel
.mobile-category-dropdown[open]
.mobile-category-list {
    max-height: min(58dvh, 560px);
    padding: 8px 8px 9px;
    overflow-y: auto;
    border-top-width: 1px;
    opacity: 1;
    transform: translateY(0);
    overscroll-behavior: contain;
}

body.zmx-auth-page-body
.zmx-auth-menu-panel
.mobile-category-dropdown[open]
.mobile-category-summary-right i {
    transform: rotate(180deg);
}

body.zmx-auth-page-body
.zmx-auth-menu-panel
.mobile-category-link {
    display: flex;
    min-height: 39px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 5px 0 10px;
    border-radius: 10px;
    color: #111318;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

body.zmx-auth-page-body
.zmx-auth-menu-panel
.mobile-category-link:hover,
body.zmx-auth-page-body
.zmx-auth-menu-panel
.mobile-category-link:focus-visible {
    background: #f7f7fa;
    color: #111318;
    text-decoration: none;
}

body.zmx-auth-page-body
.zmx-auth-menu-panel
.mobile-category-link
span:last-child {
    min-width: 24px;
    color: #777985;
    font-size: 12px;
    font-weight: 900;
    text-align: right;
}

body.zmx-auth-page-body
.zmx-auth-menu-panel
.mobile-menu-link,
body.zmx-auth-page-body
.zmx-auth-menu-panel
.mobile-category-summary,
body.zmx-auth-page-body
.zmx-auth-menu-panel
.mobile-category-link {
    opacity: 0;
    transform: translateX(-9px);
    transition:
        opacity 210ms ease,
        transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1),
        background 160ms ease;
    transition-delay: 0ms;
}

body.zmx-auth-page-body
.zmx-auth-menu-panel.is-open
.mobile-menu-link,
body.zmx-auth-page-body
.zmx-auth-menu-panel.is-open
.mobile-category-summary,
body.zmx-auth-page-body
.zmx-auth-menu-panel.is-open
.mobile-category-link {
    opacity: 1;
    transform: translateX(0);
    transition-delay:
        calc(var(--zmx-item-index, 0) * 22ms + 70ms);
}

html.zmx-auth-menu-lock,
html.zmx-auth-menu-lock body {
    overflow: hidden !important;
    overscroll-behavior: none;
}

@media (max-width: 768px) {
    :root {
        --zmx-auth-header-height: 60px;
    }

    body.zmx-auth-page-body .zmx-auth-header-brand-side {
        gap: 8px;
    }

    body.zmx-auth-page-body .zmx-auth-menu-toggle {
        position: relative;
        display: inline-block;
        width: 43px;
        height: 43px;
        flex: 0 0 43px;
        padding: 0;
        border: 1px solid var(--zmx-auth-border);
        border-radius: 15px;
        background: #ffffff;
        box-shadow:
            0 7px 18px rgba(15, 23, 42, 0.045),
            inset 0 1px 0 rgba(255, 255, 255, 0.8);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    body.zmx-auth-page-body .zmx-auth-menu-line {
        position: absolute;
        left: 11px;
        width: 21px;
        height: 2.5px;
        border-radius: 999px;
        background: #15171b;
        transform-origin: center;
        transition:
            transform 240ms cubic-bezier(0.2, 0.75, 0.2, 1),
            opacity 160ms ease,
            top 240ms cubic-bezier(0.2, 0.75, 0.2, 1);
    }

    body.zmx-auth-page-body
    .zmx-auth-menu-line:nth-child(1) {
        top: 13px;
    }

    body.zmx-auth-page-body
    .zmx-auth-menu-line:nth-child(2) {
        top: 20px;
    }

    body.zmx-auth-page-body
    .zmx-auth-menu-line:nth-child(3) {
        top: 27px;
    }

    body.zmx-auth-page-body
    .zmx-auth-menu-toggle.is-open
    .zmx-auth-menu-line:nth-child(1) {
        top: 20px;
        transform: rotate(45deg);
    }

    body.zmx-auth-page-body
    .zmx-auth-menu-toggle.is-open
    .zmx-auth-menu-line:nth-child(2) {
        opacity: 0;
        transform: scaleX(0.3);
    }

    body.zmx-auth-page-body
    .zmx-auth-menu-toggle.is-open
    .zmx-auth-menu-line:nth-child(3) {
        top: 20px;
        transform: rotate(-45deg);
    }

    body.zmx-auth-page-body .zmx-auth-brand {
        min-width: 0;
    }
}

@media (max-width: 390px) {
    body.zmx-auth-page-body .zmx-auth-menu-toggle {
        width: 39px;
        height: 39px;
        flex-basis: 39px;
    }

    body.zmx-auth-page-body .zmx-auth-menu-line {
        left: 10px;
        width: 19px;
    }

    body.zmx-auth-page-body
    .zmx-auth-menu-line:nth-child(1) {
        top: 12px;
    }

    body.zmx-auth-page-body
    .zmx-auth-menu-line:nth-child(2) {
        top: 18px;
    }

    body.zmx-auth-page-body
    .zmx-auth-menu-line:nth-child(3) {
        top: 24px;
    }

    body.zmx-auth-page-body
    .zmx-auth-menu-toggle.is-open
    .zmx-auth-menu-line:nth-child(1),
    body.zmx-auth-page-body
    .zmx-auth-menu-toggle.is-open
    .zmx-auth-menu-line:nth-child(3) {
        top: 18px;
    }

    body.zmx-auth-page-body
    .zmx-auth-menu-panel-inner {
        padding-right: 14px;
        padding-left: 14px;
    }

    body.zmx-auth-page-body
    .zmx-auth-menu-panel
    .mobile-menu-section {
        padding: 12px;
        border-radius: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.zmx-auth-page-body .zmx-auth-menu-panel,
    body.zmx-auth-page-body .zmx-auth-menu-backdrop,
    body.zmx-auth-page-body .zmx-auth-menu-line,
    body.zmx-auth-page-body
    .zmx-auth-menu-panel
    .mobile-menu-link,
    body.zmx-auth-page-body
    .zmx-auth-menu-panel
    .mobile-category-summary,
    body.zmx-auth-page-body
    .zmx-auth-menu-panel
    .mobile-category-link,
    body.zmx-auth-page-body
    .zmx-auth-menu-panel
    .mobile-category-list {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

@media (max-width: 390px) {
    :root {
        --zmx-auth-header-height: 58px;
    }
}

/* Keep Login and Sign Up menu buttons white */
body.zmx-auth-page-body
.zmx-auth-menu-panel
.mobile-menu-section
> .mobile-menu-link[aria-current="page"],
body.zmx-auth-page-body
.zmx-auth-menu-panel
.mobile-menu-section
> .mobile-menu-link[aria-current="page"]:hover,
body.zmx-auth-page-body
.zmx-auth-menu-panel
.mobile-menu-section
> .mobile-menu-link[aria-current="page"]:focus-visible {
    border-color: #e5e6eb !important;
    background: #ffffff !important;
    color: #111318 !important;
    box-shadow: 0 4px 13px rgba(15, 23, 42, 0.025) !important;
}