/* Pre-formulario nativo de WhatsApp (_WhatsAppPreForm.cshtml). Sem dependencia de Bootstrap JS. */
#wpp-preform {
    --wpp-green: #25d366;
    --wpp-green-dark: #128c7e;
    --wpp-header: #075e54;
    --wpp-text: #1f2937;
    --wpp-muted: #5b6472;
    --wpp-border: #cfd6dd;
    --wpp-error: #b42318;
    font-family: inherit;
    color: var(--wpp-text);
}

#wpp-preform [hidden] { display: none !important; }

/* ---------- botao flutuante ---------- */
.wpp-fab {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1040;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    min-height: 56px;
    padding: 0 1.1rem 0 .9rem;
    border: 0;
    border-radius: 999px;
    background: var(--wpp-green-dark);
    color: #fff;
    font: 600 .95rem/1 inherit;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .28);
    cursor: pointer;
    transition: transform .15s ease, background-color .15s ease;
}
.wpp-fab:hover { background: #0e7a6e; transform: translateY(-1px); }
.wpp-fab:focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 5px var(--wpp-header); }
.wpp-fab__icon { flex: none; }

@media (max-width: 575.98px) {
    .wpp-fab { right: 14px; bottom: 14px; padding: 0; width: 56px; justify-content: center; }
    .wpp-fab__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---------- fundo e dialogo ---------- */
.wpp-backdrop { position: fixed; inset: 0; z-index: 1050; background: rgba(0, 0, 0, .45); }

.wpp-dialog {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1060;
    width: min(400px, calc(100vw - 24px));
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(0, 0, 0, .35);
}

.wpp-dialog__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .9rem 1rem;
    background: var(--wpp-header);
    color: #fff;
}
.wpp-dialog__title { margin: 0; font-size: 1.05rem; font-weight: 600; line-height: 1.3; color: #fff; }
.wpp-dialog__close {
    flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px;
    border: 0; border-radius: 50%;
    background: transparent; color: #fff; cursor: pointer;
}
.wpp-dialog__close:hover { background: rgba(255, 255, 255, .15); }
.wpp-dialog__close:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }

.wpp-dialog__body { padding: 1rem; overflow-y: auto; background: #f7f5f1; }

.wpp-intro { margin: 0 0 .9rem; font-size: .9rem; color: var(--wpp-muted); }

/* ---------- campos ---------- */
.wpp-field { margin-bottom: .8rem; }
.wpp-row { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
@media (max-width: 400px) { .wpp-row { grid-template-columns: 1fr; } }

.wpp-field label { display: block; margin-bottom: .25rem; font-size: .85rem; font-weight: 600; }
.wpp-field input[type="text"],
.wpp-field input[type="email"],
.wpp-field input[type="tel"],
.wpp-field select {
    width: 100%;
    min-height: 44px;
    padding: .55rem .7rem;
    border: 1.5px solid var(--wpp-border);
    border-radius: 8px;
    background: #fff;
    color: var(--wpp-text);
    font: 400 1rem/1.3 inherit; /* 16px evita zoom automatico do iOS */
}
.wpp-field input:focus-visible,
.wpp-field select:focus-visible { outline: 3px solid rgba(7, 94, 84, .35); outline-offset: 0; border-color: var(--wpp-header); }
.wpp-field [aria-invalid="true"] { border-color: var(--wpp-error); }

.wpp-error { min-height: 0; margin-top: .2rem; font-size: .8rem; color: var(--wpp-error); }
.wpp-error:empty { display: none; }

.wpp-field--check { display: grid; grid-template-columns: auto 1fr; column-gap: .55rem; align-items: start; }
.wpp-field--check input { width: 20px; height: 20px; margin-top: .1rem; }
.wpp-field--check label { margin: 0; font-weight: 400; font-size: .85rem; }
.wpp-field--check .wpp-error { grid-column: 1 / -1; }
.wpp-field--check a { color: var(--wpp-header); text-decoration: underline; }

/* ---------- botoes e estados ---------- */
.wpp-submit {
    display: block; width: 100%;
    min-height: 48px;
    padding: .7rem 1rem;
    border: 0; border-radius: 8px;
    background: #1a9d4a; /* contraste 4.5:1 com texto branco */
    color: #fff;
    font: 700 1rem/1.2 inherit;
    text-align: center; text-decoration: none;
    cursor: pointer;
}
.wpp-submit:hover { background: #148a3f; }
.wpp-submit:focus-visible { outline: 3px solid var(--wpp-header); outline-offset: 2px; }
.wpp-submit[disabled] { opacity: .65; cursor: progress; }
.wpp-submit--link { margin-top: .9rem; }

.wpp-status { margin: 0 0 .7rem; font-size: .9rem; }
.wpp-status:empty { display: none; }
.wpp-status--error { padding: .6rem .7rem; border: 1px solid #f1b5af; border-radius: 8px; background: #fdecea; color: var(--wpp-error); }
.wpp-status--error a { color: var(--wpp-error); font-weight: 700; text-decoration: underline; }

.wpp-legal { margin: .6rem 0 0; font-size: .78rem; color: var(--wpp-muted); text-align: center; }

.wpp-success { text-align: center; padding: .5rem .25rem; }
.wpp-success h3 { margin: 0 0 .4rem; font-size: 1.2rem; color: var(--wpp-header); }
.wpp-success p { margin: 0; font-size: .92rem; }

/* Bloqueia a rolagem da pagina atras do dialogo aberto */
body.wpp-open { overflow: hidden; }

/* Mobile: dialogo vira "bottom sheet" */
@media (max-width: 575.98px) {
    .wpp-dialog { right: 0; left: 0; bottom: 0; width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0; }
}

@media (prefers-reduced-motion: no-preference) {
    .wpp-dialog { animation: wpp-in .18s ease-out; }
    @keyframes wpp-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
    .wpp-fab { transition: none; }
}

/* ---------- orientacao para quem busca holerite/folha (opcao em "Principal interesse") ---------- */
.wpp-colab { margin-top: .5rem; padding: .65rem .75rem; border: 1px solid #9ec5e8; border-radius: 8px; background: #eaf4fd; font-size: .85rem; color: #17415f; }
.wpp-colab strong { display: block; margin-bottom: .15rem; }
