.auth-panel-body {
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.auth-panel-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 18px !important;
    letter-spacing: 0.04em;
}

.auth-panel-form .contact-outline-field {
    margin-bottom: 16px;
}

.auth-panel-form .contact-outline-field.is-invalid .contact-outline-input,
.auth-panel-form .contact-outline-field.is-invalid .account-phone-combo-inner {
    border-color: #c0392b;
}

.auth-panel-error {
    margin: -8px 0 12px;
    font-size: 0.8rem;
    color: #c0392b;
}

.auth-panel-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 4px 0 16px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.5;
    border-radius: 10px;
}

.auth-panel-notice--success {
    background: #edf7f0;
    border: 1px solid #b8dfc4;
    color: #1f5c33;
}

.auth-panel-notice__icon {
    flex-shrink: 0;
    font-size: 16px;
    line-height: 1.4;
    margin-top: 1px;
}

.auth-panel-notice__text {
    margin: 0;
    flex: 1;
    min-width: 0;
}

.storefront-toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0 0 20px;
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.45;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(17, 17, 17, 0.12);
    animation: storefront-toast-in 0.35s ease-out;
}

.storefront-toast--fixed {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 20px);
    inset-inline-end: 20px;
    inset-inline-start: auto;
    z-index: 2200;
    width: min(calc(100vw - 32px), 360px);
    margin: 0;
    animation-name: storefront-toast-in-fixed;
}

.storefront-toast--fixed-bottom {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
    inset-inline-end: 20px;
    inset-inline-start: auto;
    z-index: 2200;
    width: min(calc(100vw - 32px), 360px);
    margin: 0;
    animation-name: storefront-toast-in-fixed-bottom;
}

.storefront-toast--success {
    background: #edf7f0;
    border: 1px solid #b8dfc4;
    color: #1f5c33;
}

.storefront-toast--error {
    background: #fff5f5;
    border: 1px solid #fecaca;
    color: #991b1b;
}

@keyframes storefront-toast-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes storefront-toast-in-fixed {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes storefront-toast-in-fixed-bottom {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.storefront-toast__icon {
    flex-shrink: 0;
    font-size: 18px;
    line-height: 1.2;
    margin-top: 1px;
}

.storefront-toast__body {
    flex: 1;
    min-width: 0;
}

.storefront-toast__text {
    margin: 0;
}

.storefront-toast__list {
    margin: 0;
    padding-left: 18px;
}

.storefront-toast__list li + li {
    margin-top: 4px;
}

.storefront-toast__close {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    opacity: 0.72;
}

.storefront-toast__close:hover {
    opacity: 1;
    background: rgba(17, 17, 17, 0.06);
}

.auth-password-field {
    position: relative;
}

.auth-password-input {
    padding-right: 44px !important;
}

.auth-password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #333;
    padding: 4px;
    line-height: 1;
    cursor: pointer;
}

.auth-panel-submit {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    letter-spacing: 0.08em;
    display: block;
    width: auto;
    margin-left: auto;
    margin-right: auto;
}

.auth-panel-return,
.auth-panel-forgot a {
    font-size: 0.9rem;
}

/* Primary auth CTAs — match home hero button hover (lift + shine) */
.storefront-cta-btn {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    color: #fff !important;
    box-shadow: 0 8px 20px rgba(19, 38, 68, 0.2);
    transition:
        transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1),
        background-color 0.35s ease,
        border-color 0.35s ease;
}

