/**
 * DucorMall auth pages (login, register, password reset)
 */
*,
*::before,
*::after {
    box-sizing: border-box;
}

.auth-shell {
    --auth-topbar-height: 3.75rem;
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--dm-bg);
    color: var(--dm-navy-dark);
    font-family: var(--dm-font);
}

/* —— Auth layout header —— */
.auth-topbar {
    flex-shrink: 0;
    background: var(--dm-surface);
    border-bottom: 1px solid var(--dm-border);
}

.auth-topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 100%;
    margin: 0 auto;
    padding: 0.75rem 1.25rem;
    min-height: var(--auth-topbar-height);
}

.auth-topbar__brand img {
    display: block;
    height: 36px;
    width: auto;
}

.auth-topbar__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 1px solid var(--dm-border);
    border-radius: var(--dm-radius-sm);
    background: var(--dm-bg);
    color: var(--dm-navy-dark);
    cursor: pointer;
    flex-shrink: 0;
    transition:
        background 0.15s,
        border-color 0.15s;
}

.auth-topbar__toggle:hover {
    background: var(--dm-surface);
    border-color: rgba(var(--dm-primary-rgb), 0.25);
}

.auth-topbar__toggle[aria-expanded="true"] {
    background: rgba(var(--dm-primary-rgb), 0.08);
    border-color: var(--dm-primary);
}

.auth-topbar__burger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 18px;
    height: 14px;
}

.auth-topbar__burger-line {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--dm-primary-hover);
    border-radius: 1px;
    transition:
        transform 0.2s,
        opacity 0.2s;
}

.auth-topbar__toggle[aria-expanded="true"]
    .auth-topbar__burger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.auth-topbar__toggle[aria-expanded="true"]
    .auth-topbar__burger-line:nth-child(2) {
    opacity: 0;
}

.auth-topbar__toggle[aria-expanded="true"]
    .auth-topbar__burger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.auth-topbar__overlay {
    position: fixed;
    inset: 0;
    z-index: 10040;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.auth-topbar__overlay:not([hidden]) {
    opacity: 1;
    pointer-events: auto;
}

.auth-topbar__menu {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 10050;
    width: min(100%, 18rem);
    height: 100%;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--dm-surface);
    box-shadow: -12px 0 40px rgba(15, 23, 42, 0.12);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    visibility: hidden;
}

.auth-topbar__menu.is-open {
    transform: translateX(0);
    visibility: visible;
}

.auth-topbar__menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    padding-top: max(1rem, env(safe-area-inset-top, 0px));
    border-bottom: 1px solid var(--dm-border);
    background: var(--dm-bg);
    flex-shrink: 0;
}

.auth-topbar__menu-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--dm-navy-dark);
}

.auth-topbar__menu-close {
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: var(--dm-radius-sm);
    background: var(--dm-surface);
    color: var(--dm-navy-dark);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.auth-topbar__menu-close:hover {
    background: var(--dm-border);
}

.auth-topbar__menu-nav {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.auth-topbar__menu-nav a,
.auth-topbar__menu-nav button {
    display: block;
    width: 100%;
    padding: 0.85rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--dm-navy-dark);
    text-decoration: none;
    text-align: left;
    border: none;
    background: transparent;
    font-family: inherit;
    cursor: pointer;
    transition:
        background 0.15s,
        color 0.15s;
}

.auth-topbar__menu-nav a:hover,
.auth-topbar__menu-nav button:hover {
    background: var(--dm-bg);
    color: var(--dm-primary);
}

.auth-topbar__menu-nav a.is-active {
    color: var(--dm-primary);
    background: rgba(var(--dm-primary-rgb), 0.06);
}

.auth-topbar__menu-cta {
    margin-top: 0.5rem;
    color: var(--dm-secondary) !important;
}

.auth-topbar__logout {
    margin: 0;
    padding: 0;
}

body.auth-menu-open {
    overflow: hidden;
}

@media (min-width: 576px) {
    .auth-topbar__menu {
        top: var(--auth-topbar-height);
        height: auto;
        max-height: calc(100dvh - var(--auth-topbar-height));
        border-bottom-left-radius: var(--dm-radius);
        border: 1px solid var(--dm-border);
        border-top: none;
        border-right: none;
    }
}

@media (min-width: 992px) {
    .auth-topbar__inner {
        padding: 0.75rem 2rem;
    }

    .auth-topbar__menu {
        width: 16rem;
    }
}

.auth-shell .auth-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 0;
}

