/**
 * Página de links (/site/pagelink).
 *
 * Duas colunas: à esquerda o que se edita, à direita o telefone com a prévia.
 * A moldura do telefone e tudo o que vive dentro dela vêm da tela antiga sem
 * mudança de desenho: aquilo é o retrato do que o visitante vai ver, e mexer no
 * retrato para combinar com o painel seria mentir sobre o resultado.
 *
 * O que mudou é a coluna da esquerda e a barra de publicação, que são painel e
 * agora falam a língua dele.
 */

.plwrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 470px;
    gap: 18px;
    align-items: start;
}

.plform { display: flex; flex-direction: column; gap: 14px; }

/* ---------- cartões da coluna de edição ---------- */

.plcard {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.plcard__head {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    border-bottom: 1px solid var(--border-soft);
}

.plcard__head i { color: var(--text-soft); }
.plcard__body { display: flex; flex-direction: column; gap: 16px; padding: 16px; }

.plfield { display: flex; flex-direction: column; gap: 7px; }

.plfield__top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.plfield__label { font-size: 14.5px; font-weight: 600; color: var(--text); }
.plfield__count { font-size: 13px; color: var(--text-soft); }

.plinput {
    width: 100%;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 15px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.plinput:hover { border-color: var(--brand-300); }
.plinput:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.plinput.is-invalid { border-color: var(--danger); }

textarea.plinput { resize: vertical; min-height: 66px; line-height: 1.5; }

.plerr { font-size: 13.5px; font-weight: 700; color: var(--danger); }

/* ---------- interruptor ---------- */

.plswitch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    font-size: 14.5px;
    color: var(--text);
    cursor: pointer;
}

.plswitch input { width: 0; height: 0; opacity: 0; position: absolute; }

.plswitch__track {
    position: relative;
    flex: 0 0 42px;
    width: 42px;
    height: 24px;
    border-radius: var(--radius-pill);
    background: var(--surface-3);
    transition: background .18s ease;
}

.plswitch__track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: transform .18s ease;
}

.plswitch input:checked + .plswitch__track { background: var(--brand); }
.plswitch input:checked + .plswitch__track::after { transform: translateX(18px); }
.plswitch input:focus-visible + .plswitch__track { box-shadow: 0 0 0 3px var(--brand-100); }

/* ---------- tema e cores ---------- */

.plthemes { display: flex; gap: 8px; }

.plthemes .btn { flex: 1 1 0; justify-content: center; }

.swatch-wrap { display: flex; gap: 8px; flex-wrap: wrap; }

.swatch {
    width: 30px;
    height: 30px;
    border: 3px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: transform .1s, border-color .15s;
}

.swatch:hover { transform: scale(1.15); }
.swatch.selected { border-color: var(--text); }

.swatch-none {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 2px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    cursor: pointer;
}

.swatch-none::after {
    content: "";
    position: absolute;
    width: 62%;
    height: 1.5px;
    background: var(--text-soft);
    transform: rotate(-45deg);
}

.swatch-none.selected { border-color: var(--text); border-width: 2.5px; }

/* ---------- logo ---------- */

.pllogo { display: flex; align-items: center; gap: 14px; }

.pllogo__thumb {
    position: relative;
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface-2);
}

.pllogo__thumb img { width: 100%; height: 100%; object-fit: cover; }

.pllogo__acts { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.pllogo__status { font-size: 13.5px; font-weight: 600; }
.pllogo__status--ok { color: var(--ok-fg); }
.pllogo__status--err { color: var(--danger); }
.pllogo__status--wait { color: var(--text-muted); }
.pllogo__hint { font-size: 13.5px; color: var(--text-muted); }

/* ---------- links ---------- */

.link-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    transition: opacity .25s;
}

.link-item.disabled-item { opacity: .45; }
.link-item__row { display: flex; align-items: center; gap: 10px; }
.link-item__row .plinput { flex: 1 1 auto; }

.link-item__acts { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.plicon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    font-size: 14px;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
}

