/**
 * Phone input: country select (compact, with flag) + number input, same height and natural alignment.
 */
:root {
    --trabalhador-form-control-height: 48px;
}

.phone-input-group {
    display: flex;
    align-items: stretch;
    gap: 0.25rem;
}

.phone-input-group .phone-country-wrap {
    flex: 0 0 auto;
    width: 6.5rem;
    min-width: 6.5rem;
    display: flex;
    position: relative;
}

/* Selected country flag image (injected by phone-country-flags.js) */
.phone-input-group .phone-country-flag {
    position: absolute;
    left: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    pointer-events: none;
    display: flex;
    align-items: center;
}
.phone-input-group .phone-country-flag img {
    display: block;
    width: 20px;
    height: 15px;
    min-width: 20px;
    min-height: 15px;
    border-radius: 2px;
    object-fit: cover;
}
/* Make room for flag so select text does not overlap */
.phone-input-group .phone-country-wrap.phone-country-has-flag select {
    padding-left: 1.6rem !important;
}

.phone-input-group .phone-country-wrap select,
.phone-input-group select.phone-country-select {
    width: 100%;
    min-height: 38px;
    padding-left: 0.35rem;
    padding-right: 0.25rem;
    font-size: inherit;
    border-radius: 4px;
    box-sizing: border-box;
}

/* Stretch select to same height as sibling input */
.phone-input-group .phone-country-wrap select {
    flex: 1;
    align-self: stretch;
}

.phone-input-group .form-control {
    flex: 1;
    min-width: 0;
}

/* Phone number input must fill remaining space (override theme/profile width) */
.phone-input-group input[data-phone-input],
.phone-input-group input.form-control[data-phone-input] {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: none !important;
}

/* Contato row: make Telefone/Celular groups fill their column width */
.row-contato-phones .col-md-6 .form-group,
.row-contato-phones .col-md-6 .phone-input-group {
    width: 100%;
    max-width: 100%;
}

/* Worker profile form: keep phone fields equal to all other controls */
.row-contato-phones .phone-input-group .phone-country-wrap,
.row-contato-phones .phone-input-group .phone-country-wrap select,
.row-contato-phones .phone-input-group select.phone-country-select,
.row-contato-phones .phone-input-group input[data-phone-input],
.row-contato-phones .phone-input-group input.form-control[data-phone-input] {
    min-height: var(--trabalhador-form-control-height);
    height: var(--trabalhador-form-control-height);
    box-sizing: border-box;
}

.row-contato-phones .phone-input-group .phone-country-wrap .select2-container,
.row-contato-phones .phone-input-group .phone-country-wrap .select2-container .select2-selection--single {
    min-height: var(--trabalhador-form-control-height);
    height: var(--trabalhador-form-control-height) !important;
}

/* Remove native arrow and show a single chevron (no repeat) */
.phone-input-group .phone-country-wrap select.form-control,
.phone-input-group select.phone-country-select.form-control {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-repeat: no-repeat !important;
    background-position: right 0.35rem center !important;
    background-size: 10px 6px !important;
    padding-right: 1.5rem !important;
}
/* Single chevron SVG – avoid any tiling from other stylesheets */
.phone-input-group .phone-country-wrap select.form-control,
.phone-input-group select.phone-country-select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 12 8'%3E%3Cpath fill='%238E8E93' d='M6 8L0 2h12L6 8z'/%3E%3C/svg%3E") !important;
}
[data-theme="dark"] .phone-input-group .phone-country-wrap select.form-control,
[data-theme="dark"] .phone-input-group select.phone-country-select.form-control,
html[data-theme="dark"] .phone-input-group .phone-country-wrap select.form-control,
html[data-theme="dark"] .phone-input-group select.phone-country-select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 12 8'%3E%3Cpath fill='%23adb5bd' d='M6 8L0 2h12L6 8z'/%3E%3C/svg%3E") !important;
}

/* Match height of sibling input (default and lg); stretch to fill wrap */
.phone-input-group .phone-country-wrap select,
.phone-input-group select.phone-country-select {
    height: 100%;
}

/* Landing / form-control-lg: same height as adjacent input */
.phone-input-group .phone-country-wrap select.form-control-lg,
.phone-input-group select.phone-country-select.form-control-lg {
    min-height: 3rem;
    height: 100%;
}

/* Ensure wrap stretches to match sibling input height (same as Email row) */
.landing-contact-form .phone-input-group .phone-country-wrap,
.phone-input-group .phone-country-wrap {
    align-self: stretch;
}

.landing-contact-form .phone-input-group .phone-country-wrap select,
.phone-input-group .phone-country-wrap select {
    height: 100%;
}

/* Select2 (app profile/conta): match sibling input height when country select is replaced by Select2 */
.phone-input-group .phone-country-wrap .select2-container {
    height: 100% !important;
    min-height: 56px;
    align-self: stretch;
}

.phone-input-group .phone-country-wrap .select2-container .select2-selection--single {
    height: 100% !important;
    min-height: 56px;
    display: flex;
    align-items: center;
}
