/* Automatic Contact Us Popup Scoped Component CSS */

/* Prevent body scrolling when popup is active */
body.hb-popup-open {
    overflow: hidden !important;
}

/* Modal Overlay Backdrop */
.hb-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background-color: rgba(6, 8, 29, 0.72);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.hb-popup-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

/* Modal Dialog Box Container */
.hb-popup-container {
    position: relative;
    width: 100%;
    max-width: 950px;
    max-height: calc(100vh - 2rem);
    background-color: var(--color-white, #ffffff);
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    overflow-y: auto;
    overflow-x: hidden;
    transform: scale(0.94) translateY(12px);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.hb-popup-overlay.is-visible .hb-popup-container {
    transform: scale(1) translateY(0);
}

/* Close Button (Top Right) */
.hb-popup-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background-color: #ffffff;
    color: #07102F;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.hb-popup-close:hover,
.hb-popup-close:focus-visible {
    transform: scale(1.1);
    background-color: #07102F;
    color: #ffffff;
}

/* Modal Split Body */
.hb-popup-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 520px;
}

/* ============================================================
   LEFT COLUMN - PROMOTIONAL SECTION
   ============================================================ */
.hb-popup-left {
    background-color: #EAF6D7;
    padding: 1.5rem 1.75rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-top-left-radius: 24px;
    border-bottom-left-radius: 24px;
    position: relative;
    overflow: hidden;
}

.hb-popup-left-inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* HubBroker Brand Logo Header */
.hb-popup-logo-wrapper {
    margin-bottom: 0.75rem;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.hb-popup-logo {
    height: 42px;
    max-width: 200px;
    object-fit: contain;
    display: block;
    background-color: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Header Group & Title */
.hb-popup-header-group {
    margin-bottom: 0.5rem;
}

.hb-popup-eyebrow {
    font-size: 0.71875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #5F6835;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.2rem;
}

.hb-popup-title {
    font-size: 1.875rem;
    font-weight: 800;
    line-height: 1.15;
    color: #07102F;
    margin: 0;
}

.hb-popup-title-accent {
    color: #6E7740;
    display: inline;
}

.hb-popup-description {
    font-size: 0.8125rem;
    line-height: 1.45;
    color: #334155;
    margin: 0 0 0.875rem 0;
    font-weight: 500;
}

/* Benefit Cards */
.hb-popup-benefits {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.875rem;
}

.hb-popup-benefit-card {
    background-color: #ffffff;
    border-radius: 14px;
    padding: 0.75rem 0.5rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(110, 119, 64, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.hb-popup-benefit-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(110, 119, 64, 0.18);
    background-color: #ffffff;
}

.hb-popup-benefit-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    background-color: #EAF6D7;
    color: #6E7740;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.375rem;
}

.hb-popup-benefit-text {
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: #07102F;
}

/* High-Value HubBroker Platform Stats & Capabilities Card */
.hb-popup-dashboard-preview {
    background: #ffffff;
    border: 1px solid rgba(7, 16, 47, 0.08);
    border-radius: 14px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 8px 24px rgba(7, 16, 47, 0.06);
}

.hb-popup-dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.625rem;
    border-bottom: 1px solid #F1F5F9;
}

.hb-popup-dash-title-wrap {
    display: flex;
    flex-direction: column;
}

.hb-popup-dash-title {
    font-size: 0.9375rem;
    font-weight: 800;
    color: #07102F;
    line-height: 1.1;
}

.hb-popup-dash-sub {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #64748B;
}

.hb-popup-dash-badge {
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.25rem 0.625rem;
    background-color: #EAF6D7;
    color: #5F6835;
    border-radius: 999px;
    white-space: nowrap;
}

.hb-popup-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    text-align: center;
}

.hb-popup-stat-item {
    display: flex;
    flex-direction: column;
    padding: 0.375rem 0.25rem;
    background-color: #F8FAF6;
    border-radius: 8px;
}

.hb-popup-stat-number {
    font-size: 1.125rem;
    font-weight: 800;
    color: #6E7740;
    line-height: 1;
}

.hb-popup-stat-label {
    font-size: 0.625rem;
    font-weight: 700;
    color: #475569;
    margin-top: 0.25rem;
}

.hb-popup-ipaas-signup-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px dashed #E2E8F0;
    padding-top: 0.625rem;
}

