/* ======================================================================
   LOGIN MODAL STYLES
   Hazlnut Brand Theme — sharp edges, cream/maroon/coral palette
   ====================================================================== */

/* Use landing palette - inherit from page or use fallbacks */
#loginModal {
    font-family: 'DM Sans', sans-serif;
    line-height: 1.5;
    --lm-maroon: var(--maroon, #561023);
    --lm-cream: var(--cream, #ede6dc);
    --lm-forest: var(--forest, #0f3a2e);
    --lm-green: var(--green, #084434);
    --lm-blue: var(--blue, #bed9ed);
    --lm-coral: var(--coral, #E45558);
    --lm-magenta: var(--magenta, #e163c3);
    --lm-offwhite: var(--offwhite, #efe8db);
    --lm-black: var(--black, #1e1e1e);
    --lm-accent: var(--lm-maroon);
    --lm-primary: var(--lm-coral);
    --lm-muted: #74716e;
    --lm-muted-rose: #bc9da0;
    --lm-line: #cfc5bb;
    --lm-overlay: rgba(188, 157, 160, 0.72);
}

/* Modal Overlay */
.login-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: transparent !important;
    z-index: 500000 !important;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

.login-modal-overlay.active {
    display: flex;
}

/* Modal Container */
.login-modal {
    background: var(--lm-cream, #ede6dc) !important;
    border-radius: 0px !important;
    box-shadow: 6px 6px 0 0 var(--coral, #e45558), -8px -6px 20px rgb(8 8 8 / 20%) !important;
    border: 0px !important;
    width: calc(100% - 48px);
    max-width: 468px;
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    margin: auto;
    position: relative;
    box-sizing: border-box;
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
}

.login-modal::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

#loginModal .hzl-modal-top-strip {
    display: none !important;
    height: 0 !important;
    border: 0 !important;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-18px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(-5px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* The reference uses rounded shapes; this implementation deliberately stays sharp. */
#loginModal,
#loginModal *,
.login-modal,
.login-modal * {
    border-radius: 0px !important;
}

/* Modal Header */
.login-modal-header {
    padding: 30px 32px 18px;
    text-align: center;
    position: relative;
    background: var(--lm-cream, #ede6dc);
}

.login-modal-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
}

.login-modal-logo-img {
    height: 26px;
    width: auto;
    object-fit: contain;
    filter: invert(45%) sepia(62%) saturate(2250%) hue-rotate(324deg) brightness(94%) contrast(92%) !important;
    cursor: default;
}

.login-modal-title {
    font-family: 'Cormorant Garamond', 'Nanum Myeongjo', Georgia, serif;
    font-size: 32px;
    font-weight: 400;
    color: var(--lm-maroon, #561023);
    margin: 0 0 6px;
    letter-spacing: -0.025em;
    line-height: 1.08;
}

.login-modal-subtitle {
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: var(--lm-muted);
    margin: 0;
    line-height: 1.4;
}

.login-modal-back {
    position: absolute;
    top: 23px;
    left: 22px;
    width: 32px;
    height: 32px;
    background: transparent !important;
    border: 0px !important;
    border-radius: 0px !important;
    color: var(--lm-maroon, #561023);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease, color 0.15s ease;
    z-index: 10;
    padding: 0;
    box-shadow: none !important;
}

.login-modal-back:hover {
    background: transparent !important;
    color: var(--lm-coral, #e45558) !important;
    border: 0px !important;
    transform: scale(1.15) !important;
    box-shadow: none !important;
}

.login-modal-back svg {
    display: block;
    width: 16px;
    height: 16px;
}

.login-modal-close {
    position: absolute;
    top: 23px;
    right: 22px;
    width: 32px;
    height: 32px;
    background: transparent !important;
    border: 0px !important;
    border-radius: 0px !important;
    color: var(--lm-maroon, #561023);
    font-family: 'DM Sans', sans-serif;
    font-size: 22px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.15s ease, color 0.15s ease;
    z-index: 10;
    padding: 0;
    box-shadow: none !important;
}

.login-modal-close:hover {
    background: transparent !important;
    color: var(--lm-coral, #e45558) !important;
    border: 0px !important;
    transform: scale(1.15) !important;
    box-shadow: none !important;
}

/* Modal Body */
.login-modal-body {
    padding: 0 32px 28px;
}

/* Suppress global base.css focus-visible outline on all inputs inside login modal */
#loginModal input:focus,
#loginModal input:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

/* Form Styles */
.login-form-flex {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-form-group {
    width: 100%;
    margin-bottom: 12px;
    text-align: left !important;
}

.login-form-label {
    display: block;
    text-align: left !important;
    font-family: 'DM Mono', ui-monospace, monospace;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--lm-maroon, #561023);
    margin-bottom: 5px;
}

.login-form-label .required {
    color: var(--lm-coral, #e45558);
    margin-left: 2px;
}

/* Password Input Wrapper */
.login-password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.login-password-input {
    padding-right: 40px !important;
}

.login-password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--lm-maroon, #561023);
    transition: color 0.2s ease;
}

.login-password-toggle:hover {
    color: var(--lm-coral, #e45558);
}

.login-password-toggle .eye-icon {
    width: 18px;
    height: 18px;
}

#loginModal .login-form-input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1.5px solid var(--lm-muted-rose) !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
    color: var(--lm-maroon, #561023);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    box-sizing: border-box;
}

#loginModal .login-form-input:not(.login-phone-national):focus {
    outline: none !important;
    border-color: var(--lm-maroon, #561023) !important;
    background: rgba(255, 255, 255, 0.22) !important;
    box-shadow: 3px 3px 0 var(--lm-muted-rose) !important;
}

/* Phone national input: fully neutralize all focus styling — handled by container :focus-within */
#loginModal .login-phone-national,
#loginModal .login-phone-national:focus,
#loginModal .login-phone-national:focus-visible,
#loginModal input.login-phone-national:focus {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
    border-color: transparent !important;
    background: transparent !important;
}

#loginModal .login-form-input::placeholder {
    color: var(--lm-muted);
    opacity: 1;
}

/* Primary Continue Button */
.login-btn-primary {
    width: 100%;
    height: 44px;
    padding: 0 16px;
    background: var(--coral, #e45558) !important;
    color: #ffffff !important;
    border: 1.5px solid var(--maroon, #561023) !important;
    border-radius: 0 !important;
    font-family: 'DM Mono', ui-monospace, monospace !important;
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    box-shadow: 4px 4px 0 #561023 !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease !important;
    margin-top: 6px;
}

@media (hover: hover) and (pointer: fine) {
    .login-btn-primary:hover:not(:disabled) {
        background: #d84548 !important;
        transform: translate(-2px, -2px) !important;
        box-shadow: 4px 4px 0 0 var(--maroon, #561023) !important;
    }
}

.login-btn-primary:active:not(:disabled) {
    transform: translate(0, 0) !important;
    box-shadow: 1px 1px 0 0 var(--maroon, #561023) !important;
}

.login-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Error Message */
.login-error-message {
    background: #fdf2f2 !important;
    border: 1.5px solid var(--lm-coral, #e45558) !important;
    border-radius: 0px !important;
    padding: 10px 14px !important;
    margin: 0 auto 14px auto !important;
    max-width: 320px !important;
    box-shadow: 2.5px 2.5px 0 rgba(86, 16, 35, 0.12) !important;
    display: none;
    animation: fadeSlideIn 0.2s ease;
    box-sizing: border-box !important;
}

.login-error-message.show {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
}

.login-error-text {
    color: var(--lm-maroon, #561023) !important;
    font-family: 'DM Sans', sans-serif !important;
    font-size: 0.84rem !important;
    font-weight: 500 !important;
    line-height: 1.35 !important;
    margin: 0 !important;
}

/* Success Message */
.login-success-message {
    background: #f4f8f3 !important;
    border: 1.5px solid var(--lm-forest, #2d5a37) !important;
    border-radius: 0px !important;
    padding: 10px 14px !important;
    margin: 0 auto 14px auto !important;
    max-width: 320px !important;
    box-shadow: 2.5px 2.5px 0 rgba(86, 16, 35, 0.12) !important;
    display: none;
    animation: fadeSlideIn 0.2s ease;
    box-sizing: border-box !important;
}

.login-success-message.show {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
}

.login-success-text {
    color: var(--lm-maroon, #561023) !important;
    font-family: 'DM Sans', sans-serif !important;
    font-size: 0.84rem !important;
    font-weight: 500 !important;
    line-height: 1.35 !important;
    margin: 0 !important;
}

/* Secondary Links */
.login-secondary-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin-top: 24px;
    padding-top: 19px;
    border-top: 1px solid var(--lm-line);
}

.login-secondary-separator {
    color: #b5a8aa;
}

.login-secondary-link {
    appearance: none;
    -webkit-appearance: none;
    background: none;
    border: 0;
    padding: 0;
    line-height: inherit;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--coral, #e45558);
    text-decoration: underline;
    transition: color 0.15s ease;
}

.login-secondary-link:hover {
    color: var(--lm-maroon, #561023);
}

.login-secondary-link.disabled,
.login-secondary-link:disabled {
    color: rgba(30, 30, 30, 0.4);
    text-decoration: none;
    cursor: not-allowed;
}

/* Anchors have no native disabled state, so their clicks are blocked explicitly. */
a.login-secondary-link.disabled {
    pointer-events: none;
}

/* Divider */
.login-divider {
    display: flex;
    align-items: center;
    margin: 27px 0 25px;
}

.login-divider-line {
    flex: 1;
    height: 1px;
    background: var(--lm-line);
}

.login-divider-text {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--lm-muted);
    padding: 0 12px;
}

/* ======================================================================
   AUTH OPTIONS & SOCIAL BUTTONS
   ====================================================================== */
.login-social-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-auth-options {
    gap: 8px;
}

/* 2-column grid for Phone OTP + Email & Password */
.login-auth-primary-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 0;
}

/* Hide auth method picker once phone OTP verify / add-email steps are active */
.login-auth-options:has(#phoneOtpVerifyStep:not([hidden])) .login-auth-primary-row,
.login-auth-options:has(#phoneOtpEmailStep:not([hidden])) .login-auth-primary-row {
    display: none;
}

/* Post-OTP add-email step: show only the email capture UI */
.login-modal-body:has(#phoneOtpEmailStep:not([hidden])) #loginSuccessMessage {
    display: none !important;
}

.login-auth-options:has(#phoneOtpEmailStep:not([hidden])) .login-social-other-buttons {
    display: none !important;
}

.login-email-password-panel {
    width: 100%;
    box-sizing: border-box;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transform-origin: top center;
    transition:
        max-height 0.32s cubic-bezier(0.22, 1, 0.36, 1),
        opacity    0.2s ease,
        padding    0.25s ease,
        transform  0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.login-email-password-panel.active {
    max-height: 520px;
    opacity: 1;
    padding: 24px 0 2px;
    pointer-events: auto;
    transform: translateY(0);
}

.login-phone-otp-panel.active {
    max-height: 640px;
}

.login-phone-otp-email-error {
    margin: 0 0 8px;
    color: var(--lm-coral, #e45558);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
}

.login-phone-otp-duplicate-actions {
    gap: 8px;
    margin-bottom: 12px;
}

.login-phone-otp-duplicate-actions:not([hidden]) {
    display: grid;
}

.login-phone-otp-duplicate-note {
    margin: 0;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
    color: var(--lm-maroon, #561023);
    line-height: 1.45;
}

#loginModal .login-phone-otp-change-email,
#loginModal .login-phone-otp-skip-email {
    padding: 4px;
}

.login-phone-otp-change-email {
    justify-self: center;
}

.login-phone-otp-skip-email {
    display: block;
    width: 100%;
    margin-top: 10px;
    text-align: center;
    color: var(--lm-muted, #74716e);
    font-size: 0.88rem;
}

/* Auto-hide Google & Create Wishlist link when Email or Phone panel is active */
.login-email-password-panel.active ~ .login-social-other-buttons {
    display: none !important;
}

/* Phone Input Group (Identical Aesthetic to Email Box .login-form-input) */
.login-phone-input-row {
    display: flex !important;
    align-items: stretch !important;
    gap: 0 !important;
    width: 100% !important;
    height: 40px !important;
    box-sizing: border-box !important;
    border: 1.5px solid var(--lm-muted-rose) !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease !important;
}

.login-phone-input-row:focus,
.login-phone-input-row:focus-within,
.login-phone-input-row:focus-visible {
    outline: none !important;
}

.login-phone-country {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 10px 0 12px !important;
    border: none !important;
    border-right: 1.5px solid var(--lm-muted-rose) !important;
    border-radius: 0 !important;
    background: transparent !important;
    font-family: 'DM Mono', ui-monospace, monospace !important;
    font-size: 0.88rem !important;
    font-weight: 600 !important;
    color: var(--lm-maroon, #561023) !important;
    flex: 0 0 auto !important;
    min-width: 52px !important;
    height: 100% !important;
    box-sizing: border-box !important;
    transition: border-color 0.15s ease !important;
}

.login-phone-national {
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    font-family: 'DM Sans', sans-serif !important;
    font-size: 0.88rem !important;
    color: var(--lm-maroon, #561023) !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    height: 100% !important;
    box-sizing: border-box !important;
    padding: 0 12px 0 10px !important;
    outline: none !important;
    box-shadow: none !important;
    transition: all 0.15s ease !important;
}

.login-phone-national:focus,
.login-phone-national:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

.login-phone-national::placeholder {
    color: var(--lm-muted) !important;
    font-family: 'DM Sans', sans-serif !important;
    font-size: 0.88rem !important;
    opacity: 1 !important;
}

.login-phone-input-row:focus-within {
    border-color: var(--lm-maroon, #561023) !important;
    background: rgba(255, 255, 255, 0.22) !important;
    box-shadow: 3px 3px 0 var(--lm-muted-rose) !important;
}

.login-phone-input-row:focus-within .login-phone-country {
    border: none !important;
    border-right: 1.5px solid var(--lm-maroon, #561023) !important;
    background: transparent !important;
}

.login-phone-input-row:focus-within .login-phone-national {
    outline: none !important;
    border: none !important;
    background: transparent !important;
}

.login-phone-hint {
    display: block;
    margin-top: 6px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    color: var(--lm-muted, #8a6b70);
}

.login-phone-otp-sent-note {
    display: block;
    margin: 0 auto 14px auto;
    text-align: center;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
    color: var(--lm-muted, #8a6b70);
}

#phoneOtpVerifyStep .login-form-group {
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

.login-otp-digits {
    /* Keep focus styling and box shadows inside the clipped auth panel. */
    padding: 6px;
    box-sizing: border-box;
    display: flex;
    gap: 8px;
    justify-content: space-between;
    max-width: 320px;
    margin: 0 auto;
}

.login-otp-digit {
    flex: 1 1 0;
    max-width: 44px;
    height: 48px;
    min-width: 0;
    text-align: center;
    font-family: 'DM Mono', ui-monospace, monospace !important;
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    border: 1.5px solid var(--lm-maroon, #561023) !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    color: var(--lm-maroon, #561023) !important;
    box-sizing: border-box !important;
    box-shadow: 2.5px 2.5px 0 rgba(86, 16, 35, 0.18) !important;
    transition: all 0.15s ease;
}

#loginModal .login-otp-digit:focus,
#loginModal .login-otp-digit:focus-visible {
    outline: none !important;
    border-color: var(--lm-coral, #e45558) !important;
    box-shadow: 3.5px 3.5px 0 var(--lm-maroon, #561023) !important;
    background: #ffffff !important;
}

#phoneOtpVerifyStep #loginPhoneVerifyBtn {
    max-width: 320px;
    margin: 16px auto 0 auto;
    display: block;
    width: 100%;
}

#phoneOtpVerifyStep .login-secondary-links {
    margin-top: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

/* 2-column primary button cards (Phone OTP & Email) */
.login-auth-primary-row .login-social-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px 12px 18px;
    height: 134px;
    background: transparent;
    border: 1.5px dashed var(--lm-muted-rose) !important;
    border-radius: 0 !important;
    font-family: 'DM Mono', ui-monospace, monospace;
    font-size: 0.88rem;
    font-weight: 400;
    letter-spacing: 0.055em;
    color: var(--lm-maroon, #561023);
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
    position: relative;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

/* Selected/Active card for Email & Password */
.login-auth-primary-row .login-social-btn:not(.disabled) {
    background: transparent;
    border: 1.5px solid var(--lm-maroon, #561023) !important;
    border-style: solid !important;
    box-shadow: 5px 5px 0 var(--lm-maroon, #561023) !important;
}

.login-auth-primary-row .login-social-btn:not(.disabled):hover {
    background: rgba(228, 85, 88, 0.07) !important;
    transform: translateY(-1px);
    box-shadow: 6px 6px 0 var(--lm-maroon, #561023) !important;
}

.login-auth-primary-row .login-social-btn:not(.disabled).active {
    background: #f2ddd4 !important;
    border-color: var(--coral, #e45558) !important;
    transform: none;
    box-shadow: 5px 5px 0 var(--coral, #e45558) !important;
}

.login-auth-primary-row .login-social-btn.disabled {
    opacity: 1;
    background: transparent;
    border: 1.5px dashed var(--lm-muted-rose) !important;
    color: #a4787d;
    cursor: not-allowed;
}

.login-auth-card-motif {
    width: 25px;
    height: 25px;
    display: block;
    flex: 0 0 auto;
    background: var(--lm-coral, #e45558);
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.login-auth-card-motif--phone {
    background: var(--lm-coral, #e45558);
    -webkit-mask-image: url('../images/landing/shapes/deco-star-pink.svg');
    mask-image: url('../images/landing/shapes/deco-star-pink.svg');
}

.login-auth-card-motif--email {
    background: var(--lm-coral, #e45558);
    -webkit-mask-image: url('../images/landing/shapes/deco-diamond-green.svg');
    mask-image: url('../images/landing/shapes/deco-diamond-green.svg');
}

.login-auth-primary-row .coming-soon-badge {
    font-size: 0.6rem;
    font-family: 'DM Mono', ui-monospace, monospace;
    font-weight: 700;
    letter-spacing: 0.05em;
    background: #f1d5cc;
    color: var(--coral, #e45558);
    padding: 4px 10px;
    border-radius: 0 !important;
    margin-top: 0;
    text-transform: uppercase;
}

/* Other Social Buttons & Google Login */
.login-social-other-buttons {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 0;
}

.login-google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    height: 48px;
    background: transparent !important;
    border: 1.5px solid var(--lm-maroon, #561023) !important;
    border-radius: 0 !important;
    font-family: 'DM Mono', ui-monospace, monospace;
    font-size: 0.88rem;
    font-weight: 400;
    letter-spacing: 0.055em;
    color: var(--lm-maroon, #561023);
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
    box-shadow: 5px 5px 0 var(--lm-maroon, #561023) !important;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

@media (hover: hover) and (pointer: fine) {
    .login-google-btn:hover:not(.is-loading):not([disabled]) {
        background: rgba(228, 85, 88, 0.07) !important;
        transform: translateY(-1px) !important;
        box-shadow: 6px 6px 0 var(--lm-maroon, #561023) !important;
    }
}

.login-google-btn:active:not(.is-loading):not([disabled]) {
    transform: translate(0, 0) !important;
    box-shadow: 2px 2px 0 var(--lm-maroon, #561023) !important;
}

/* Held while the opener's pre-login save finishes (guest wishlist gift handoff) */
.login-google-btn.is-loading,
.login-google-btn[disabled] {
    opacity: 0.6;
    cursor: progress;
    transform: none !important;
    box-shadow: 5px 5px 0 var(--lm-maroon, #561023) !important;
}

/* Keep browsing: closes the modal from the method list */
.login-keep-browsing {
    align-self: center;
    margin-top: 18px;
    padding: 6px 10px;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    font-family: 'DM Mono', ui-monospace, monospace;
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: color-mix(in oklab, var(--lm-maroon, #561023) 62%, transparent);
    text-decoration: none !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, transform 0.2s ease;
    position: relative;
}

.login-keep-browsing::after {
    content: '→';
    display: inline-block;
    font-family: 'DM Mono', ui-monospace, monospace;
    font-size: 0.95em;
    line-height: 1;
    margin-left: 0;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;
    transform: translateX(-6px);
    transition: max-width 0.22s ease, margin-left 0.22s ease, opacity 0.22s ease, transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
    color: currentColor;
    pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
    .login-keep-browsing:hover {
        color: var(--coral, #e45558) !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        text-decoration: none !important;
        transform: translateX(-2px);
    }

    .login-keep-browsing:hover::after {
        max-width: 24px;
        margin-left: 6px;
        opacity: 1;
        transform: translateX(3px);
    }
}

.login-keep-browsing:active {
    transform: translateX(0);
    color: var(--coral, #e45558) !important;
}

.login-create-wishlist-wrapper {
    text-align: center;
    margin-top: 25px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    color: var(--lm-muted);
}

.login-create-wishlist-link {
    color: var(--coral, #e45558);
    font-weight: 600;
    text-decoration: underline;
    font-family: 'DM Sans', sans-serif;
    transition: color 0.15s ease;
}

.login-create-wishlist-link:hover {
    color: var(--lm-maroon, #561023);
}

/* Landing section variants retain one consistent, readable modal backdrop. */
#loginModal.login-modal--maroon,
#loginModal.login-modal--green,
#loginModal.login-modal--blue,
#loginModal.login-modal--cream,
#loginModal.login-modal--forest,
#loginModal.login-modal--magenta,
#loginModal.login-modal--coral {
    --lm-overlay: rgba(188, 157, 160, 0.72);
}

/* On-screen keyboard (KAN-410): it shrinks the visual viewport only, which 100dvh and inset: 0 do not
   follow. login.html writes the visible top, the visible height and the height hidden below it here
   while the modal is open. The overlay keeps the whole screen, so the page behind never shows under a
   see-through keyboard; its padding holds the sheet inside the visible part. Unset, these rules
   resolve to the values above. The id is in the selector because modal-theme.css sets the overlay's
   padding and inset with !important on phones. */
.login-modal-underfill {
    display: none;
}

@media (max-width: 1024px) {
    #loginModal.login-modal-overlay {
        padding-top: var(--login-modal-viewport-top, 0px) !important;
        padding-bottom: var(--login-modal-keyboard-inset, 0px) !important;
    }

    .login-modal {
        max-height: calc(var(--login-modal-viewport-height, 100dvh) - 40px);
    }
}

/* Mobile: full-width bottom sheet, independently scrollable on short screens. */
@media (max-width: 768px) {
    .login-modal-overlay {
        align-items: flex-end !important;
        justify-content: center !important;
        padding: 0 !important;
    }

    /* The sheet's colour carries on below it, down to the bottom of the screen behind the keyboard. */
    .login-modal-underfill {
        display: block;
        position: absolute;
        right: 0;
        bottom: 0;
        left: 0;
        height: var(--login-modal-keyboard-inset, 0px);
        background: var(--lm-cream, #ede6dc);
    }

    .login-modal {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 0;
        max-height: calc(100vh - 16px) !important;
        max-height: calc(var(--login-modal-viewport-height, 100dvh) - 16px) !important;
        margin: 0 !important;
        border: 0px !important;
        box-shadow: 0 -10px 36px rgba(63, 12, 26, 0.28) !important;
        overflow-y: auto !important;
        overscroll-behavior: contain;
        -ms-overflow-style: none !important;
        scrollbar-width: none !important;
    }

    .login-modal::-webkit-scrollbar {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
    }

    #loginModal .hzl-modal-top-strip {
        display: none !important;
        height: 0 !important;
    }

    #loginModal .hzl-sheet-handle {
        display: block;
        width: 38px;
        height: 4px;
        margin: 8px auto 0;
        background: var(--lm-muted-rose);
        border-radius: 0 !important;
    }

    .login-modal-header {
        padding: 16px 18px 10px;
    }

    .login-modal-body {
        padding: 0 18px max(14px, calc(env(safe-area-inset-bottom) + 10px));
    }

    .login-modal-logo {
        margin-bottom: 8px;
    }

    .login-modal-logo-img {
        height: 22px;
    }

    .login-modal-title {
        font-size: 24px;
        margin-bottom: 4px;
    }

    .login-modal-subtitle {
        font-size: 12.5px;
    }

    .login-modal-back {
        top: 14px;
        width: 28px;
        height: 28px;
        left: 14px;
    }

    /* Hide 'X' close button on mobile bottom sheet */
    #loginModal .login-modal-close {
        display: none !important;
    }

    .login-auth-primary-row {
        grid-template-columns: 1fr 1fr;
    }

    .login-auth-primary-row .login-social-btn {
        height: 104px;
        padding: 12px 6px;
    }

    .login-divider {
        margin: 16px 0 14px;
    }

    .login-form-group {
        margin-bottom: 8px;
    }

    .login-form-label {
        margin-bottom: 3px;
        font-size: 0.68rem;
    }

    #loginModal .login-form-input {
        height: 36px;
        font-size: 0.85rem;
    }

    .login-btn-primary {
        height: 40px;
        margin-top: 6px;
        font-size: 0.85rem !important;
    }

    .login-secondary-links {
        margin-top: 14px;
        padding-top: 10px;
    }

    .login-create-wishlist-wrapper {
        margin-top: 14px;
    }

    .login-email-password-panel.active {
        padding: 12px 0 2px;
    }
}

@media (max-width: 420px) {
    .login-modal-body {
        padding-left: 14px;
        padding-right: 14px;
    }

    .login-auth-primary-row {
        gap: 8px;
    }

    .login-auth-primary-row .login-social-btn {
        height: 100px;
        font-size: 0.74rem;
        letter-spacing: 0.02em;
    }

    .login-auth-primary-row .coming-soon-badge {
        font-size: 0.5rem;
        padding: 2px 5px;
    }
}

/* Prevent Chrome/Brave/Edge/Safari autofill from overriding background color & text color */
.login-modal-overlay input:-webkit-autofill,
.login-modal-overlay input:-webkit-autofill:hover,
.login-modal-overlay input:-webkit-autofill:focus,
.login-modal-overlay input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
    box-shadow: 0 0 0 1000px #ffffff inset !important;
    -webkit-text-fill-color: var(--lm-maroon, #561023) !important;
    caret-color: var(--lm-maroon, #561023) !important;
    transition: background-color 9999s ease-in-out 0s !important;
}
