/* QPF - Questionário Pré-Consulta para Familiares - v1.0.4 */

/* Container Principal */
.qpf-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    background-color: #FEFEFE;
}

/* Cabeçalho */
.qpf-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    border-radius: 10px;
    color: white;
}

.qpf-header h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 600;
}

.qpf-subtitle {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 15px;
}

.qpf-instructions {
    font-size: 14px;
    line-height: 1.6;
    opacity: 0.95;
    max-width: 700px;
    margin: 0 auto 15px auto;
}

.qpf-important {
    background-color: rgba(255, 255, 255, 0.15);
    padding: 15px;
    border-radius: 8px;
    font-size: 13px;
    margin-top: 15px;
}

/* Barra de Progresso */
.qpf-progress-container {
    margin-bottom: 25px;
    text-align: center;
}

.qpf-progress-bar {
    width: 100%;
    height: 10px;
    background-color: #E8E0D5;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.qpf-progress {
    height: 100%;
    background: linear-gradient(90deg, #8B4513 0%, #D4A574 100%);
    border-radius: 5px;
    transition: width 0.4s ease;
}

.qpf-progress-text {
    font-size: 14px;
    color: #666;
}

/* Seções */
.qpf-section {
    display: none;
    background-color: #FFF;
    border: 1px solid #E0D5C5;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.qpf-section.active {
    display: block;
}

.qpf-section h3 {
    color: #8B4513;
    font-size: 22px;
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #D4A574;
}

.qpf-section h4 {
    color: #A0522D;
    font-size: 18px;
    margin: 25px 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #E8E0D5;
}

.qpf-section-instructions {
    background-color: #FFF8DC;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.6;
    border-left: 4px solid #D4A574;
}

.qpf-subsection {
    margin-bottom: 25px;
}

/* Legenda da Escala */
.qpf-scale-legend {
    background-color: #F5F0E8;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 25px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.qpf-scale-legend strong {
    color: #8B4513;
    margin-right: 10px;
}

.qpf-scale-legend span {
    background-color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    border: 1px solid #E0D5C5;
}

/* Campos de Formulário */
.qpf-field {
    margin-bottom: 20px;
}

.qpf-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
}

.qpf-field input[type="text"],
.qpf-field input[type="email"],
.qpf-field textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #D4A574;
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}

.qpf-field input[type="text"]:focus,
.qpf-field input[type="email"]:focus,
.qpf-field textarea:focus {
    outline: none;
    border-color: #8B4513;
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

.qpf-field textarea {
    resize: vertical;
    min-height: 100px;
}

/* Grupo de Radio */
.qpf-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.qpf-radio-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
    padding: 8px 15px;
    background-color: #F5F0E8;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.qpf-radio-group label:hover {
    background-color: #E8E0D5;
}

.qpf-radio-group input[type="radio"] {
    margin-right: 8px;
    accent-color: #8B4513;
}

/* Questões */
.qpf-question {
    background-color: #FAFAFA;
    padding: 18px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #E8E0D5;
}

.qpf-question > label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: #444;
    line-height: 1.5;
}

/* Exemplos didáticos */
.qpf-exemplo {
    background-color: #FFF8DC;
    padding: 10px 15px;
    border-radius: 6px;
    margin: 0 0 12px 0;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    border-left: 3px solid #D4A574;
    font-style: italic;
}

.qpf-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.qpf-options label {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    background-color: white;
    border: 1px solid #D4A574;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.qpf-options label:hover {
    background-color: #FFF8DC;
    border-color: #8B4513;
}

.qpf-options input[type="radio"] {
    margin-right: 6px;
    accent-color: #8B4513;
}

.qpf-options input[type="radio"]:checked + span,
.qpf-options label:has(input[type="radio"]:checked) {
    background-color: #8B4513;
    color: white;
    border-color: #8B4513;
}

/* Opções com descrições completas */
.qpf-options-desc {
    flex-direction: column;
    gap: 8px;
}