.hb-popup-ipaas-signup-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #6E7740;
    text-decoration: none;
    transition: color 0.2s ease, transform 0.2s ease;
}

.hb-popup-ipaas-signup-link:hover {
    color: #07102F;
    transform: translateY(-1px);
}

/* OR Divider */
.hb-popup-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin-bottom: 1rem;
}

.hb-popup-divider::before,
.hb-popup-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(7, 16, 47, 0.15);
}

.hb-popup-divider span {
    padding: 0 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748B;
}

/* Book Demo Button */
.hb-popup-book-demo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.875rem 1.25rem;
    background-color: #07102F;
    color: #ffffff;
    border-radius: 999px;
    font-size: 0.9375rem;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.hb-popup-book-demo-btn:hover {
    background-color: #15224D;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(7, 16, 47, 0.25);
}

.hb-popup-book-demo-btn:hover .hb-popup-arrow-icon {
    transform: translateX(4px);
}

.hb-popup-arrow-icon {
    transition: transform 0.2s ease;
}

.hb-popup-book-caption {
    font-size: 0.75rem;
    color: #64748B;
    text-align: center;
    margin: 0.5rem 0 0 0;
}

/* ============================================================
   RIGHT COLUMN - FORM SECTION
   ============================================================ */
.hb-popup-right {
    padding: 1.5rem 1.75rem;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-top-right-radius: 24px;
    border-bottom-right-radius: 24px;
}

.hb-popup-right-header {
    margin-bottom: 1rem;
}

.hb-popup-form-title {
    font-size: 1.625rem;
    font-weight: 800;
    color: #07102F;
    margin: 0 0 0.25rem 0;
}

.hb-popup-form-subtitle {
    font-size: 0.8125rem;
    color: #64748B;
    margin: 0;
}

/* Form Fields */
.hb-popup-form {
    display: flex;
    flex-direction: column;
    gap: 0.8125rem;
}

.hb-popup-field {
    position: relative;
    width: 100%;
}

.hb-popup-field span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.hb-popup-field input[type="text"],
.hb-popup-field input[type="email"],
.hb-popup-field input[type="tel"],
.hb-popup-field select,
.hb-popup-field textarea {
    width: 100%;
    min-height: 44px;
    padding: 0.75rem 1.125rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #07102F;
    background-color: #F3F4F6;
    border: 1.5px solid transparent;
    border-radius: 10px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.hb-popup-field input::placeholder,
.hb-popup-field textarea::placeholder {
    color: #94A3B8;
}

.hb-popup-field select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #F3F4F6;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 1rem center !important;
    background-size: 16px 16px !important;
    padding-right: 2.5rem !important;
    cursor: pointer;
}

.hb-popup-field input:focus,
.hb-popup-field select:focus,
.hb-popup-field textarea:focus {
    background-color: #ffffff;
    border-color: #6E7740;
    box-shadow: 0 0 0 3px rgba(110, 119, 64, 0.12);
}

.hb-popup-field.is-invalid input,
.hb-popup-field.is-invalid select,
.hb-popup-field.is-invalid textarea {
    border-color: #EF4444 !important;
    background-color: #FEF2F2 !important;
}

/* Phone Row & ISD Selector */
.hb-popup-phone-row {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 0.625rem;
    align-items: center;
}

.hb-popup-field--isd {
    position: relative;
}

.hb-popup-field--isd select {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
    padding: 0;
    margin: 0;
}

.hb-popup-field--isd .contact-us-section__isd-container {
    position: relative;
    width: 100%;
}

.hb-popup-field--isd .contact-us-section__isd-trigger {
    width: 100%;
    min-height: 46px;
    height: 46px;
    padding: 0.5rem 0.625rem;
    background-color: #F3F4F6;
    border: 1.5px solid transparent;
    border-radius: 10px;
    font-size: 0.84375rem;
    font-weight: 600;
    color: #07102F;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    box-sizing: border-box;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.hb-popup-field--isd .contact-us-section__isd-trigger:focus-visible {
    background-color: #ffffff;
    border-color: #6E7740;
    outline: none;
}

.hb-popup-field--isd .contact-us-section__isd-code {
    font-size: 0.84375rem;
    font-weight: 600;
    color: #07102F;
    white-space: nowrap;
}

.hb-popup-field--isd .contact-us-section__flag-badge {
    width: 22px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
}

