/* /css/public_questionnaire.css */
/* v4: Re-introduced a single container box and cleaned up stepper styles. */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');
@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css");


:root {
    --brand-primary: #F7CB18; 
    --brand-primary-darker: #e0b715; 
    --brand-secondary: #343a40; 
    --brand-light: #f8f9fa;    
    --brand-text-on-primary: #212529; 
    --verde-sucesso: #198754;
    --vermelho-erro: #dc3545;
    --cinza-medio: #dee2e6;
    --cinza-texto-secundario: #6c757d;
    --bs-body-font-family: 'Nunito', sans-serif;
}

.question-invalid {
    border-radius: 0.375rem; /* Match Bootstrap's border-radius */
    border: 2px solid var(--vermelho-erro);
    background-color: rgba(220, 53, 69, 0.05);
    padding: 1rem;
    margin: -1rem; /* Use negative margin to make the padding feel natural */
    animation: shake 0.5s;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* --- Body & New Layout --- */
body.questionnaire-body {
    font-family: var(--bs-body-font-family);
    background-color: #f4f6f8;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    line-height: 1.6;
    padding-top: 80px;
}

.questionnaire-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030; 
    padding: 0.75rem 0; 
    background-color: #ffffff00; 
    border-bottom: 0px solid var(--cinza-medio); 
}


.questionnaire-header .logo {
    max-height: 45px;
    width: auto;
}

.questionnaire-header .container-fluid {
    padding-left: 2rem;
    padding-right: 2rem;
    display: flex;
    justify-content: flex-end; 
}

/* --- Main Layout & Card Adjustments --- */
.public-questionnaire-container {
    max-width: 1200px; 
    flex-grow: 1;
    width: 100%;
}

.questionnaire-card {
    background-color: #ffffff;
    border: 1px solid var(--cinza-medio); 
    border-radius: 0.5rem; 
    box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.05); 
    overflow: hidden;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Stepper Navigation --- */
.stepper-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.25rem; 
    position: relative;
    padding: 0 5%; 
    background-color: #f8f9fa;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--cinza-medio);
}

.step.current .step-icon i {
    display: none;
}

.progress-container {
    display: none;
}

.stepper-container::before {
    content: '';
    position: absolute;
    top: 2.1rem; 
    left: 10%; 
    right: 10%;
    height: 2px;
    background-color: var(--cinza-medio); 
    z-index: 1;
}
.step {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--cinza-texto-secundario); 
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}
.step-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #fff; 
    border: 2px solid transparent; 
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.step-icon i {
    font-size: 0.9rem;
    color: var(--cinza-texto-secundario);
}
.step-label {
    font-size: 0.8rem;
    font-weight: 600;
}
.step.completed .step-icon {
    background-color: var(--verde-sucesso); 
    border-color: var(--verde-sucesso); 
}
.step.completed .step-icon i {
    color: #fff;
}
.step.completed .step-label {
    color: var(--verde-sucesso);
}
.step.current .step-icon {
    border-color: var(--brand-primary); 
    background-color: var(--brand-primary);
    transform: scale(1.1);
}
.step.current .step-icon i {
    color: var(--brand-text-on-primary);
}
.step.current .step-label {
    color: var(--brand-secondary); 
    font-weight: 800;
}

/* --- Progress Bar --- */
.progress-container {
    padding: 0 2rem;
    margin-bottom: 1rem;
}
.progress {
    height: 8px;
}
.progress-bar {
    background-color: var(--brand-primary);
    transition: width 0.4s ease-in-out;
}

/* --- Buttons --- */
.btn-primary {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    color: var(--brand-text-on-primary);
    font-weight: 700;
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--brand-primary-darker);
    border-color: var(--brand-primary-darker);
    color: var(--brand-text-on-primary);
}

/* --- Question & Answer Styling --- */
.question-lead-text {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.5;
}

.list-group-item {
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.list-group-item:hover {
    background-color: #f8f9fa;
}

/* --- Summary Page --- */
.summary-step h5 {
    color: var(--brand-secondary);
    font-weight: 700;
    border-bottom: 2px solid var(--brand-primary);
    padding-bottom: 0.5rem;
    margin-top: 1.5rem;
}
.summary-question {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
}
.summary-answer {
    font-size: 0.9rem;
    color: var(--cinza-texto-secundario);
    padding-left: 1rem;
    border-left: 3px solid #e9ecef;
}

/* --- Mobile Adjustments --- */
@media (max-width: 767.98px) { 
    .stepper-container {
        padding: 1rem 2%;
    }
    .stepper-container::before {
        left: 5%;
        right: 5%;
    }
    .step-label {
        display: none; 
    }
    .step-icon {
        width: 24px;
        height: 24px;
    }
}

.list-group-item {
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: grid;
    grid-template-columns: auto 1fr; 
    align-items: center;
    gap: 0.75rem; 
}

footer {
  background-color: #1a1a2e;
  color: #ccc;
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.85rem;
  margin-top: auto;
}

footer img {
  height: 48px;
  margin-bottom: 1rem;
}

footer p {
  line-height: 1.5;
  margin: 0;
}

/* --- Analysis Badge Colors --- */
.badge.badge-level-baixo {
    background-color: #198754; 
}
.badge.badge-level-medio {
    background-color: #ffc107;
    color: #000;
}
.badge.badge-level-alto {
    background-color: #dc3545; 
    color: #fff;
}

/* --- Final Invitation Step Styling --- */
.invite-box {
    background-color: var(--brand-light);
    border: 1px solid var(--cinza-medio);
    border-radius: 0.5rem;
    padding: 2.5rem 2rem;
    margin-top: 1rem;
    box-shadow: 0 0.25rem 2rem rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease-in-out;
}

.invite-icon {
    font-size: 3rem;
    color: var(--brand-primary);
    margin-bottom: 1rem;
}

.invite-box .lead {
    color: var(--cinza-texto-secundario);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

#newsletter-form .form-control-lg {
    font-size: 1rem;
    padding: 0.75rem 1rem;
}

#newsletter-form .btn-lg {
    padding: 0.75rem 1.5rem;
}

#newsletter-form .form-control-lg,
#newsletter-form .btn-lg {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.5rem;
}