/* =============================================================================
   CF7 Smart Suite — frontend styles
   Dynamic values (colors, sizes) are injected via <style id="cf7ss-dynamic">
   ============================================================================= */

/* ── Validation ──────────────────────────────────────────────────────────────── */

.cf7ss-invalid {
    border-color: rgba(255, 80, 80, 0.65) !important;
    background: rgba(255, 50, 50, 0.05) !important;
    transition: border-color 0.2s, background 0.2s;
}
.cf7ss-invalid:focus {
    border-color: rgba(255, 80, 80, 0.85) !important;
}

.cf7ss-error-tip {
    display: block;
    font-size: 0.72rem;
    color: rgba(255, 100, 100, 0.92);
    margin-top: 10px !important;
    padding-left: 8px;
    line-height: 1.35;
    animation: cf7ssErrIn 0.18s ease both;
}
.cf7ss-error-tip[hidden] { display: none; }

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

/* Restyle CF7's own validation tips to match */
.wpcf7-not-valid-tip {
    font-size: 0.72rem !important;
    color: rgba(255, 100, 100, 0.92) !important;
    margin-top: 6px !important;
    padding-left: 4px !important;
    border: none !important;
    background: none !important;
}

/* ── Submit button lock ──────────────────────────────────────────────────────── */

.wpcf7 input[type="submit"].cf7ss-submit-locked,
.wpcf7 button[type="submit"].cf7ss-submit-locked {
    opacity: 0.42 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    transition: opacity 0.25s;
}

/* ── Overlay / spinner positioning ──────────────────────────────────────────── */

.wpcf7 { position: relative; }

.cf7ss-overlay,
.cf7ss-modal-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    /* background set dynamically */
}

/* Soft fading edges so the blur boundary isn't a hard rectangle */
.cf7ss-overlay {
    -webkit-mask-image:
        linear-gradient(to right, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%),
        linear-gradient(to bottom, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
    -webkit-mask-composite: source-in;
    mask-image:
        linear-gradient(to right, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%),
        linear-gradient(to bottom, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
    mask-composite: intersect;
}

/* ── Spinner — size & color set dynamically ──────────────────────────────────── */
.cf7ss-spinner {
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    animation: cf7ssSpin 0.75s linear infinite;
    flex-shrink: 0;
}
@keyframes cf7ssSpin {
    to { transform: rotate(360deg); }
}

/* ── Feedback block (result content) ─────────────────────────────────────────── */
.cf7ss-feedback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 36px 24px;
    text-align: center;
    animation: cf7ssFadeUp 0.4s ease both;
}
@keyframes cf7ssFadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Icon — size, bg & color set dynamically ─────────────────────────────────── */
.cf7ss-icon {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    flex-shrink: 0;
}
.cf7ss-icon svg {
    width: 46%;
    height: 46%;
}

.cf7ss-title {
    font-weight: 600;
    margin: 0 0 8px;
    line-height: 1.3;
    /* font-size & color set dynamically */
}
.cf7ss-desc {
    margin: 0;
    line-height: 1.5;
    /* font-size & color set dynamically */
}

/* ── Result modal ────────────────────────────────────────────────────────────── */
.cf7ss-result-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.cf7ss-result-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.cf7ss-result-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.48);
    cursor: pointer;
}
.cf7ss-result-modal__dialog {
    position: relative;
    /* background & border set dynamically */
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    border-radius: 20px;
    padding: 44px 36px 36px;
    min-width: 280px;
    max-width: 440px;
    width: 92vw;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.28);
    transform: translateY(-18px) scale(0.97);
    transition: transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.cf7ss-result-modal.is-open .cf7ss-result-modal__dialog {
    transform: translateY(0) scale(1);
}
.cf7ss-result-modal__close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.45);
    padding: 4px 6px;
    transition: color 0.2s;
}
.cf7ss-result-modal__close:hover { color: rgba(255, 255, 255, 0.9); }
.cf7ss-result-modal__body { min-height: 80px; }