.dm-auth-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: none;
    margin: 0;
}

.dm-auth-split {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    background: var(--dm-surface);
    overflow: hidden;
}

@media (max-width: 991.98px) {
    .dm-auth-benefits {
        display: none !important;
    }

    .dm-auth-split {
        border: none;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
    }

    .dm-auth-form-panel {
        position: relative;
        isolation: isolate;
        flex: 1;
        min-height: 100%;
        align-items: stretch;
        padding: 1rem 0.625rem 1.5rem;
        background: transparent;
    }

    .dm-auth-form-panel::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: 0;
        pointer-events: none;
        background-color: var(--dm-primary-hover);
        background-image:
            linear-gradient(
                165deg,
                rgba(15, 23, 42, 0.55) 0%,
                rgba(41, 44, 122, 0.35) 50%,
                rgba(15, 23, 42, 0.5) 100%
            ),
            var(--dm-auth-panel-image, none);
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
    }

    .dm-auth-card {
        position: relative;
        z-index: 1;
        width: 100%;
        max-width: none;
        background: #fff;
        padding: 1.35rem 1rem 1.65rem;
        border-radius: 0.875rem;
        box-shadow:
            0 4px 6px rgba(15, 23, 42, 0.06),
            0 16px 40px rgba(15, 23, 42, 0.12);
    }
}

@media (min-width: 992px) {
    .auth-shell .auth-main {
        align-items: stretch;
        justify-content: stretch;
    }

    .dm-auth-split {
        flex-direction: row;
        min-height: calc(100dvh - var(--auth-topbar-height));
        border: none;
        border-radius: 0;
        box-shadow: none;
    }
}

/* —— Left: benefits (desktop only) —— */
.dm-auth-benefits {
    position: relative;
    display: none;
    padding: 2.5rem 3rem;
    background-color: var(--dm-primary-hover);
    background-image:
        linear-gradient(
            145deg,
            rgba(15, 23, 42, 0.78) 0%,
            rgba(41, 44, 122, 0.58) 45%,
            rgba(15, 23, 42, 0.72) 100%
        ),
        var(--dm-auth-panel-image, none);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: #fff;
    overflow: hidden;
}

@media (min-width: 992px) {
    .dm-auth-benefits {
        display: flex;
        flex-direction: column;
        justify-content: center;
        flex: 1 1 50%;
        min-width: 0;
    }
}

.dm-auth-benefits::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.35) 0%,
        rgba(0, 0, 0, 0.08) 40%,
        rgba(0, 0, 0, 0.15) 70%,
        rgba(0, 0, 0, 0.4) 100%
    );
}

.dm-auth-benefits > * {
    position: relative;
    z-index: 1;
}

.dm-auth-benefits__logo {
    display: block;
    margin-bottom: 1.75rem;
    max-width: 15rem;
}

.dm-auth-benefits__logo img {
    display: block;
    width: 100%;
    max-width: 15rem;
    height: auto;
    object-fit: contain;
}

@media (min-width: 992px) {
    .dm-auth-benefits__logo {
        max-width: 16rem;
        margin-bottom: 2rem;
    }

    .dm-auth-benefits__logo img {
        max-width: 16rem;
    }
}

.dm-auth-benefits__eyebrow {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--dm-orange);
    margin: 0 0 0.5rem;
}

.dm-auth-benefits__headline {
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin: 0 0 0.65rem;
}

.dm-auth-benefits__lead {
    font-size: 0.9375rem;
    line-height: 1.55;
    opacity: 0.9;
    margin: 0 0 1.5rem;
    max-width: 22rem;
}

