/**
 * Page Full - Public Form CSS
 * Visual moderno, responsivo e de alta conversão para o formulário personalizado.
 */

/* ==========================================================================
   Reset e compatibilidade para página dedicada de Formulário
   ========================================================================== */
body.sf-form-page-active {
    overflow-x: hidden;
}

/* Reset total de espaçamento e restrições de largura do tema na página de formulário */
body.sf-form-page-active .entry-content,
body.sf-form-page-active .wp-block-post-content,
body.sf-form-page-active main,
body.sf-form-page-active .wp-site-blocks,
body.sf-form-page-active article,
body.sf-form-page-active .wp-block-group {
    max-width: 100% !important;
    width: 100% !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    gap: 0 !important;
}

/* Remover espaço superior do rodapé quando na página de formulário */
body.sf-form-page-active .sf-footer,
.sf-form-section + .sf-footer,
.sf-form-section ~ .sf-footer {
    margin-top: 0 !important;
}

/* Ocultar títulos, cabeçalhos e rodapés nativos do tema na página de formulário */
body.sf-form-page-active .wp-block-post-title,
body.sf-form-page-active .entry-title,
body.sf-form-page-active .page-title,
body.sf-form-page-active header.entry-header,
body.sf-form-page-active .entry-header,
body.sf-form-page-active h1.single-title,
body.sf-form-page-active .wp-block-query-title,
body.sf-form-page-active footer.wp-block-template-part,
body.sf-form-page-active .wp-block-template-part-footer,
body.sf-form-page-active footer.site-footer,
body.sf-form-page-active .site-footer,
body.sf-form-page-active footer.wp-block-group {
    display: none !important;
}

/* Na página dedicada, garante altura mínima e alinhamento central */
body.sf-form-page-active .sf-form-section {
    min-height: calc(100vh - 160px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ==========================================================================
   Estrutura da Seção Formulário
   ========================================================================== */
.sf-form-section {
    width: 100%;
    max-width: 100%;
    margin: 0;
    position: relative;
    padding: 90px 20px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
    color: #ffffff;
    box-sizing: border-box;
}

.sf-form-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.sf-form-container {
    position: relative;
    z-index: 2;
    max-width: 920px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* Header centralizado do Formulário */
.sf-form-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 42px;
}

.sf-form-badge-wrap {
    margin-bottom: 18px;
}

.sf-form-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.22);
    padding: 7px 22px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: #f8fafc;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

.sf-form-title {
    font-size: 38px;
    line-height: 1.25;
    font-weight: 800;
    margin: 0 0 16px 0;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.sf-form-description {
    font-size: 17px;
    line-height: 1.7;
    margin: 0;
    max-width: 680px;
    opacity: 0.92;
}

/* Card Wrapper do Formulário */
.sf-form-card {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 20px;
    padding: 45px 40px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
}

/* Grid de Campos */
.sf-form-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px 18px;
}

.sf-form-col-12 {
    grid-column: span 12;
}

.sf-form-col-6 {
    grid-column: span 6;
}

.sf-form-field-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.sf-form-label {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.sf-form-required {
    color: #f43f5e;
    font-weight: 700;
}

/* Inputs, Textareas, Selects */
.sf-form-input,
.sf-form-textarea,
.sf-form-select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 14px 18px;
    font-size: 15px;
    border-radius: 10px;
    outline: none;
    transition: all 0.25s ease;
    box-sizing: border-box;
    font-family: inherit;
    line-height: 1.4;
    border: 1.5px solid transparent;
}

/* Correção completa de responsividade e alinhamento para inputs do tipo data (date) */
input[type="date"].sf-form-input {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    min-height: 49px;
    height: 49px;
    padding: 12px 18px;
    font-size: 15px;
    font-family: inherit;
    line-height: 1.4;
    text-align: left;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-sizing: border-box;
    position: relative;
}

/* Alinhamento à esquerda e normalização de altura no iOS Safari */
input[type="date"].sf-form-input::-webkit-date-and-time-value {
    text-align: left;
    min-height: 1.4em;
    height: 1.4em;
    line-height: 1.4;
    margin: 0;
    padding: 0;
    width: 100%;
    display: block;
}

/* Normalização de campos de edição de data no Chrome/Edge */
input[type="date"].sf-form-input::-webkit-datetime-edit {
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
}

input[type="date"].sf-form-input::-webkit-datetime-edit-fields-wrapper {
    padding: 0;
}

input[type="date"].sf-form-input::-webkit-datetime-edit-text,
input[type="date"].sf-form-input::-webkit-datetime-edit-month-field,
input[type="date"].sf-form-input::-webkit-datetime-edit-day-field,
input[type="date"].sf-form-input::-webkit-datetime-edit-year-field {
    padding: 0 1px;
}

/* Ícone de calendário no WebKit / Blink (Chrome, Edge, Opera) */
input[type="date"].sf-form-input::-webkit-calendar-picker-indicator {
    display: block;
    cursor: pointer;
    filter: invert(0.8);
    opacity: 0.8;
    padding: 0;
    margin: 0;
    width: 18px;
    height: 18px;
    transition: opacity 0.2s ease, filter 0.2s ease;
}

input[type="date"].sf-form-input::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    filter: invert(1);
}

