/* ============================================================
 * Telefone com seletor de pais (assets/js/telefone-intl.js)
 * ------------------------------------------------------------
 * O botao do pais (bandeira + DDI + seta) fica DENTRO da borda
 * do campo, no lugar do antigo "🇧🇷 +55" fixo do auth.css, e
 * abre a lista suspensa .tel-intl-lista (presa ao <body>).
 * Cores pelos tokens do DS, com fallback para as telas legadas
 * que nao os definem. Tela com fundo escuro redefine
 * --tel-intl-fundo/-borda/-texto/-seta/-fundo-hover e
 * --tel-intl-lista-* (o JS copia estes para a lista).
 * ============================================================ */
.tel-intl {
    position: relative;
    display: flex;
    width: 100%;
}
.tel-intl > input {
    flex: 1 1 auto;
    min-width: 0;
}

.tel-intl__pais {
    position: absolute;
    left: 1px;
    top: 1px;
    bottom: 1px;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0 8px 0 12px;
    border: 0;
    border-right: 1px solid var(--tel-intl-borda, var(--border, #dfe3e8));
    border-radius: 9px 0 0 9px;
    background: var(--tel-intl-fundo, var(--bg-soft, #f5f6f8));
    color: var(--tel-intl-texto, var(--ink, #111827));
    font: inherit;
    font-size: 14px;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .15s ease-out, box-shadow .15s ease-out;
}
.tel-intl__pais:hover,
.tel-intl.is-aberto .tel-intl__pais { background: var(--tel-intl-fundo-hover, var(--bg-muted, #eceef2)); }
.tel-intl__pais:focus { outline: none; }
.tel-intl__pais:focus-visible {
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--owner-accent, #2563eb) 40%, transparent);
}
.tel-intl__pais:disabled { cursor: default; opacity: .7; }

.tel-intl__flag {
    display: inline-flex;
    width: 20px;
    height: 14px;
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .08);
    flex-shrink: 0;
}
.tel-intl__flag svg { width: 100%; height: 100%; display: block; }

.tel-intl__ddi { font-variant-numeric: tabular-nums; }

.tel-intl__seta {
    display: inline-flex;
    width: 12px;
    height: 12px;
    color: var(--tel-intl-seta, var(--ink-3, #6b7280));
    transition: transform .15s ease-out;
}
.tel-intl__seta svg { width: 100%; height: 100%; }
.tel-intl.is-aberto .tel-intl__seta { transform: rotate(180deg); }

/* ─── Lista suspensa ───────────────────────── */
.tel-intl-lista {
    position: fixed;
    z-index: 3000; /* acima de modal (Bootstrap 1050) e do shell */
    max-height: min(320px, calc(100vh - 32px));
    overflow-y: auto;
    padding: 6px;
    border: 1px solid var(--tel-intl-lista-borda, var(--border, #e3e6eb));
    border-radius: 12px;
    background: var(--tel-intl-lista-fundo, var(--surface, #fff));
    color: var(--tel-intl-lista-texto, var(--ink, #111827));
    box-shadow: 0 12px 32px rgba(15, 23, 42, .16), 0 2px 6px rgba(15, 23, 42, .08);
    font-family: inherit;
    animation: tel-intl-lista-in .12s ease-out;
}
.tel-intl-lista[hidden] { display: none; }
.tel-intl-lista.is-acima { animation-name: tel-intl-lista-in-acima; }
@keyframes tel-intl-lista-in { from { opacity: 0; transform: translateY(-4px); } }
@keyframes tel-intl-lista-in-acima { from { opacity: 0; transform: translateY(4px); } }

.tel-intl-lista__item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px; /* alvo de toque */
    padding: 0 12px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.2;
    cursor: pointer;
    user-select: none;
}
.tel-intl-lista__item.is-ativo { background: var(--tel-intl-lista-hover, var(--bg-soft, #f3f4f6)); }
.tel-intl-lista__item.is-selecionado,
.tel-intl-lista__item.is-selecionado.is-ativo { background: var(--tel-intl-lista-selecionado, var(--owner-wash, #eef4ff)); }

.tel-intl-lista__flag {
    display: inline-flex;
    width: 24px;
    height: 16px;
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .08);
    flex-shrink: 0;
    color: var(--tel-intl-lista-texto-2, var(--ink-3, #6b7280));
}
.tel-intl-lista__flag svg { width: 100%; height: 100%; display: block; }
.tel-intl-lista__nome { font-weight: 500; }
.tel-intl-lista__ddi {
    color: var(--tel-intl-lista-texto-2, var(--ink-3, #6b7280));
    font-variant-numeric: tabular-nums;
}
.tel-intl-lista__check {
    display: inline-flex;
    width: 16px;
    height: 16px;
    margin-left: auto;
    color: var(--tel-intl-lista-check, var(--owner-accent, #2563eb));
}
.tel-intl-lista__check svg { width: 100%; height: 100%; }

@media (prefers-reduced-motion: reduce) {
    .tel-intl-lista, .tel-intl__seta { animation: none; transition: none; }
}