.plicon-btn:hover { color: var(--danger); border-color: var(--danger); background: var(--err-bg); }

.plempty {
    padding: 22px 16px;
    font-size: 14.5px;
    text-align: center;
    color: var(--text-muted);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}

/* ---------- redes ---------- */

.social-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border-soft);
    transition: opacity .25s;
}

.social-row:last-child { border-bottom: 0; }
.social-row.disabled-item { opacity: .45; }
.social-info { display: flex; align-items: center; gap: 11px; min-width: 0; }

.social-info__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    font-size: 15px;
    color: var(--text-muted);
    border-radius: 50%;
    background: var(--surface-2);
}

.social-info__value {
    font-size: 13.5px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- coluna da prévia ---------- */

.plpreview { position: sticky; top: 12px; display: flex; flex-direction: column; align-items: center; }

.preview-header { width: 100%; margin-bottom: 14px; }

.publish-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.publish-row-left { display: flex; align-items: center; gap: 11px; min-width: 0; }

.publish-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    font-size: 14px;
    border-radius: 50%;
    transition: background .3s, color .3s;
}

.publish-icon.on { color: var(--ok-fg); background: var(--ok-bg); }
.publish-icon.off { color: var(--err-fg); background: var(--err-bg); }
.publish-label { font-size: 14.5px; font-weight: 650; color: var(--text); }
.publish-sub { font-size: 13px; color: var(--text-muted); }

.preview-url-badge {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 11px 14px;
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.preview-url-badge:hover { border-color: var(--brand-300); background: var(--brand-50); }

.preview-url-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    font-size: 13px;
    color: var(--brand-700);
    border-radius: var(--radius-sm);
    background: var(--brand-100);
}

