/* ── International phone input with country selector ─────────── */

.intl-phone-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

/* Country flag button — sits to the left of the phone input */
.intl-phone-flag-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.625rem 0.5rem;
    border: 1.5px solid #e5e7eb;
    border-right: none;
    border-radius: 10px 0 0 10px;
    background: #f9fafb;
    cursor: pointer;
    white-space: nowrap;
    font-size: 0.875rem;
    color: #374151;
    transition: border-color 0.15s, background 0.15s;
    flex-shrink: 0;
    line-height: 1;
}

.intl-phone-flag-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.intl-phone-flag-current {
    font-size: 1.125rem;
    line-height: 1;
}

.intl-phone-dial-current {
    font-weight: 600;
    font-size: 0.8125rem;
    color: #6b7280;
}

.intl-phone-caret {
    color: #9ca3af;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.intl-phone-flag-btn[aria-expanded="true"] .intl-phone-caret {
    transform: rotate(180deg);
}

/* Phone input — connected to flag button (no left border, no left radius) */
.intl-phone-wrap input[type="tel"] {
    border-radius: 0 10px 10px 0 !important;
    flex: 1;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

/* Inline form variant (3-column grid) */
.inline-form-row .intl-phone-wrap input[type="tel"] {
    font-size: 0.9375rem;
    padding: 0.75rem 1rem;
}

/* ── Dropdown ───────────────────────────────────────────────── */

.intl-phone-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 9999;
    width: 280px;
    max-width: calc(100vw - 2rem);
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    margin-top: 4px;
    overflow: hidden;
}

.intl-phone-dropdown.open {
    display: block;
    animation: intl-phone-fade-in 0.15s ease-out;
}

@keyframes intl-phone-fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.intl-phone-search {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: none;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.875rem;
    outline: none;
    box-sizing: border-box;
}

.intl-phone-search:focus {
    background: #f9fafb;
}

.intl-phone-items {
    max-height: 240px;
    overflow-y: auto;
    padding: 0.25rem 0;
}

.intl-phone-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.875rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: #374151;
    transition: background 0.1s;
}

.intl-phone-item:hover {
    background: #eff6ff;
}

.intl-phone-flag {
    font-size: 1.125rem;
    line-height: 1;
    flex-shrink: 0;
}

.intl-phone-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.intl-phone-dial {
    color: #9ca3af;
    font-size: 0.8125rem;
    font-weight: 600;
    flex-shrink: 0;
}

/* ── Responsive ─────────────────────────────────────────────── */

@media (max-width: 640px) {
    .intl-phone-dropdown {
        width: calc(100vw - 3rem);
        max-width: 320px;
    }

    .intl-phone-flag-btn {
        padding: 0.625rem 0.375rem;
    }

    .intl-phone-dial-current {
        display: none;
    }
}

/* ── Dark theme support (case_detail CTA uses dark bg) ──────── */

.intl-phone-wrap--dark .intl-phone-flag-btn {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.intl-phone-wrap--dark .intl-phone-dial-current {
    color: rgba(255, 255, 255, 0.7);
}

.intl-phone-wrap--dark .intl-phone-caret {
    color: rgba(255, 255, 255, 0.5);
}

.intl-phone-wrap--dark input[type="tel"] {
    background: white !important;
    color: #1f2937 !important;
}

/* ── Hero form variant (rounded 8px, light bg) ──────────────── */

.hero-v2__field .intl-phone-wrap {
    border-radius: 8px;
}

.hero-v2__field .intl-phone-flag-btn {
    border-radius: 8px 0 0 8px;
    background: #f3f4f6;
    border: 1.5px solid #e5e7eb;
}

.hero-v2__field .intl-phone-wrap input[type="tel"] {
    border-radius: 0 8px 8px 0 !important;
    background: #fafafa;
}

.hero-v2__field .intl-phone-wrap input[type="tel"]:focus {
    border-color: #2563eb;
    background: #fff;
}