/* ── intl-tel-input overrides (glass morphism style) ────────────────────────── */
.bb-cf7-wrap .iti,
.wpcf7 .iti { width: 100%; display: block; }

.wpcf7 .iti--show-selected-dial-code input[type="tel"],
.wpcf7 .iti--separate-dial-code input[type="tel"] {
    padding-left: 96px !important;
}

.wpcf7 .iti__selected-flag {
    background: transparent !important;
    outline: none;
    padding-left: 12px;
}
.wpcf7 .iti__selected-flag:hover,
.wpcf7 .iti__selected-flag:focus {
    background: rgba(255, 255, 255, 0.07) !important;
}
.wpcf7 .iti__arrow { border-top-color: rgba(255,255,255,0.50) !important; }
.wpcf7 .iti__arrow--up { border-bottom-color: rgba(255,255,255,0.50) !important; border-top-color: transparent !important; }

/* Force inline dropdown upward — overrides iti's default "margin-top: 3px" (opens below) */
.iti--inline-dropdown .iti__dropdown-content {
    top: auto !important;
    bottom: 100% !important;
    margin-top: 0 !important;
    margin-bottom: 4px !important;
}

.iti__dropdown-content {
    /* --iti-icon-color cascades to the SVG search icon stroke */
    --iti-icon-color: rgba(255, 255, 255, 0.65);
    background: var(--glass-bg, rgba(255, 255, 255, 0.10)) !important;
    -webkit-backdrop-filter: var(--blur, blur(14px)) saturate(180%) !important;
    backdrop-filter: var(--blur, blur(14px)) saturate(180%) !important;
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.20)) !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.50) !important;
    padding: 8px !important;
    overflow: hidden !important;
    min-width: 260px !important;
}

/* All inner rules scoped to .iti__dropdown-content → specificity 0,2,0 beats theme's 0,1,0 */
.iti__dropdown-content .iti__country-list {
    background: transparent !important;
    background-color: transparent !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: #fff !important;
    max-height: 220px !important;
    padding: 0 !important;
    overflow-x: hidden !important;
    font-size: 0.85rem !important;
}
.iti__dropdown-content .iti__country { border-radius: 10px !important; padding: 7px 10px !important; font-size: 0.85rem !important; }
.iti__dropdown-content .iti__country-name,
.iti__dropdown-content .iti__dial-code { color: rgba(255, 255, 255, 0.85) !important; font-size: 0.85rem !important; }
.iti__dropdown-content .iti__country:hover,
.iti__dropdown-content .iti__country.iti__highlight { background: rgba(255, 255, 255, 0.12) !important; }
.iti__dropdown-content .iti__divider { border-bottom-color: rgba(255, 255, 255, 0.15) !important; margin: 4px 0 !important; }

/* Search wrapper: no extra background */
.iti__dropdown-content .iti__search-input-wrapper {
    background: transparent !important;
}

.iti__dropdown-content .iti__search-input {
    display: block !important;
    width: 100% !important;
    margin-bottom: 6px !important;
    padding: 8px 30px !important;   /* 30px right for clear btn, 30px left for iti's icon */
    background: rgba(255, 255, 255, 0.10) !important;
    background-image: none !important; /* iti already adds SVG icon via .iti__search-icon */
    border: 1px solid rgba(255, 255, 255, 0.20) !important;
    border-radius: 10px !important;
    color: #fff !important;
    caret-color: #fff !important;
    font-size: 0.85rem !important;
    outline: none !important;
    box-sizing: border-box !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}
.iti__dropdown-content .iti__search-input::placeholder { color: rgba(255, 255, 255, 0.45) !important; }
.iti__dropdown-content .iti__search-input:focus {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
}
/* iti's search clear button */
.iti__dropdown-content .iti__search-clear .iti__search-clear-bg { fill: rgba(255,255,255,0.5) !important; }