/* Keep navy fill even when disabled/loading — .btn-navy:hover uses transparent */
.storefront-cta-btn.btn-navy,
.storefront-cta-btn.btn-navy:disabled,
.storefront-cta-btn.btn-navy.disabled {
    background-color: var(--primary-navy, #1B3163) !important;
    border-color: var(--primary-navy, #1B3163) !important;
    color: #fff !important;
}

.storefront-cta-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(
        115deg,
        transparent 28%,
        rgba(255, 255, 255, 0.42) 50%,
        transparent 72%
    );
    transform: translateX(-130%);
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

.storefront-cta-btn:hover,
.storefront-cta-btn:focus-visible {
    color: #fff !important;
    transform: translateY(-5px) scale(1.04);
    box-shadow: 0 22px 40px rgba(19, 38, 68, 0.42);
}

.storefront-cta-btn:hover::before,
.storefront-cta-btn:focus-visible::before {
    transform: translateX(130%);
}

.storefront-cta-btn.btn-navy:hover,
.storefront-cta-btn.btn-navy:focus-visible {
    background-color: #0a1830 !important;
    border-color: #0a1830 !important;
    color: #fff !important;
}

.storefront-cta-btn:active {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 24px rgba(19, 38, 68, 0.3);
    transition-duration: 0.15s;
}

/* Inline auth links — animated underline + color shift */
.auth-text-link {
    position: relative;
    display: inline-block;
    color: var(--primary-navy, #132644);
    text-decoration: none !important;
    transition: color 0.25s ease;
}

.auth-text-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 100%;
    height: 1px;
    background: currentColor;
    transform: scaleX(0.35);
    transform-origin: left center;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
    opacity: 0.55;
}

.auth-text-link:hover,
.auth-text-link:focus-visible {
    color: #0a1830;
}

.auth-text-link:hover::after,
.auth-text-link:focus-visible::after {
    transform: scaleX(1);
    opacity: 1;
}

.auth-text-link--muted {
    color: #64748b;
}

.auth-text-link--muted:hover,
.auth-text-link--muted:focus-visible {
    color: var(--primary-navy, #132644);
}

@media (prefers-reduced-motion: reduce) {
    .storefront-cta-btn,
    .storefront-cta-btn::before,
    .auth-text-link,
    .auth-text-link::after {
        transition: none;
    }

    .storefront-cta-btn:hover,
    .storefront-cta-btn:focus-visible {
        transform: none;
    }

    .storefront-cta-btn:hover::before,
    .storefront-cta-btn:focus-visible::before {
        transform: none;
        opacity: 0.12;
    }

    .auth-text-link:hover::after,
    .auth-text-link:focus-visible::after {
        transform: scaleX(1);
    }
}

body.is-rtl .auth-text-link::after {
    transform-origin: right center;
}

#loginOverlay .auth-panel-form.contact-form {
    margin-top: 0;
}

.auth-panel-logo {
    height: 50px;
    width: auto;
    max-width: 220px;
    object-fit: contain;
}

.auth-panel-header {
    padding: 1.25rem 1.5rem;
}

.auth-panel-brand {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

.auth-mobile-hero {
    display: none;
}

/*
 * Mobile auth: normal page flow — header, hero image, then form.
 */
@media (max-width: 991.98px) {
    #loginOverlay .auth-panel,
    #loginOverlay .auth-panel > .row,
    #loginOverlay .auth-panel > .row > .col-12 {
        height: auto !important;
        min-height: 0;
    }

    #loginOverlay .auth-panel-header {
        padding: 0.85rem 1rem;
        border-bottom: 0;
        background: #fff;
        position: sticky;
        top: 0;
        z-index: 2;
    }

    #loginOverlay .auth-panel-logo {
        height: 44px;
        max-width: 190px;
    }

    #loginOverlay .auth-panel-return {
        font-size: 0.8rem;
        white-space: nowrap;
        margin-left: 0.75rem;
    }

    #loginOverlay .auth-mobile-hero {
        display: block;
        width: 100%;
        height: clamp(170px, 34vw, 230px);
        min-height: 170px;
        background-size: cover;
        background-position: 72% center;
        background-repeat: no-repeat;
        flex-shrink: 0;
    }

    #loginOverlay .auth-panel-body {
        justify-content: flex-start !important;
        padding-top: 1.25rem;
        padding-bottom: 1.75rem;
    }

    #loginOverlay .storefront-toast--fixed {
        top: calc(env(safe-area-inset-top, 0px) + 12px);
        inset-inline-end: 12px;
    }
}

/*
 * Desktop auth: side photo fills at least the viewport and stretches with the
 * taller sign-up form so there is no empty gap under the image while scrolling.
 */
@media (min-width: 992px) {
    #loginOverlay.login-overlay {
        height: 100%;
        height: 100dvh;
    }

    #loginOverlay .auth-panel-header {
        padding: 2rem 3rem 1.5rem;
    }

    #loginOverlay .auth-panel.h-100,
    #loginOverlay .auth-panel > .row.h-100,
    #loginOverlay .login-img-col.h-100,
    #loginOverlay .auth-panel > .row > .col-lg-6.h-100 {
        height: auto !important;
        min-height: 100%;
        min-height: 100dvh;
    }

    #loginOverlay .auth-panel > .row {
        align-items: stretch;
    }

    #loginOverlay .login-img-col {
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
    }
}
