/* Round6: B2B login gate and AjaxSuite popup refinement */

.b2b-login-modal-overlay {
    backdrop-filter: blur(2px);
    background: rgb(0 0 0 / 62%);
}

.b2b-login-modal {
    border: 1px solid rgb(183 51 55 / 14%);
    box-shadow: 0 24px 60px rgb(0 0 0 / 24%);
}

.b2b-login-modal-header {
    background: linear-gradient(135deg, var(--primary-color, #b73337) 0%, var(--primary-hover, #8e2629) 100%);
}

.b2b-login-modal-header h3 {
    line-height: 1.2;
    padding-right: 46px;
}

.b2b-login-modal-header p {
    line-height: 1.35;
    max-width: 34ch;
}

.b2b-login-modal-body {
    gap: 18px;
}

.b2b-login-options {
    gap: 14px;
}

.b2b-login-option {
    min-height: 76px;
    display: grid;
    align-content: center;
    gap: 4px;
    border-radius: 10px;
    border-color: rgb(0 0 0 / 10%);
    box-shadow: 0 0 0 0 rgb(183 51 55 / 0%);
    transition: border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}

.b2b-login-option:hover,
.b2b-login-option:focus-visible {
    border-color: rgb(183 51 55 / 35%);
    background: rgb(183 51 55 / 3%);
    box-shadow: 0 10px 22px rgb(0 0 0 / 7%);
    transform: translateY(-1px);
}

.b2b-login-option-title {
    line-height: 1.25;
}

.b2b-login-option-desc {
    line-height: 1.35;
}

.b2b-login-option.b2b-primary {
    background: linear-gradient(180deg, rgb(183 51 55 / 96%) 0%, rgb(142 38 41 / 100%) 100%);
    border-color: rgb(183 51 55 / 95%);
    box-shadow: 0 8px 18px rgb(183 51 55 / 18%);
}

.b2b-login-option.b2b-primary:hover,
.b2b-login-option.b2b-primary:focus-visible {
    background: linear-gradient(180deg, rgb(142 38 41 / 100%) 0%, rgb(109 29 31 / 100%) 100%);
    border-color: rgb(142 38 41 / 100%);
    box-shadow: 0 12px 24px rgb(183 51 55 / 22%);
}

.b2b-login-already {
    margin-top: 4px;
    padding-top: 14px;
    border-top-color: rgb(0 0 0 / 6%);
}

.b2b-login-already a {
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.12em;
}

.b2b-login-already a:focus-visible {
    outline: 2px solid var(--primary-color, #b73337);
    outline-offset: 2px;
    border-radius: 4px;
}

#ajaxsuite-popup-wrapper {
    z-index: 10000;
}

#ajaxsuite-popup-wrapper #ajaxsuite-close.ajaxsuite-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgb(183 51 55 / 18%);
    background: rgb(255 255 255 / 96%);
    color: var(--primary-color, #b73337);
    box-shadow: 0 6px 18px rgb(0 0 0 / 10%);
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

#ajaxsuite-popup-wrapper #ajaxsuite-close.ajaxsuite-close::before {
    content: "×";
    display: block;
    font-size: 22px;
    line-height: 1;
    font-weight: 500;
}

#ajaxsuite-popup-wrapper #ajaxsuite-close.ajaxsuite-close:hover,
#ajaxsuite-popup-wrapper #ajaxsuite-close.ajaxsuite-close:focus-visible {
    background: var(--primary-color, #b73337);
    border-color: var(--primary-color, #b73337);
    color: #fff;
    transform: translateY(-1px);
    outline: none;
}

#ajaxsuite-popup-wrapper #ajaxsuite-popup-content {
    border-radius: 12px;
    overflow: hidden;
}

@media (width <= 767px) {
    .b2b-login-modal-overlay {
        padding: 12px;
    }

    .b2b-login-modal {
        width: 100%;
        max-height: calc(100vh - 24px);
    }

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

    .b2b-login-modal-body {
        padding: 18px;
        gap: 14px;
    }

    .b2b-login-option {
        min-height: 72px;
        padding: 14px 15px;
    }

    #ajaxsuite-popup-wrapper #ajaxsuite-close.ajaxsuite-close {
        top: 8px;
        right: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .b2b-login-modal,
    .b2b-login-option,
    #ajaxsuite-popup-wrapper #ajaxsuite-close.ajaxsuite-close {
        transition: none !important;
        animation: none !important;
    }

    .b2b-login-option:hover,
    .b2b-login-option:focus-visible,
    #ajaxsuite-popup-wrapper #ajaxsuite-close.ajaxsuite-close:hover,
    #ajaxsuite-popup-wrapper #ajaxsuite-close.ajaxsuite-close:focus-visible {
        transform: none;
    }
}