.sf-form-input:focus,
.sf-form-textarea:focus,
.sf-form-select:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.25) !important;
}

.sf-form-input::placeholder,
.sf-form-textarea::placeholder {
    color: #94a3b8;
    opacity: 0.8;
}

.sf-form-textarea {
    resize: vertical;
    min-height: 120px;
}

.sf-form-select option {
    background: #1e293b;
    color: #ffffff;
}

/* Honeypot Antispam (Invisível) */
.sf-form-hp-field {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    left: -9999px !important;
}

/* Ações e Botão de Envio */
.sf-form-submit-wrap {
    grid-column: span 12;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 12px;
    gap: 16px;
}

.sf-form-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 42px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    line-height: 1.3;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    min-width: 220px;
}

.sf-form-submit-btn:hover {
    filter: brightness(1.12);
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
}

.sf-form-submit-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none !important;
}

.sf-form-btn-arrow {
    transition: transform 0.25s ease;
}

.sf-form-submit-btn:hover .sf-form-btn-arrow {
    transform: translateX(4px);
}

/* Spinner animado */
.sf-spin {
    animation: sf-spin-kf 1s infinite linear;
}

@keyframes sf-spin-kf {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notificações no Front-end */
.sf-form-notice {
    width: 100%;
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 14.5px;
    font-weight: 600;
    text-align: center;
    box-sizing: border-box;
    display: none;
    line-height: 1.5;
}

.sf-form-notice--success {
    background: rgba(34, 197, 94, 0.18);
    border: 1px solid #22c55e;
    color: #4ade80;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.15);
}

.sf-form-notice--error {
    background: rgba(239, 68, 68, 0.18);
    border: 1px solid #ef4444;
    color: #f87171;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.15);
}

/* Responsividade */
@media (max-width: 768px) {
    .sf-form-section {
        padding: 60px 16px;
    }

    .sf-form-card {
        padding: 30px 20px;
        border-radius: 16px;
    }

    .sf-form-col-6 {
        grid-column: span 12;
    }

    .sf-form-title {
        font-size: 28px;
    }

    .sf-form-description {
        font-size: 15px;
    }

    .sf-form-submit-btn {
        width: 100%;
        box-sizing: border-box;
    }

    /* Garante que o grid não cause overflow em nenhum filho */
    .sf-form-grid {
        overflow: hidden;
    }

    /* Correção mobile específica para input de data */
    input[type="date"].sf-form-input {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        padding-left: 14px;
        padding-right: 14px;
    }
}