.dm-auth-benefits__list {
    list-style: none;
    margin: 0 0 1.75rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dm-auth-benefits__list li {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.dm-auth-benefits__icon {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    margin-top: 0.45rem;
    border-radius: 50%;
    background: var(--dm-orange);
    box-shadow: 0 0 0 3px rgba(var(--dm-secondary-rgb), 0.25);
}

.dm-auth-benefits__list strong {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
}

.dm-auth-benefits__list li > span > span {
    display: block;
    font-size: 0.8125rem;
    opacity: 0.82;
    line-height: 1.45;
}

.dm-auth-benefits__cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.dm-auth-benefits__btn-ghost {
    background: transparent !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
}

.dm-auth-benefits__btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: #fff !important;
}

/* —— Right: form —— */
.dm-auth-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0.5rem;
    background: var(--dm-surface);
}

@media (min-width: 992px) {
    .dm-auth-form-panel {
        flex: 1 1 50%;
        min-width: 0;
        padding: 2.5rem 0.5rem;
    }
}

.dm-auth-card {
    width: 100%;
    max-width: min(28rem, 100%);
}

.dm-auth-form {
    width: 100%;
}

.dm-auth-form .form-group {
    width: 100%;
}

.dm-auth-form .form-control,
.dm-auth-form .password-field-wrap,
.dm-auth-form .password-field-input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: block;
}

.dm-auth-form .password-field-wrap {
    position: relative;
}

.dm-auth-form .dm-account-types {
    width: 100%;
}

.dm-auth-card__logo-mobile {
    display: block;
    margin-bottom: 1.15rem;
    max-width: 11rem;
}

.dm-auth-card__logo-mobile img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

@media (min-width: 576px) and (max-width: 991.98px) {
    .dm-auth-card__logo-mobile {
        max-width: 12.5rem;
    }
}

@media (min-width: 992px) {
    .dm-auth-card__logo-mobile {
        display: none;
    }
}

.dm-auth-card__eyebrow {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--dm-orange);
    margin: 0 0 0.35rem;
}

.dm-auth-card__title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 0.35rem;
    color: var(--dm-navy-dark);
}

.dm-auth-card__subtitle {
    font-size: 0.9375rem;
    color: var(--dm-slate);
    margin: 0 0 1.5rem;
    line-height: 1.5;
}

.dm-auth-alert {
    border-radius: var(--dm-radius-sm);
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    border: 1px solid transparent;
}

.dm-auth-alert--success {
    background: #ecfdf5;
    border-color: #bbf7d0;
    color: #166534;
}

.dm-auth-alert--warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.dm-auth-alert--error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.dm-auth-alert ul {
    margin: 0;
    padding-left: 1.15rem;
}

.dm-auth-form .form-group {
    margin-bottom: 1.15rem;
}

.dm-auth-form label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--dm-navy-dark);
    margin-bottom: 0.4rem;
}

.dm-auth-form .form-control {
    border-radius: var(--dm-radius-sm);
    border: 1px solid var(--dm-border);
    padding: 0.65rem 0.85rem;
    font-size: 0.9375rem;
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
}

.dm-auth-form .form-control:focus {
    border-color: var(--dm-orange);
    box-shadow: 0 0 0 3px rgba(232, 135, 46, 0.15);
}

.dm-auth-form .form-control.is-invalid {
    border-color: #ef4444;
}

.dm-auth-form .field-error {
    font-size: 0.75rem;
    color: #dc2626;
    margin: 0.35rem 0 0;
}

.dm-auth-form .dm-btn[type="submit"] {
    margin-top: 0.25rem;
    padding: var(--dm-btn-padding-y) var(--dm-btn-padding-x);
    font-size: 0.9375rem;
}

.dm-auth-footer {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--dm-border);
    font-size: 0.875rem;
    color: var(--dm-slate);
    text-align: center;
}

