/*
 * Pré-atendimento (03/11/2026) — o formulário antes do chat da assistente.
 * Cores da escola pelas variáveis do site (`--primary`, do config.php), com a
 * do widget como reserva. Funciona em 375 px.
 */
.ac1-pre[hidden], .ac1-pre [hidden] { display: none !important; }

html.ac1-pre-aberto, html.ac1-pre-aberto body { overflow: hidden; }

.ac1-pre {
    --pre-cor: var(--primary, var(--ac1-primary, #1a5276));
    --pre-cor-2: var(--primary-light, var(--ac1-primary-light, #2980b9));
    --pre-texto: #1f2a37;
    --pre-suave: #6b7280;
    --pre-borda: #e2e8f0;
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    font-family: inherit;
}

.ac1-pre__fundo {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
}

.ac1-pre__caixa {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    color: var(--pre-texto);
}

.ac1-pre__fechar {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}
.ac1-pre__fechar:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

.ac1-pre__topo {
    padding: 20px 22px 18px;
    background: linear-gradient(135deg, var(--pre-cor), var(--pre-cor-2));
    color: #fff;
    border-radius: 18px 18px 0 0;
}

.ac1-pre__quem { display: flex; align-items: center; gap: 12px; }
.ac1-pre__avatar { width: 52px; height: 52px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.85); object-fit: cover; }
.ac1-pre__nome { font-size: 1.1rem; font-weight: 700; }
.ac1-pre__cargo { font-size: 0.85rem; opacity: 0.9; }

.ac1-pre__msg {
    position: relative;
    margin: 14px 0 0;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    font-size: 0.98rem;
    line-height: 1.45;
}
/* O fantasma ocupa o lugar do texto inteiro (invisível); o texto digitado fica
   por cima, na mesma posição. */
.ac1-pre__fantasma { visibility: hidden; display: block; }
.ac1-pre__texto { position: absolute; left: 14px; right: 14px; top: 12px; }
.ac1-pre__digitando { position: absolute; left: 14px; top: 16px; display: inline-flex; gap: 5px; }
.ac1-pre__digitando i {
    width: 8px; height: 8px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    animation: ac1PrePonto 1s infinite ease-in-out;
}
.ac1-pre__digitando i:nth-child(2) { animation-delay: 0.15s; }
.ac1-pre__digitando i:nth-child(3) { animation-delay: 0.3s; }
@keyframes ac1PrePonto { 0%, 80%, 100% { transform: translateY(0); opacity: 0.5; } 40% { transform: translateY(-4px); opacity: 1; } }

.ac1-pre__form, .ac1-pre__pronto { padding: 18px 22px 22px; }

.ac1-pre__grade {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 14px;
}

.ac1-pre__campo { display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; font-weight: 600; margin-bottom: 12px; }
.ac1-pre__grade .ac1-pre__campo { margin-bottom: 0; }
.ac1-pre__campo em { font-weight: 400; color: var(--pre-suave); font-style: normal; }

.ac1-pre input[type="text"],
.ac1-pre input[type="tel"],
.ac1-pre select,
.ac1-pre textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 12px;
    border: 1.5px solid var(--pre-borda);
    border-radius: 10px;
    background: #f8fafc;
    font: inherit;
    font-weight: 400;
    font-size: 16px; /* sem zoom automático no iPhone */
    color: var(--pre-texto);
}
.ac1-pre textarea { resize: vertical; min-height: 64px; }
.ac1-pre input:focus, .ac1-pre select:focus, .ac1-pre textarea:focus {
    outline: none;
    border-color: var(--pre-cor);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}
.ac1-pre [aria-invalid="true"] { border-color: #dc2626 !important; }

.ac1-pre__grupo { border: 0; padding: 0; margin: 14px 0 12px; }
.ac1-pre__grupo legend { font-size: 0.9rem; font-weight: 600; margin-bottom: 8px; padding: 0; }

.ac1-pre__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ac1-pre__chip { position: relative; cursor: pointer; }
.ac1-pre__chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ac1-pre__chip span {
    display: inline-block;
    padding: 9px 14px;
    border: 1.5px solid var(--pre-borda);
    border-radius: 999px;
    font-size: 0.9rem;
    background: #fff;
}
.ac1-pre__chip input:checked + span { border-color: var(--pre-cor); background: var(--pre-cor); color: #fff; }
.ac1-pre__chip input:focus-visible + span { outline: 3px solid var(--pre-cor-2); outline-offset: 2px; }

.ac1-pre__atalhos { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 12px; }
.ac1-pre__atalho {
    border: 1px dashed var(--pre-cor);
    background: transparent;
    color: var(--pre-cor);
    border-radius: 999px;
    padding: 6px 11px;
    font: inherit;
    font-size: 0.82rem;
    cursor: pointer;
}

.ac1-pre__check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.86rem; line-height: 1.4; margin-bottom: 10px; }
.ac1-pre__check input { margin-top: 3px; width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--pre-cor); }
.ac1-pre__check a { color: var(--pre-cor); }

.ac1-pre__erro { min-height: 1.2em; color: #b91c1c; font-size: 0.9rem; font-weight: 600; margin: 4px 0 8px; }

.ac1-pre__enviar {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 14px;
    border: 0;
    border-radius: 12px;
    background: var(--pre-cor);
    color: #fff;
    font: inherit;
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}
.ac1-pre__enviar:disabled { opacity: 0.7; cursor: wait; }
.ac1-pre__enviar:focus-visible { outline: 3px solid var(--pre-cor-2); outline-offset: 2px; }
.ac1-pre__wa { background: #1f9d55; }

.ac1-pre__alt {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 12px;
    border: 1.5px solid var(--pre-borda);
    border-radius: 12px;
    background: #fff;
    color: var(--pre-texto);
    font: inherit;
    cursor: pointer;
}

.ac1-pre__fuga { margin: 14px 0 0; text-align: center; font-size: 0.85rem; color: var(--pre-suave); }
.ac1-pre__fuga a { color: var(--pre-cor); font-weight: 600; }

.ac1-pre__pronto-titulo { font-size: 1.3rem; font-weight: 700; margin: 4px 0 6px; }
.ac1-pre__pronto-texto { margin: 0 0 16px; color: var(--pre-suave); line-height: 1.45; }

/* A janela da Política de Privacidade (script.js, z-index 9999) abre POR CIMA
   do formulário, sem tirar a família da página. */
html.ac1-pre-aberto .pv-modal { z-index: 10060; }

.ac1-pre__hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 520px) {
    .ac1-pre { padding: 0; align-items: flex-end; }
    .ac1-pre__caixa { max-width: none; max-height: 94vh; max-height: 94dvh; border-radius: 18px 18px 0 0; }
    .ac1-pre__grade { grid-template-columns: 1fr; }
    .ac1-pre__form, .ac1-pre__pronto { padding: 16px; }
    .ac1-pre__topo { padding: 18px 16px 16px; }
}

@media (prefers-reduced-motion: no-preference) {
    .ac1-pre__caixa { animation: ac1PreEntra 0.2s ease-out; }
}
/* Só o deslize, sem opacidade: com a aba em segundo plano a animação pode
   ficar parada no 1º quadro, e a caixa ficaria invisível. */
@keyframes ac1PreEntra { from { transform: translateY(12px); } to { transform: none; } }