.preview-url-text {
    flex: 1;
    min-width: 0;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--brand-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-url-ext { flex-shrink: 0; font-size: 12px; color: var(--text-soft); }

/**
 * O telefone.
 *
 * Daqui para baixo é o desenho do que o visitante vê, copiado da tela antiga
 * sem mudanças. As cores saem do tema escolhido pelo cliente, não dos tokens do
 * painel: é a página dele, não a nossa.
 */

.phone-outer { transform-origin: top center; transform: scale(var(--phone-scale, .68)); margin-bottom: var(--phone-margin, -240px); }
.phone-wrap { position: relative; width: 448px; }
.phone-frame { width: 448px; height: 820px; border: 14px solid #1a1a1a; border-radius: 52px; position: relative; overflow: hidden; transition: background .3s; }
.phone-notch { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 110px; height: 28px; background: #1a1a1a; border-radius: 0 0 20px 20px; z-index: 10; }
.phone-btn-r { position: absolute; right: -5px; top: 110px; width: 5px; height: 46px; background: #1a1a1a; border-radius: 0 4px 4px 0; }
.phone-btn-l1 { position: absolute; left: -5px; top: 96px; width: 5px; height: 28px; background: #1a1a1a; border-radius: 4px 0 0 4px; }
.phone-btn-l2 { position: absolute; left: -5px; top: 136px; width: 5px; height: 46px; background: #1a1a1a; border-radius: 4px 0 0 4px; }
.phone-btn-l3 { position: absolute; left: -5px; top: 196px; width: 5px; height: 46px; background: #1a1a1a; border-radius: 4px 0 0 4px; }
.phone-inner { width: 100%; height: 100%; border-radius: 38px; overflow: hidden; display: flex; flex-direction: column; align-items: center; transition: background .3s; }

.phone-content { width: 420px; height: 764px; flex-shrink: 0; overflow-y: auto; scrollbar-width: none; display: flex; flex-direction: column; align-items: center; transition: background .3s, color .3s; }
.phone-content::-webkit-scrollbar { display: none; }

.phone-globe { position: absolute; top: 36px; right: 20px; z-index: 5; }
.phone-globe-btn { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; border: none; cursor: pointer; }

.phone-logo-box { margin-top: 56px; width: 100px; height: 100px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; border: 3px solid rgba(255, 255, 255, .2); }
.phone-logo-box img { width: 100%; height: 100%; object-fit: cover; }

.phone-radio-name { font-size: 20px; font-weight: 700; margin: 12px 0 4px; text-align: center; padding: 0 24px; }
.phone-radio-desc { font-size: 12px; text-align: center; padding: 0 24px; margin-bottom: 16px; opacity: .75; }

.phone-player { width: 100%; border-radius: 14px 14px 0 0; padding: 12px 14px; display: flex; gap: 12px; align-items: center; flex-shrink: 0; border: 1px solid rgba(128, 128, 128, .2); border-bottom: none; transition: background .3s; }
.phone-player-left { flex: 1; min-width: 0; }
.phone-player-label { font-size: 10px; font-weight: 600; letter-spacing: .06em; opacity: .6; text-transform: uppercase; }
.phone-player-track { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 2px 0; }
.phone-player-status { display: flex; align-items: center; gap: 4px; font-size: 11px; opacity: .7; }
.phone-player-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.phone-play-btn { width: 48px; height: 48px; border-radius: 50%; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background .3s; }
.phone-play-icon { width: 0; height: 0; border-top: 9px solid transparent; border-bottom: 9px solid transparent; border-left: 16px solid white; margin-left: 3px; }
.phone-vol-bar { flex: 1; height: 4px; border-radius: 2px; background: rgba(128, 128, 128, .25); }
.phone-vol-fill { width: 65%; height: 100%; border-radius: 2px; transition: background .3s; }

.phone-socials { display: flex; gap: 14px; margin-bottom: 18px; flex-shrink: 0; }
.phone-social-btn { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: background .3s; }

.phone-links-area { width: calc(100% - 32px); display: flex; flex-direction: column; gap: 10px; flex-shrink: 0; }
.phone-link-btn { width: 100%; border-radius: 32px; padding: 13px; text-align: center; font-size: 15px; font-weight: 600; border: none; cursor: pointer; transition: background .3s, color .3s; }
.phone-link-empty { font-size: 14px; font-style: italic; text-align: center; padding: 10px 0; opacity: .5; }

.phone-footer { font-size: 11px; padding: 20px 0 16px; text-align: center; flex-shrink: 0; margin-top: auto; opacity: .5; }

@media (max-width: 1100px) {
    .plwrap { grid-template-columns: 1fr; }
    .plpreview { position: static; order: -1; }
    .phone-outer { transform: scale(var(--phone-scale-mobile, .75)); margin-bottom: var(--phone-margin-mobile, -200px); }
}

/* estados que o script liga e desliga */
.is-hidden { display: none !important; }

.pllogo__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    border-radius: 50%;
    background: rgba(0, 0, 0, .5);
}

.phone-logo-empty { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 2rem; opacity: .4; }
.phone-player-wrap { width: calc(100% - 32px); margin-bottom: 16px; flex-shrink: 0; border: 1px solid rgba(128, 128, 128, .2); border-radius: 14px; overflow: hidden; }
.phone-player-wrap .phone-player { border: none; border-radius: 0; margin-bottom: 0; }

.phone-player-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    font-size: 16px;
    border-radius: 10px;
    background: rgba(128, 128, 128, .15);
}

.phone-player-thumb i { opacity: .4; }
.phone-player-right { display: flex; flex-direction: column; align-items: center; gap: 6px; flex-shrink: 0; }
.phone-vol-wrap { display: flex; align-items: center; gap: 5px; width: 72px; }
.phone-vol-wrap i { font-size: 10px; opacity: .4; flex-shrink: 0; }
.phone-vol-bar { flex: 1; height: 3px; }

/* o salvar do cabeçalho fica ao lado do aviso, sem empurrar os botões */
.page-head__acts .pllogo__status { align-self: center; }

/* o rótulo e a explicação são duas linhas, não uma frase só */
.publish-label,
.publish-sub { display: block; }
.publish-row .plswitch { gap: 10px; }