.dm-auth-footer a {
    color: var(--dm-orange);
    font-weight: 600;
    text-decoration: none;
}

.dm-auth-footer a:hover {
    text-decoration: underline;
}

.dm-auth-link-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.dm-auth-link-row a {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--dm-orange);
    text-decoration: none;
}

.dm-auth-link-row a:hover {
    text-decoration: underline;
}

.dm-auth-remember {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    color: var(--dm-slate);
    font-weight: 500;
    margin: 0;
    cursor: pointer;
}

.dm-auth-remember input {
    accent-color: var(--dm-orange);
}

.dm-account-types {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    margin-bottom: 0.25rem;
}

.dm-account-type {
    position: relative;
    cursor: pointer;
}

.dm-account-type input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.dm-account-type__box {
    display: block;
    padding: 0.85rem 0.75rem;
    border: 2px solid var(--dm-border);
    border-radius: var(--dm-radius-sm);
    text-align: center;
    transition:
        border-color 0.15s,
        background 0.15s,
        box-shadow 0.15s;
}

.dm-account-type__box strong {
    display: block;
    font-size: 0.8125rem;
    color: var(--dm-navy-dark);
    margin-bottom: 0.15rem;
}

.dm-account-type__box span {
    font-size: 0.6875rem;
    color: var(--dm-slate);
    line-height: 1.35;
}

.dm-account-type input:checked + .dm-account-type__box {
    border-color: var(--dm-orange);
    background: #fff7ed;
    box-shadow: 0 0 0 3px rgba(var(--dm-secondary-rgb), 0.12);
}

.dm-account-type input:focus-visible + .dm-account-type__box {
    outline: 2px solid var(--dm-orange);
    outline-offset: 2px;
}

/* Password toggle */
.auth-shell .password-field-wrap {
    position: relative;
}

.auth-shell .password-field-wrap .password-field-input {
    padding-right: 2.75rem;
}

.auth-shell .password-field-toggle {
    position: absolute;
    top: 50%;
    right: 0.65rem;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--dm-slate);
    cursor: pointer;
    border-radius: 6px;
}

.auth-shell .password-field-toggle:hover {
    color: var(--dm-navy-dark);
}

.auth-shell .password-field-toggle:focus-visible {
    outline: 2px solid var(--dm-orange);
    outline-offset: 2px;
}

.auth-shell .password-field-toggle[aria-pressed="true"] .icon-eye-open {
    display: none;
}

.auth-shell .password-field-toggle[aria-pressed="true"] .icon-eye-closed {
    display: block !important;
}

.auth-shell .password-field-toggle[aria-pressed="false"] .icon-eye-closed {
    display: none !important;
}

/* Social sign-in */
.dm-auth-social {
    margin-bottom: 1.25rem;
}

.dm-auth-social__divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--dm-slate);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.dm-auth-social__divider::before,
.dm-auth-social__divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--dm-border);
}

.dm-auth-social__buttons {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.dm-auth-social__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    width: 100%;
    padding: var(--dm-btn-padding-y) var(--dm-btn-padding-x);
    border-radius: var(--dm-btn-radius);
    border: 1px solid var(--dm-border);
    background: var(--dm-surface);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--dm-navy-dark);
    text-decoration: none;
    transition:
        background 0.15s,
        border-color 0.15s,
        box-shadow 0.15s;
}

.dm-auth-social__btn:hover {
    border-color: var(--dm-navy);
    box-shadow: var(--dm-shadow);
    color: var(--dm-navy-dark);
}

.dm-auth-social__btn--facebook {
    background: #1877f2;
    border-color: #1877f2;
    color: #fff;
}

.dm-auth-social__btn--facebook:hover {
    background: #166fe5;
    border-color: #166fe5;
    color: #fff;
}

.dm-auth-social__btn svg {
    flex-shrink: 0;
}

.dm-auth-social__btn.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
}

.dm-auth-social__btn--facebook.is-disabled {
    background: #94a3b8;
    border-color: #94a3b8;
    color: #fff;
}
