/*
 * As cores aqui espelham manualmente os design tokens do tema
 * (theme/assets/css/tokens.css). O plugin não depende do tema para
 * funcionar, então os valores são hardcoded — se a paleta da marca
 * mudar um dia, precisa atualizar aqui também.
 */

*,
*::before,
*::after {
    box-sizing: border-box;
}

.prm-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(14, 42, 71, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.25s ease;
    padding: 16px;
    font-family: 'Archivo', sans-serif;
}

.prm-overlay[hidden] {
    display: none;
}

.prm-overlay.is-open {
    opacity: 1;
}

.prm-modal {
    position: relative;
    background: #ffffff;
    color: #3C4247;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 24px 48px rgba(14, 42, 71, 0.25);
    transform: translateY(16px) scale(0.98);
    transition: transform 0.25s ease;
}

.prm-modal__scroll {
    max-height: inherit;
    overflow-y: auto;
    padding: 32px;
}

.prm-overlay.is-open .prm-modal {
    transform: translateY(0) scale(1);
}

.prm-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #0E2A47;
    cursor: pointer;
}

.prm-modal__close:hover,
.prm-modal__close:focus-visible {
    background: rgba(14, 42, 71, 0.06);
}

.prm-modal__titulo {
    font-size: 24px;
    font-weight: 900;
    margin: 0 0 4px;
    color: #0E2A47;
}

.prm-modal__subtitulo {
    font-size: 14px;
    margin: 0 0 24px;
    color: #7C868D;
}

.prm-aviso {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #fdecea;
    border: 1px solid #C0392B;
    color: #C0392B;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.prm-aviso__icone {
    flex-shrink: 0;
    margin-top: 1px;
}

.prm-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.prm-campo {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.prm-campo label {
    font-size: 13px;
    font-weight: 600;
    color: #0E2A47;
}

.prm-campo input[type="text"],
.prm-campo input[type="tel"] {
    font-size: 15px;
    color: #3C4247;
    background: #ffffff;
    border: 2px solid #E4E7EA;
    padding: 10px 12px;
    transition: border-color 0.15s ease;
}

.prm-campo input[type="text"]:focus-visible,
.prm-campo input[type="tel"]:focus-visible {
    outline: none;
    border-color: #0E2A47;
}

/* Campo com erro: borda na cor do aviso, além do texto (não depende só de cor). */
.prm-campo input[aria-invalid="true"] {
    border-color: #C0392B;
}

.prm-erro {
    font-size: 12px;
    color: #C0392B;
    min-height: 14px;
}

.prm-campo--feedback {
    font-size: 14px;
    font-weight: 600;
    color: #0E2A47;
}

.prm-campo--feedback:empty {
    display: none;
}

.prm-btn-enviar {
    background: #1F6F3D;
    color: #ffffff;
    border: none;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background 0.15s ease;
}

.prm-btn-enviar:hover {
    background: #17552F;
}

.prm-btn-enviar:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-height: 700px) {
    .prm-overlay {
        align-items: flex-start;
        padding: 8vh 16px;
    }

    .prm-modal {
        max-height: calc(100dvh - 16vh);
    }
}

@media (max-width: 480px) {
    .prm-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .prm-modal {
        width: 100%;
        max-width: 100%;
        max-height: 92dvh;
    }

    .prm-modal__scroll {
        padding: 24px 20px 20px;
    }
}