/* intl-phone-input.css — International Phone Input Component for LimoHawk */

/* ============================================
   INTERNATIONAL PHONE INPUT WRAPPER
   ============================================ */
.intl-phone-wrapper {
    display: flex;
    gap: 0;
    align-items: stretch;
}

/* ============================================
   DROPDOWN CONTAINER (left side)
   Positions the trigger + panel together
   ============================================ */
.intl-phone-dropdown-container {
    position: relative;
    flex: 0 0 auto;
}

/* ── Trigger button (collapsed state) ── */
.intl-phone-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 110px;
    max-width: 130px;
    padding: 12px 10px 12px 14px;
    background: var(--input-tint-bg);
    border: 1px solid var(--glass-border);
    border-right: none;
    border-radius: 8px 0 0 8px;
    color: var(--text-main);
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.2s, box-shadow 0.2s;
    height: 100%;
    box-sizing: border-box;
}

.intl-phone-trigger:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(194, 162, 98, 0.15);
    z-index: 1;
}

.intl-phone-trigger[aria-expanded="true"] {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(194, 162, 98, 0.15);
}

.intl-trigger-flag {
    font-size: 1.1rem;
    line-height: 1;
}

.intl-trigger-code {
    font-size: 0.85rem;
    font-weight: 500;
    flex: 1;
}

.intl-trigger-chevron {
    font-size: 0.7rem;
    color: var(--accent-gold, #c2a262);
    margin-left: 2px;
}

/* ── Dropdown panel ── */
.intl-phone-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 9999;
    width: 260px;
    background: var(--modal-bg, #1a1a2e);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

/* ── Search input inside panel ── */
.intl-phone-search {
    display: block;
    width: 100%;
    padding: 10px 14px;
    background: var(--input-bg, rgba(255,255,255,0.05));
    border: none;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-main);
    font-size: 0.875rem;
    box-sizing: border-box;
}

.intl-phone-search:focus {
    outline: none;
    background: var(--input-tint-bg, rgba(255,255,255,0.08));
}

.intl-phone-search::placeholder {
    color: var(--input-placeholder, rgba(255,255,255,0.35));
}

/* ── Country list ── */
.intl-phone-list {
    list-style: none;
    margin: 0;
    padding: 4px 0;
    max-height: 240px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-gold, #c2a262) transparent;
}

.intl-phone-list::-webkit-scrollbar {
    width: 4px;
}

.intl-phone-list::-webkit-scrollbar-thumb {
    background: var(--accent-gold, #c2a262);
    border-radius: 2px;
}

/* ── Country option ── */
.intl-phone-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-main);
    transition: background 0.1s;
}

.intl-phone-option:hover,
.intl-phone-option.highlighted {
    background: rgba(194, 162, 98, 0.12);
}

.intl-phone-option.selected {
    background: rgba(194, 162, 98, 0.08);
    font-weight: 600;
}

.intl-option-flag {
    font-size: 1.1rem;
    line-height: 1;
    flex: 0 0 auto;
}

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

.intl-option-code {
    flex: 0 0 auto;
    color: var(--text-secondary, rgba(255,255,255,0.5));
    font-size: 0.8rem;
    font-weight: 500;
}

/* ============================================
   LOCAL NUMBER INPUT (right side)
   ============================================ */
.intl-phone-number {
    flex: 1;
    min-width: 0;
    padding: 12px 16px;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 0 8px 8px 0;
    color: var(--text-main);
    /* #351: match sibling .premium-input metrics exactly so the phone field is
       the same height as the Full Name / Email fields next to it. */
    font-size: 0.95rem;
    line-height: 1.4;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* #351: the trigger shares the same box model so both halves are one height. */
.intl-phone-trigger {
    line-height: 1.4;
}

.intl-phone-number::placeholder {
    color: var(--input-placeholder);
}

.intl-phone-number:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(194, 162, 98, 0.15);
}

/* Hover state — subtle gold border hint */
.intl-phone-wrapper:hover .intl-phone-trigger,
.intl-phone-wrapper:hover .intl-phone-number {
    border-color: rgba(194, 162, 98, 0.3);
}

/* Focus-within — both parts highlight together */
.intl-phone-wrapper:focus-within .intl-phone-trigger {
    border-color: var(--accent-gold);
}
.intl-phone-wrapper:focus-within .intl-phone-number {
    border-color: var(--accent-gold);
}

/* ============================================
   READ-ONLY PHONE DISPLAY
   ============================================ */
.phone-display {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.phone-display .phone-flag {
    font-size: 1.1rem;
}

.phone-display .phone-code {
    color: var(--text-secondary);
    font-weight: 500;
}

.phone-display .phone-local {
    color: var(--text-main);
    font-weight: 500;
}

/* ============================================
   RESPONSIVE — Mobile adjustments
   ============================================ */
@media (max-width: 600px) {
    .intl-phone-trigger {
        min-width: 90px;
        max-width: 110px;
        font-size: 0.85rem;
        padding: 12px 8px 12px 10px;
    }

    .intl-phone-number {
        font-size: 0.85rem;
    }

    .intl-phone-panel {
        width: 240px;
    }
}

/* iOS zoom prevention (16px minimum) */
@media (max-width: 768px) {
    .intl-phone-trigger,
    .intl-phone-number,
    .intl-phone-search {
        font-size: 16px !important;
    }
}

/* ── #407: cream-skin (.cb-public-cream) contrast override ──
   The company/b2c booking forms are the permanently-cream .cb-public-cream page.
   The country dropdown's default dark panel (background: var(--modal-bg) → #1a1a2e)
   keeps the dark-theme surface, while the option text resolves to the cream skin's
   dark green (color: var(--text-main) → #173728) → dark-green-on-navy, illegible.
   Re-skin the whole dropdown to a light surface with dark text on the cream page. */
.cb-public-cream .intl-phone-panel {
    background: #ffffff;
    border-color: rgba(23, 55, 40, 0.15);
    box-shadow: 0 8px 24px rgba(23, 55, 40, 0.18);
}
.cb-public-cream .intl-phone-search {
    background: #ffffff;
    color: #173728;
    border-bottom-color: rgba(23, 55, 40, 0.12);
}
.cb-public-cream .intl-phone-search::placeholder {
    color: rgba(23, 55, 40, 0.45);
}
.cb-public-cream .intl-phone-option {
    color: #173728;
}
.cb-public-cream .intl-phone-option:hover,
.cb-public-cream .intl-phone-option.highlighted,
.cb-public-cream .intl-phone-option.selected {
    background: rgba(184, 164, 126, 0.18);
}
.cb-public-cream .intl-option-code {
    color: rgba(23, 55, 40, 0.6);
}
