/* =========================================================
   GERABOI — MODAL WHATSAPP
   Mobile-first
   ========================================================= */

.whatsapp_form__modal {
    position: fixed;
    inset: 0;
    z-index: 9999;

    display: none;
    align-items: flex-end;
    justify-content: center;

    width: 100%;
    height: 100%;

    padding: 0;

    background: rgba(5, 24, 20, .68);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);

    overflow-y: auto;
    overscroll-behavior: contain;
}

/* Quando seu JS usar style="display:block" */
.whatsapp_form__modal[style*="display: block"] {
    display: flex !important;
}


/* =========================================================
   CONTEÚDO
   ========================================================= */

.whatsapp_form__modal-content {
    position: relative;

    width: 100%;
    max-height: 92dvh;

    overflow-y: auto;

    padding: 24px 18px
    calc(22px + env(safe-area-inset-bottom));

    border: 1px solid rgba(18, 63, 54, .08);
    border-radius: 22px 22px 0 0;

    background: #ffffff;

    color: #142d28;

    box-shadow:
            0 -18px 60px rgba(5, 24, 20, .24);

    animation: whatsappModalUp .22s ease-out;
}


/* Barra visual mobile */

.whatsapp_form__modal-content::before {
    content: "";

    display: block;

    width: 42px;
    height: 4px;

    margin: -10px auto 18px;

    border-radius: 999px;

    background: #d7dfdb;
}


/* =========================================================
   BOTÃO FECHAR
   ========================================================= */

.whatsapp_form__modal-content > button:first-child,
.whatsapp_form__close,
.whatsapp_form__modal-close {
    position: absolute;

    top: 14px;
    right: 14px;

    width: 42px;
    height: 42px;

    display: grid;
    place-items: center;

    padding: 0;

    border: 1px solid #e2e8e4;
    border-radius: 12px;

    background: #f5f7f5;

    color: #123f36;

    cursor: pointer;

    transition:
            background 160ms ease,
            color 160ms ease,
            transform 160ms ease;
}

.whatsapp_form__modal-content > button:first-child:hover,
.whatsapp_form__close:hover,
.whatsapp_form__modal-close:hover {
    background: #123f36;
    color: #ffffff;

    transform: rotate(3deg);
}

.whatsapp_form__modal-content > button:first-child svg,
.whatsapp_form__close svg,
.whatsapp_form__modal-close svg {
    width: 19px;
    height: 19px;
}


/* =========================================================
   CABEÇALHO
   ========================================================= */

.whatsapp_form__modal h2,
.whatsapp_form__modal h3 {
    max-width: calc(100% - 52px);

    margin: 0 0 6px;

    color: #123f36;

    font-size: 1.25rem;
    font-weight: 850;
    line-height: 1.2;

    letter-spacing: -.025em;
}

.whatsapp_form__modal p {
    margin: 0 0 20px;

    color: #6d7c76;

    font-size: .78rem;
    line-height: 1.55;
}


/* =========================================================
   ÍCONE WHATSAPP
   ========================================================= */

.whatsapp_form__icon {
    width: 48px;
    height: 48px;

    display: grid;
    place-items: center;

    margin-bottom: 14px;

    border-radius: 14px;

    background: #e9f8ef;

    color: #1f9d55;
}

.whatsapp_form__icon svg {
    width: 24px;
    height: 24px;
}


/* =========================================================
   FORMULÁRIO
   ========================================================= */

.whatsapp_form__modal form {
    display: grid;

    gap: 14px;
}

.whatsapp_form__group {
    min-width: 0;
}

.whatsapp_form__modal label {
    display: block;

    margin-bottom: 6px;

    color: #142d28;

    font-size: .72rem;
    font-weight: 800;
}

.whatsapp_form__modal input,
.whatsapp_form__modal select,
.whatsapp_form__modal textarea {
    width: 100%;
    min-height: 46px;

    padding: 10px 12px;

    border: 1px solid #dfe7e2;
    border-radius: 11px;

    outline: none;

    background: #fbfcfb;

    color: #142d28;

    font: inherit;
    font-size: .82rem;

    transition:
            border-color 160ms ease,
            box-shadow 160ms ease,
            background 160ms ease;
}

.whatsapp_form__modal textarea {
    min-height: 105px;

    resize: vertical;
}

.whatsapp_form__modal input::placeholder,
.whatsapp_form__modal textarea::placeholder {
    color: #9aa6a1;
}

.whatsapp_form__modal input:focus,
.whatsapp_form__modal select:focus,
.whatsapp_form__modal textarea:focus {
    border-color: #557f70;

    background: #ffffff;

    box-shadow:
            0 0 0 3px rgba(18, 63, 54, .09);
}


/* =========================================================
   BOTÃO ENVIAR
   ========================================================= */

.whatsapp_form__submit,
.whatsapp_form__modal button[type="submit"] {
    width: 100%;
    min-height: 48px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 9px;

    margin-top: 3px;

    padding: 0 18px;

    border: 0;
    border-radius: 12px;

    background: #1f9d55;

    color: #ffffff;

    font-size: .8rem;
    font-weight: 850;

    cursor: pointer;

    box-shadow:
            0 8px 20px rgba(31, 157, 85, .18);

    transition:
            background 160ms ease,
            transform 160ms ease,
            box-shadow 160ms ease;
}

.whatsapp_form__submit:hover,
.whatsapp_form__modal button[type="submit"]:hover {
    background: #178447;

    transform: translateY(-1px);

    box-shadow:
            0 11px 24px rgba(31, 157, 85, .23);
}

.whatsapp_form__submit svg,
.whatsapp_form__modal button[type="submit"] svg {
    width: 19px;
    height: 19px;
}


/* =========================================================
   TEXTO AUXILIAR
   ========================================================= */

.whatsapp_form__help {
    display: flex;
    align-items: flex-start;

    gap: 8px;

    padding: 10px 12px;

    border-radius: 10px;

    background: #f1f6f3;

    color: #61716a;

    font-size: .69rem;
    line-height: 1.45;
}

.whatsapp_form__help svg {
    width: 15px;
    height: 15px;

    flex: 0 0 15px;

    margin-top: 2px;

    color: #123f36;
}


/* =========================================================
   ANIMAÇÃO
   ========================================================= */

@keyframes whatsappModalUp {

    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* =========================================================
   TABLET / DESKTOP
   ========================================================= */

@media (min-width: 576px) {

    .whatsapp_form__modal {
        align-items: center;

        padding: 24px;
    }

    .whatsapp_form__modal-content {
        width: min(100%, 480px);

        max-height: calc(100dvh - 48px);

        padding: 28px;

        border-radius: 20px;

        box-shadow:
                0 28px 80px rgba(5, 24, 20, .28);

        animation: whatsappModalDesktop .2s ease-out;
    }

    .whatsapp_form__modal-content::before {
        display: none;
    }

    .whatsapp_form__modal-content > button:first-child,
    .whatsapp_form__close,
    .whatsapp_form__modal-close {
        top: 16px;
        right: 16px;
    }

    .whatsapp_form__modal h2,
    .whatsapp_form__modal h3 {
        font-size: 1.4rem;
    }
}


@keyframes whatsappModalDesktop {

    from {
        opacity: 0;
        transform: translateY(10px) scale(.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* =========================================================
   ACESSIBILIDADE
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .whatsapp_form__modal-content {
        animation: none;
    }

    .whatsapp_form__modal *,
    .whatsapp_form__modal *::before,
    .whatsapp_form__modal *::after {
        transition: none !important;
    }
}