/* ============================================================
   "Let's Discuss Your Project" popup form — shared across the
   NetSet product pages (src/pages/products/index.astro and
   src/pages/products/<product>/index.astro).
   Ported from the reference google-add-form-popup.php include.

   NOTE: the source file declared its color tokens (--primary,
   --accent, --ink, --border, --muted, --card, ...) on :root. Several
   of those names (--border, --muted, --card) are already used
   sitewide by products/main.css (e.g. `* { border-color: var(--border) }`),
   so defining them on :root here would silently repaint borders/muted
   text across the entire page. Scoped to #ctaModal instead — every
   rule below that references these tokens lives inside #ctaModal, so
   behavior inside the popup is unchanged, nothing else on the page
   is affected.
   ============================================================ */
#ctaModal {
    --bg-0: #FFFFFF;
    --bg-1: #FFFFFF;
    --bg-2: #FFFFFF;
    --card: #FFFFFF;
    --card-2: #FFFFFF;
    --border: #E5E5E5;
    --border-2: #014088;
    --text: #000000;
    --muted: #4A4A4A;
    --muted-2: #71717A;
    --p1: #014088;
    --p2: #014088;
    --p3: #014088;
    --c1: #014088;
    --c2: #2D8CFF;
    --grad: linear-gradient(135deg, #014088 0%, #2D8CFF 100%);
    --grad-text: linear-gradient(135deg, #014088 0%, #2D8CFF 100%);
    --grad-btn: linear-gradient(135deg, #014088 0%, #2D8CFF 100%);
    --grad-card: linear-gradient(180deg, rgba(8, 106, 216, 0.03), rgba(45, 140, 255, 0.01));
    --primary: #014088;
    --primary-dark: #0050CC;
    --accent: #ed5f00;
    --accent-dark: #E55A0F;
    --ink: #0A1733;
    --slate: #475569;
    --line: #E2E8F0;
    --success: #10B981;
}

/* ===== POPUP MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgb(1 9 26 / 86%);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: cta-fadeIn 0.25s ease;
}

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

@keyframes cta-fadeIn {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

@keyframes cta-slideUp {
    from {
        opacity: 0;
        transform: translateY(30px)
    }

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

/* ----- Close Button ----- */
.cta-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.06);
    border: 1.5px solid rgba(0, 0, 0, 0.12);
    color: #4a5568;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s, color 0.2s, transform 0.22s;
    padding: 0;
    line-height: 1;
}

.cta-modal-close:hover {
    background: rgba(8, 106, 216, 0.1);
    color: #014088;
    border-color: rgba(8, 106, 216, 0.25);
    transform: rotate(90deg);
}

/* ----- Left Panel ----- */
.cta-modal-left {
    flex: 0 0 50%;
    position: relative;
}

.cta-modal-left-inner {
    width: 100%;
    height: 100%;
    padding: 32px 32px 15px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    background-color: linear-gradient(180deg, #014088 0%, #067EE1 100%);
    background-image: url('/images/images/pop-up-from-bg.webp');
    background-position: left;
    background-repeat: no-repeat;
    background-size: cover;

}

.cta-modal-left::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(180deg, #014088 0%, #067EE1 100%) !important;
}

.cta-modal-left::after {
    content: "";
    position: absolute;
    bottom: -80px;
    left: -60px;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.cta-modal-left .eyebrow {
    background: rgba(255, 255, 255, 0.16) !important;
    border: 1px solid rgba(255, 255, 255, 0.28) !important;
    color: #fff !important;
    margin-bottom: 20px;
    align-self: flex-start;
    position: relative;
    z-index: 1;
}

.cta-modal-logo {
    height: 30px;
    width: auto;
    margin-bottom: 28px;
    position: relative;
    z-index: 1;
}

.cta-modal-title {
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    line-height: 26px;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.cta-modal-subtitle {
    color: rgba(255, 255, 255, 0.82);
    font-size: 16px;
    font-weight: 300;
    line-height: 19px;
    margin-bottom: 26px;
    position: relative;
    z-index: 1;
}

.cta-trust-list {
    list-style: none;
    margin-bottom: 28px;
    padding: 0;
    position: relative;
    z-index: 1;
}

.cta-trust-list li {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    line-height: 1.4;
}

.cta-trust-check {
    width: 18px;
    height: 18px;
    min-width: 18px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cta-badge-grid {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: auto;
    padding-top: 16px;
    position: relative;
    z-index: 1;
}

.cta-badge-item {

    border-radius: 10px;

    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
}

.cta-badge-item img {
    max-width: 75px;
    max-height: 75px;
    object-fit: contain;
    display: block;
}

.cta-badge-caption {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    margin-top: 8px;
    margin-bottom: 0;
    position: relative;
    z-index: 1;
}

/* ----- Right Panel (Form) ----- */
.cta-modal-right {
    flex: 1;
    padding: 36px 36px 32px;
    overflow-y: auto;
    max-height: 95vh;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
    text-align: left;
}

.cta-modal-right::-webkit-scrollbar {
    width: 4px;
}

.cta-modal-right::-webkit-scrollbar-track {
    background: transparent;
}

.cta-modal-right::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.cta-form-title {
    font-size: 25px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 11px;
    line-height: 1.2;
}

.cta-form-title span {
    color: var(--primary);
}

.cta-form-sub {
    font-size: 16px;
    line-height: 19px;
    color: var(--slate);
    margin-bottom: 20px;
}

/* ----- Form Fields ----- */
.form-field {
    margin-bottom: 17px;
    display: block;
    width: 100%;
    position: relative;
}

/* Field labels only - never error labels */
.form-field label:not(.error) {
    display: block !important;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left !important;
    width: 100%;
    float: none;
    line-height: 1.4;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1.5px solid var(--line);
    border-radius: 7px;
    font-family: inherit;
    font-size: 16px;
    background: #fff;
    transition: all 0.15s;
    color: var(--ink);
    display: block;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.12);
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-items: start;
}

/* Validation error labels */
#ctaModal label.error {
    display: block !important;
    font-size: 16px !important;
    font-weight: 400 !important;
    color: red !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    margin-top: 3px !important;
    margin-bottom: 0 !important;
    text-align: left !important;
    float: none !important;
    width: 100% !important;
    line-height: 1.4 !important;
}

#ctaModal .validation_error {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: red;
    margin-top: 3px;
    text-align: left;
}

/* ----- Select2 normalization (scoped to the popup) ----- */
#ctaModal .select2-container {
    width: 100% !important;
}