.qpf-options-desc label {
    width: 100%;
    padding: 10px 15px;
    font-size: 14px;
    justify-content: flex-start;
}

.qpf-options-desc label:hover {
    background-color: #FFF8DC;
    border-color: #8B4513;
}

.qpf-options-desc input[type="radio"] {
    margin-right: 10px;
    flex-shrink: 0;
}

/* Desktop: mostrar opções em linha quando possível */
@media (min-width: 769px) {
    .qpf-options-desc {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .qpf-options-desc label {
        width: auto;
        flex: 1 1 auto;
        min-width: fit-content;
        text-align: center;
        justify-content: center;
    }
}

/* Navegação */
.qpf-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #E8E0D5;
    gap: 15px;
}

/* Botões */
.qpf-btn {
    padding: 14px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.qpf-btn-prev {
    background-color: #E8E0D5;
    color: #666;
}

.qpf-btn-prev:hover {
    background-color: #D4A574;
    color: white;
}

.qpf-btn-next {
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    color: white;
    margin-left: auto;
}

.qpf-btn-next:hover {
    background: linear-gradient(135deg, #A0522D 0%, #8B4513 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
}

.qpf-btn-submit {
    background: linear-gradient(135deg, #228B22 0%, #2E8B57 100%);
    color: white;
    margin-left: auto;
}

.qpf-btn-submit:hover {
    background: linear-gradient(135deg, #2E8B57 0%, #228B22 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 139, 34, 0.3);
}

/* Loading */
#qpf-loading {
    text-align: center;
    padding: 50px;
}

.qpf-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #E8E0D5;
    border-top: 4px solid #8B4513;
    border-radius: 50%;
    animation: qpf-spin 1s linear infinite;
    margin: 0 auto 20px auto;
}

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

/* Resultado */
.qpf-resultado-container {
    background-color: #FFF;
    border: 1px solid #E0D5C5;
    border-radius: 10px;
    padding: 30px;
}

.qpf-resultado-container h2 {
    color: #228B22;
    text-align: center;
    margin-bottom: 20px;
}

.qpf-resultado-intro {
    text-align: center;
    font-size: 16px;
    color: #666;
    margin-bottom: 25px;
}

.qpf-resultado-info {
    background-color: #F5F0E8;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.qpf-resultado-info p {
    margin: 8px 0;
}

.qpf-resultado-resumo h3 {
    color: #8B4513;
    border-bottom: 2px solid #D4A574;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.qpf-resultado-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.qpf-resultado-card {
    background-color: #FFF8DC;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #D4A574;
}

.qpf-resultado-card h4 {
    color: #8B4513;
    margin: 0 0 15px 0;
    font-size: 16px;
}

.qpf-score {
    font-size: 28px;
    font-weight: bold;
    color: #8B4513;
    margin: 10px 0;
}

.qpf-interpretacao {
    font-size: 14px;
    color: #666;
    font-style: italic;
}

.qpf-resultado-aviso {
    background-color: #FFF3CD;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #FFC107;
    font-size: 14px;
}

/* Responsivo */
@media (max-width: 768px) {
    .qpf-container {
        padding: 10px;
    }
    
    .qpf-header {
        padding: 20px;
    }
    
    .qpf-header h2 {
        font-size: 22px;
    }
    
    .qpf-section {
        padding: 20px;
    }
    
    .qpf-scale-legend {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .qpf-options {
        flex-direction: column;
    }
    
    .qpf-options label {
        width: 100%;
        justify-content: flex-start;
    }
    
    .qpf-navigation {
        flex-direction: column;
    }
    
    .qpf-btn {
        width: 100%;
        text-align: center;
    }
    
    .qpf-btn-next,
    .qpf-btn-submit {
        margin-left: 0;
    }
    
    .qpf-radio-group {
        flex-direction: column;
    }
    
    .qpf-radio-group label {
        width: 100%;
    }
}
