/* The site's ".form-group input" rule has higher specificity than
   the library's ".iti__search-input" and overrides its padding-left,
   covering the search icon. This selector wins that specificity fight
   without touching the library's minified file. */
.iti .iti__search-input {
    padding-left: calc(var(--iti-spacer-horizontal) + var(--iti-globe-icon-size) + var(--iti-spacer-horizontal));
}

/* The library-generated ".iti" wrapper is "display: inline-block" by
   default, so it doesn't take the ".form-group" width and the input
   ends up sized to its content instead of filling 100%. */
.form-group .iti {
    display: block;
    width: 100%;
}

/* The dial code label (".iti__selected-dial-code") has no font-size of
   its own, so it inherits the page's base size instead of the smaller
   size the site's ".form-group input" rule uses for the typed number,
   making it look oversized next to the rest of the field. Match it to
   the input's font-size. */
.iti__selected-dial-code {
    font-size: 0.85rem;
}

/* ========== Country dropdown theme ==========
   Matches the site's custom selects (src/scss/components/_select.scss). Values mirror
   the SCSS tokens: $color-gray-200, $color-beige, $color-navy, $color-gray-700,
   $color-gray-500, $color-gold-dark, $radius-sm, $shadow-lg, $fs-sm, $font-family-body.
*/
.iti {
    --iti-border-color: #e8e8e8;
    --iti-hover-color: #f5f0e8;
    --iti-icon-color: #1e3a5f;
    --iti-spacer-horizontal: 12px;
    --iti-arrow-padding: 8px;
    --iti-country-selector-bg: #ffffff;
}

/* Selected-country button: rounded to sit inside the input's left corners */
.iti__selected-country-primary {
    border-radius: 8px 0 0 8px;
}

.iti__selected-country:focus-visible {
    outline: 2px solid #1e3a5f;
    outline-offset: -2px;
    border-radius: 8px 0 0 8px;
}

/* Dropdown panel */
.iti--inline-country-selector .iti__country-selector {
    margin-top: 4px;
    overflow: hidden;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
}

.iti--fullscreen-popup .iti__country-selector {
    overflow: hidden;
    border-radius: 8px;
}

.iti--inline-country-selector .iti__country-list {
    max-height: 240px;
}

/* Country names in the dropdown have no font-size of their own, so
   they'd inherit the page's base size like the dial code did. */
.iti__country-list {
    padding: 4px;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 0.85rem;
    color: #1f2937;
}

/* Search box: no field-style focus ring inside the panel, the wrapper underline marks it */
.iti .iti__search-input {
    padding-top: 12px;
    padding-bottom: 12px;
    border: 0;
    border-radius: 0;
    background: #ffffff;
    font-size: 0.85rem;
    box-shadow: none;
}

.iti .iti__search-input:focus,
.iti .iti__search-input:focus-visible {
    outline: none;
    box-shadow: none;
}

.iti__search-input-wrapper:focus-within {
    box-shadow: inset 0 -2px 0 #1e3a5f;
}

/* Options */
.iti__country {
    border-radius: 5px;
    line-height: 1.4;
}

.iti__country.iti__highlight {
    background-color: #f5f0e8;
    color: #1e3a5f;
}

.iti__country[aria-selected="true"] {
    font-weight: 600;
    color: #1e3a5f;
}

.iti__country[aria-selected="true"] .iti__country-check {
    color: #b8942e;
}

.iti__dial-code {
    margin-left: 6px;
    color: #4b5563;
}

.iti__no-results {
    padding: 12px;
    color: #4b5563;
}