#ctaModal .select2-container--default .select2-selection--multiple {
    min-height: 44px;
    border: 1.5px solid var(--line) !important;
    border-radius: 7px !important;
    padding: 6px 10px !important;
    background: #fff !important;
    font-family: inherit;
}

#ctaModal .select2-container--default .select2-selection--multiple .select2-selection__placeholder {
    font-size: 16px;
    color: #999;
    line-height: 30px;
    font-family: inherit;
}

#ctaModal .select2-container--default .select2-search--inline .select2-search__field {
    font-size: 16px;
    font-family: inherit;
    margin-top: 4px;
    color: var(--ink);
}

#ctaModal .select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.12) !important;
    outline: none !important;
}

.form-submit {
    width: 100%;
    background: var(--accent);
    color: #fff;
    padding: 14px;
    border: none;
    border-radius: 7px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    margin-top: 6px;
    font-family: inherit;
    transition: all 0.2s;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

}

.form-submit:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 26, 0.35);
}

.form-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.form-note {
    font-size: 15px;
    line-height: 15px;
    color: var(--slate);
    text-align: center;
    margin-top: 20px;
}

.form-note .secure {
    color: var(--success);
    font-weight: 600;
}

.cta-modal-box {
    background: #fff;
    border-radius: 18px;
    max-width: 1100px;
    width: 100%;
    max-height: 95vh;
    overflow: hidden;
    position: relative;
    animation: cta-slideUp 0.35s ease;
    box-shadow: 0 32px 80px rgba(10, 23, 51, 0.32);
    display: flex;
}

/* ----- Modal Responsive ----- */
@media (max-width: 820px) {
    .cta-modal-box {
        flex-direction: column;
        overflow-y: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .cta-modal-box::-webkit-scrollbar {
        display: none;
    }

    .cta-modal-left {
        flex: none;
        padding: 26px 22px 20px;
    }

    .cta-modal-title {
        font-size: 18px;
    }

    .cta-modal-subtitle {
        font-size: 16px;
        margin-bottom: 14px;
    }

    .cta-trust-list {
        display: none;
    }

    .cta-badge-grid {
        margin-top: 14px;
        padding-top: 0;
        gap: 8px;
    }

    .cta-badge-item {
        min-height: 48px;
    }

    .cta-badge-item img {
        max-width: 58px;
        max-height: 34px;
    }

    .cta-modal-right {
        max-height: unset;
        padding: 24px 20px 28px;
    }

    .cta-modal-close {
        top: 12px;
        right: 12px;
    }
    .cta-modal-left {
        display: none;
    }
}

@media (max-width: 480px) {
    .cta-modal-left {
        padding: 20px 18px 16px;
    }

    .cta-badge-grid {
        display: none;
    }

    .cta-badge-caption {
        display: none;
    }

    .cta-modal-right {
        padding: 20px 16px 22px;
    }

    .cta-form-title {
        font-size: 19px;
    }
}

@media (max-width: 768px) {
    

    #ctaModal .cta-modal-box {
        overflow-y: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    #ctaModal .cta-modal-box::-webkit-scrollbar {
        display: none;
    }

    #ctaModal .form-card,
    #ctaModal .hero-form {
        padding: 20px;
    }

    #ctaModal span#modalTrigger {
        font-size: 16px;
    }

    #ctaModal .cta-modal-box {
        height: unset !important;
    }
}
