/* ==========================================================================
   CSS DA PÁGINA DE PESQUISA (RESPONSIVO MESTRE: PC ESPAÇOSO / MOBILE ESTICADO)
   ========================================================================== */

:root {
    --text-dark: #2B313B;
    --text-muted: #8A98AC;
    --bg-card: #FFFFFF;
    --border-soft: #E6E9F0;
    --green-btn: #38A169;
    --hover-green: #218838;
}

/* RESET GLOBAL */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Montserrat', sans-serif; 
}

/* ==========================================================================
   LAYOUT BASE (PC E TABLETS GRANDES - ESPAÇOSO E CENTRALIZADO)
   ========================================================================== */
body {
    min-height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden; /* Evita rolagem horizontal, mas permite vertical se a tela for minúscula */
}

.survey-container { 
    width: 100%; 
    max-width: 480px; /* Um pouco mais largo no PC fica mais elegante */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.survey-card {
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* HEADER E LOGO (PC) */
.survey-header {
    text-align: center;
    padding: 40px 30px 10px 30px;
}

.logo-box-rect {
    width: 100%;
    max-width: 250px; 
    height: 90px; /* Logo grande no PC */
    margin: 0 auto; 
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-box-rect img { 
    max-width: 100%; 
    max-height: 100%; 
    object-fit: contain; 
}

/* CORPO (PC) */
.survey-body { 
    padding: 10px 40px 40px 40px;
    display: flex;
    flex-direction: column;
}

.pt-30 { padding-top: 30px !important; }

.question-title { 
    font-size: 16px; 
    font-weight: 700; 
    color: var(--text-dark); 
    text-align: center; 
    line-height: 1.4; 
    margin-bottom: 20px; 
}

.req { color: #E53E3E; }

/* ESCALA NPS (PC) */
.nps-scale { 
    display: flex; 
    flex-wrap: nowrap; 
    justify-content: space-between; 
    gap: 4px; 
    margin-bottom: 10px; 
}

.nps-box { 
    flex: 1 1 0; 
    min-width: 0;
    position: relative; 
    cursor: pointer; 
}

.nps-box input { position: absolute; opacity: 0; }

.nps-box span {
    display: flex; align-items: center; justify-content: center;
    height: 48px; border: 1px solid #D1D5DB; border-radius: 6px;
    font-size: 16px; font-weight: 600; color: #4A5568; 
    background-color: #FAFAFA; transition: all 0.2s;
}

.nps-box:hover span { background-color: #EDF2F7; }

/* Cores das Notas */
.nps-box input[value="0"]:checked + span, .nps-box input[value="1"]:checked + span,
.nps-box input[value="2"]:checked + span, .nps-box input[value="3"]:checked + span,
.nps-box input[value="4"]:checked + span, .nps-box input[value="5"]:checked + span,
.nps-box input[value="6"]:checked + span { background-color: #E53E3E; border-color: #E53E3E; color: #FFF; }

.nps-box input[value="7"]:checked + span, .nps-box input[value="8"]:checked + span { background-color: #DD6B20; border-color: #DD6B20; color: #FFF; }

.nps-box input[value="9"]:checked + span, .nps-box input[value="10"]:checked + span { background-color: #38A169; border-color: #38A169; color: #FFF; }

.nps-labels { 
    display: flex; justify-content: space-between; font-size: 11px; 
    font-weight: 700; color: #A0AEC0; letter-spacing: 0.5px; 
}

/* INFLUENCIADORES (PC) */
.influenciadores-section { margin-top: 10px; }
.divider { border: 0; height: 1px; background: var(--border-soft); margin: 25px 0; }
.influenciadores-grid { display: flex; flex-direction: column; gap: 12px; }

.inf-btn { position: relative; cursor: pointer; }
    
.inf-btn input { position: absolute; opacity: 0; }
    
.inf-content {
    display: flex; align-items: center; gap: 15px; padding: 14px 20px; 
    border: 1px solid #D1D5DB; border-radius: 8px; font-size: 15px; 
    font-weight: 600; color: #4A5568; transition: 0.2s; height: 100%;
}

.inf-content i { font-size: 20px; color: #F6AD55; }
    
.inf-btn input:checked + .inf-content { 
    border-color: var(--green-btn); box-shadow: 0 0 0 1px var(--green-btn); 
    color: var(--text-dark); background-color: #F0FFF4;
}

/* BOTÕES E FORM (PC) */
.btn-submit {
    width: 100%; padding: 16px; margin-top: 25px; background-color: var(--green-btn); 
    color: #FFF; border: none; border-radius: 8px; font-size: 16px; font-weight: 700;
    cursor: pointer; transition: 0.2s;
}
.btn-submit:disabled { background-color: #CBD5E0; cursor: not-allowed; }
.btn-submit:not(:disabled):hover { background-color: var(--hover-green); }

.feedback-header { margin-bottom: 20px; }
.form-group { margin-bottom: 16px; display: flex; flex-direction: column; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--text-dark); margin-bottom: 6px; }
.form-group input, .form-group textarea {
    width: 100%; padding: 14px 15px; border: 1px solid #D1D5DB; border-radius: 8px;
    font-size: 14px; font-family: 'Montserrat', sans-serif; color: var(--text-dark); transition: 0.2s; resize: none;
}
.form-group input:focus, .form-group textarea:focus { 
    outline: none; border-color: var(--green-btn); box-shadow: 0 0 0 3px rgba(56, 161, 105, 0.15); 
}
.error-msg { color: #E53E3E; font-size: 12px; font-weight: 500; margin-top: 4px; display: none; }
.input-error { border-color: #E53E3E !important; box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.15) !important; }

/* TOAST */
#toast {
    visibility: hidden; min-width: 250px; background-color: var(--bg-card); color: var(--text-dark); text-align: center;
    border-radius: 8px; padding: 16px 24px; position: fixed; z-index: 9999; left: 50%; bottom: 30px; transform: translateX(-50%);
    box-shadow: 0 10px 40px rgba(0,0,0,0.15); display: flex; align-items: center; justify-content: center; gap: 12px;
    font-size: 14px; font-weight: 600; opacity: 0; transition: opacity 0.3s, bottom 0.3s;
}
#toast.show { visibility: visible; opacity: 1; bottom: 50px; }


/* ==========================================================================
   MODO MOBILE (SMARTPHONES) - O "ESTICAMENTO" INTELIGENTE ZERO SCROLL
   ========================================================================== */
@media (max-width: 768px) {
    body {
        padding: 10px;
        overflow: hidden; /* Trava o scroll global */
        position: fixed; /* Evita o "bounce" na tela do iPhone */
    }

    .survey-container { 
        height: 100%; /* Usa 100% da tela */
        max-height: 100%; 
        padding-bottom: env(safe-area-inset-bottom); /* Suporte para a barra preta do iPhone */
    }

    .survey-card {
        height: 100%; /* O Card ESTICA para ocupar toda a tela de ponta a ponta */
        justify-content: space-between; /* Mantém a logo no topo e o resto espalhado */
    }

    .survey-header {
        padding: 25px 15px 5px 15px; 
        flex-shrink: 0; /* Impede do cabeçalho amassar */
    }

    .logo-box-rect {
        height: 75px; /* Aumentamos BEM a logo no mobile! */    
    }

    .survey-body { 
        padding: 5px 20px 20px 20px; 
        flex-grow: 1; /* Ocupa todo o restante do espaço esticado */
        display: flex;
        flex-direction: column;
        justify-content: space-evenly; /* O Segredo: distribui as margens em branco por igual */
    }

    .question-title { 
        font-size: 15px; /* Fonte levemente maior para melhor leitura */
        margin-bottom: 5px; 
    }

    .nps-box span {
        height: 42px; /* Botões de nota mais gordinhos pro dedão */
        font-size: 15px; 
    }

    .nps-labels { 
        font-size: 9px; 
    }

    .divider { 
        margin: 10px 0; 
    }

    .influenciadores-grid { 
        gap: 12px; /* Mais espaço entre as influências pra preencher a tela */
    }

    .inf-content {
        padding: 12px 18px; /* Mais esticado */
        font-size: 14px; /* Letra maior para os influenciadores no mobile */
    }

    .btn-submit {
        padding: 16px; 
        margin-top: 10px; 
        font-size: 15px;
        flex-shrink: 0; /* Impede que o botão final amasse */
    }
}

/* Ajuste Fino para telas super pequenas (iPhone SE) para não bugar */
@media (max-width: 370px) {
    .nps-scale { gap: 1px; }
    .nps-box span { font-size: 13px; height: 38px; }
    .question-title { font-size: 14px; }
    .inf-content { font-size: 13px; padding: 10px; }
    .logo-box-rect { height: 60px; }
}