/* Phone Input with Country Code — DIG-1651
   Two-column sub-label layout matching GDS reference design. */

/* Hide the AFCC-bound __widget text input (combined value carrier) */
.cmp-adaptiveform-phoneinput .cmp-adaptiveform-textinput__widget {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    margin: 0;
    padding: 0;
    border: 0;
}

/* Row: two columns with a gap */
.cmp-adaptiveform-phoneinput__row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 16px;
    width: 100%;
}

/* Columns */
.cmp-adaptiveform-phoneinput__col {
    display: flex;
    flex-direction: column;
}

.cmp-adaptiveform-phoneinput__col--code {
    flex: 0 0 auto;
    min-width: 120px;
}

.cmp-adaptiveform-phoneinput__col--number {
    flex: 1 1 0%;
    min-width: 0;
}

/* Sub-labels — match .cmp-adaptiveform-textinput__label from theme.css */
.cmp-adaptiveform-phoneinput__sublabel {
    font-family: var(--font-sans, "Manulife JH Sans Optimized", sans-serif);
    letter-spacing: 0;
    color: #282B3E;
    font-size: 18px;
    font-weight: 600;
    line-height: 24px;
    display: block;
    margin-bottom: 10px;
}

/* Country code dropdown */
.cmp-adaptiveform-phoneinput__country-code {
    font-family: var(--font-sans, "Manulife JH Sans Optimized", sans-serif);
    color: #282B3E;
    background-color: #FFF;
    border: 1px solid #8E90A2;
    border-radius: 0;
    height: 48px;
    width: 100%;
    padding: 0 32px 0 12px;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    cursor: pointer;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23282B3E' d='M1.41.59 6 5.17 10.59.59 12 2 6 8 0 2z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
}

.cmp-adaptiveform-phoneinput__country-code:hover {
    background-color: #FFF;
    border: 2px solid #34384B;
    padding-left: 11px;
    padding-right: 31px;
}

.cmp-adaptiveform-phoneinput__country-code:focus,
.cmp-adaptiveform-phoneinput__country-code:active {
    background-color: #FFF;
    border: 2px solid #06874E;
    padding-left: 11px;
    padding-right: 31px;
    outline: none;
}

/* Number input */
.cmp-adaptiveform-phoneinput__number {
    font-family: var(--font-sans, "Manulife JH Sans Optimized", sans-serif);
    color: #282B3E;
    background-color: #FFF;
    border: 1px solid #8E90A2;
    border-radius: 0;
    height: 48px;
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    box-sizing: border-box;
}

.cmp-adaptiveform-phoneinput__number::placeholder {
    color: #8E90A2;
}

.cmp-adaptiveform-phoneinput__number:hover {
    background-color: #FFF;
    border: 2px solid #34384B;
    padding: 11px;
}

.cmp-adaptiveform-phoneinput__number:focus,
.cmp-adaptiveform-phoneinput__number:active {
    background-color: #FFF;
    border: 2px solid #06874E;
    padding: 11px;
    outline: none;
}

/* Error state */
.cmp-adaptiveform-phoneinput__number--invalid,
.cmp-adaptiveform-phoneinput__number[aria-invalid="true"] {
    background-color: #FEF3F3;
    border: 2px solid #DB1F00;
}

/* Error message — mirrors .cmp-adaptiveform-textinput__errormessage */
.cmp-adaptiveform-phoneinput__errormessage {
    font-family: var(--font-sans, "Manulife JH Sans Optimized", sans-serif);
    color: #DB1F00;
    margin-top: 5px;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    display: none;
}

/* Responsive: stack on mobile and small tablets */
@media (max-width: 768px) {
    .cmp-adaptiveform-phoneinput__row {
        flex-direction: column;
    }

    .cmp-adaptiveform-phoneinput__col--code,
    .cmp-adaptiveform-phoneinput__col--number {
        width: 100%;
    }
}

/* Warning icon — matches theme's textinput error icon */
.cmp-adaptiveform-phoneinput__errormessage::before {
    content: "\26A0\0020";
}