.hb-popup-field--isd .contact-us-section__isd-arrow,
.hb-popup-field--isd svg.contact-us-section__isd-arrow {
    margin-left: auto;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    display: inline-block;
    stroke: #64748B;
    transition: transform 0.2s ease;
}

.hb-popup-field--isd.is-open .contact-us-section__isd-arrow,
.hb-popup-field--isd .contact-us-section__isd-container.is-open .contact-us-section__isd-arrow {
    transform: rotate(180deg);
}

.hb-popup-field--isd .contact-us-section__isd-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 999;
    width: 280px;
    max-height: 200px;
    overflow-y: auto;
    background-color: #ffffff;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    display: none;
    padding: 4px;
}

.hb-popup-field--isd.is-open .contact-us-section__isd-menu,
.hb-popup-field--isd .contact-us-section__isd-container.is-open .contact-us-section__isd-menu {
    display: block;
}

.hb-popup-field--isd .contact-us-section__isd-option {
    width: 100%;
    border: 0;
    background: transparent;
    padding: 0.5rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #07102F;
    font-size: 0.84375rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
}

.hb-popup-field--isd .contact-us-section__isd-option:hover,
.hb-popup-field--isd .contact-us-section__isd-option.is-selected {
    background-color: #F1F5F9;
}

/* Checkbox */
.hb-popup-checkbox-field {
    margin-top: 0.25rem;
}

.hb-popup-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.78125rem;
    color: #475569;
    cursor: pointer;
    user-select: none;
}

.hb-popup-checkbox-label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    margin-top: 0.125rem;
    accent-color: #6E7740;
    cursor: pointer;
}

.hb-popup-checkbox-label a {
    color: #6E7740;
    text-decoration: underline;
    font-weight: 600;
}

/* reCAPTCHA Notice */
.hb-popup-recaptcha {
    margin-top: 0.125rem;
    margin-bottom: 0.125rem;
}

.hb-popup-recaptcha-text {
    font-size: 0.71875rem;
    color: #64748B;
    line-height: 1.35;
    display: block;
}

.hb-popup-recaptcha-text a {
    color: #6E7740;
    text-decoration: underline;
    font-weight: 600;
}

/* Form Submit Button */
.hb-popup-submit-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background-color: #6E7740;
    color: #ffffff;
    border: none;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
    margin-top: 0.25rem;
}

.hb-popup-submit-btn:hover {
    background-color: #5A6233;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(110, 119, 64, 0.3);
}

.hb-popup-submit-btn:hover svg {
    transform: translateX(3px);
}

.hb-popup-submit-btn svg {
    transition: transform 0.2s ease;
}

/* Feedback message */
.hb-popup-feedback {
    font-size: 0.8125rem;
    margin: 0;
    min-height: 1.25rem;
    font-weight: 600;
}

.hb-popup-feedback.is-error {
    color: #EF4444;
}

/* Utility */
.d-none {
    display: none !important;
}

/* ============================================================
   RESPONSIVE DESIGN BREAKPOINTS
   ============================================================ */

@media (max-width: 991px) {
    .hb-popup-container {
        max-width: 720px;
    }

    .hb-popup-left,
    .hb-popup-right {
        padding: 2rem 1.5rem;
    }

    .hb-popup-title {
        font-size: 1.75rem;
    }

    .hb-popup-benefits {
        grid-template-columns: 1fr;
    }

    .hb-popup-benefit-card {
        flex-direction: row;
        gap: 0.75rem;
        text-align: left;
        padding: 0.5rem 0.875rem;
    }

    .hb-popup-benefit-icon {
        margin-bottom: 0;
    }

    .hb-popup-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .hb-popup-overlay {
        padding: 0.75rem;
    }

    .hb-popup-container {
        border-radius: 20px;
        max-height: 94vh;
    }

    .hb-popup-body {
        grid-template-columns: 1fr;
    }

    .hb-popup-left {
        display: none;
    }

    .hb-popup-right {
        padding: 2.25rem 1.25rem 1.5rem 1.25rem;
        border-radius: 20px;
    }

    .hb-popup-close {
        top: 0.75rem;
        right: 0.75rem;
        width: 2.25rem;
        height: 2.25rem;
    }

    .hb-popup-form-title {
        font-size: 1.5rem;
    }

    .hb-popup-phone-row {
        grid-template-columns: 105px 1fr;
    }
}
