/* 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%;
}

/* ========== Country dropdown theme ==========
   Matches the site's custom selects (src/js/forms/customSelect.js). Values mirror
   the SCSS tokens: $color-border-light, $color-sky-blue-light, $color-dark-gray,
   $color-blue, $color-blue-dark, $color-text-gray, $radius-sm, $shadow-medium.
*/
.iti {
    --iti-border-color: #e0e0e0;
    --iti-hover-color: #e1f5fe;
    --iti-icon-color: #37474f;
    --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: 12px 0 0 12px;
}

.iti__selected-country:focus-visible {
    outline: 2px solid #1976d2;
    outline-offset: -2px;
    border-radius: 12px 0 0 12px;
}

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

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

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

.iti__country-list {
    padding: 4px;
    font-family: 'Nunito', sans-serif;
    color: #37474f;
}

/* 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;
    font-size: 1rem;
    box-shadow: none;
}

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

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

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

.iti__country.iti__highlight {
    background-color: #e1f5fe;
}

.iti__country[aria-selected="true"] {
    font-weight: 700;
    color: #0d47a1;
}

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

.iti__dial-code {
    margin-left: 6px;
    color: #455a64;
}

.iti__no-results {
    padding: 12px;
    color: #455a64;
}
