/* ============================================================
   TELEPHONE PICKER — выбор страны + маска телефона
   ============================================================ */

.tp-phone {
    display: flex;
    align-items: stretch;
    gap: 8px;
    position: relative;
    font-family: inherit;
    width: 100%;
}
.tp-phone * { box-sizing: border-box; }

.tp-phone__trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 10px;
    min-width: 60px;
    height: 48px;
    background: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s;
    font: inherit;
}
.tp-phone__trigger:hover { border-color: #477AF4; }
.tp-phone__trigger:focus { outline: none; border-color: #477AF4; }

.tp-phone__flag {
    display: inline-block;
    width: 24px;
    height: 16px;
    border-radius: 2px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
    vertical-align: middle;
}
.tp-phone__flag svg { display: block; width: 100%; height: 100%; }

.tp-phone__list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 220px;
    margin: 0;
    padding: 4px;
    list-style: none;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 9999;
    display: none;
}
.tp-phone.open .tp-phone__list { display: block; }

.tp-phone__list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background 0.15s;
}
.tp-phone__list li:hover  { background: #f0f6ff; }
.tp-phone__list li.active { background: #e7f1ff; font-weight: 600; }
.tp-phone__list .tp-phone__code {
    margin-left: auto;
    color: #888;
    font-size: 13px;
}

.tp-phone__input {
    flex: 1;
    min-width: 0;
    padding: 0 14px;
    height: 48px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    font-variant-numeric: tabular-nums;
    transition: border-color 0.2s;
    font-family: inherit;
    color: #1a1a1a;
    background: #fff;
}
.tp-phone__input:focus   { border-color: #477AF4; }
.tp-phone__input.invalid { border-color: #dc3545; box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1); }
.tp-phone__input.valid   { border-color: #28a745; box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1); }

.tp-phone__error {
    color: #dc3545;
    font-size: 13px;
    margin: 6px 0 0;
    min-height: 18px;
}