/* =============================================================
   Sondage — Frontend styles (matches election-vote.css)
   ============================================================= */

.sondage-wrapper {
    max-width: 800px;
    margin: 2rem auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ---- Messages ---- */
.sondage-message {
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem auto;
    max-width: 600px;
    font-size: 1rem;
    line-height: 1.6;
}

.sondage-message--success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.sondage-message--info {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.sondage-message--disallowed {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* ---- Title ---- */
.sondage-wrapper .sondage-titre {
    display: block;
    margin-bottom: 1rem;
    font-size: 1.5rem !important;
    font-weight: 600;
    color: #222;
}

/* ---- Progress bar ---- */
.sondage-progress {
    background: #e5e5e5;
    border-radius: 4px;
    height: 6px;
    margin-bottom: 8px;
    overflow: hidden;
}

.sondage-progress-bar {
    background: #097ec1;
    height: 100%;
    width: 0;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.sondage-step-label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 1.5rem;
}

/* ---- Section (fieldset, legend overlaps border like election) ---- */
.sondage-wrapper .sondage-step {
    background: #fafbfc;
    border: 1px solid #bdbdbd;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    min-width: 0;
}

.sondage-wrapper .sondage-step legend.sondage-section-titre {
    font-size: 1.1rem;
    font-weight: normal;
    color: #222;
    padding: 0 0.5rem;
    margin-bottom: 0;
    float: none;
    width: auto;
}

/* ---- Question card ---- */
.sondage-question {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.8rem;
}

.sondage-question--error {
    border-color: #f5c6cb;
    background-color: #fff8f8;
}

.sondage-question-texte {
    font-size: 1rem;
    font-weight: 600;
    color: #222;
    margin: 0 0 0.75rem 0;
}

.sondage-question--error .sondage-question-texte {
    color: #721c24;
}

.sondage-question--error-msg {
    font-size: 0.85rem;
    color: #721c24;
    margin: 6px 0 0 0;
}

.sondage-required {
    color: #dc3232;
    margin-left: 2px;
}

/* ---- Radio & checkbox ---- */
.sondage-radio-label,
.sondage-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.4rem 0;
    cursor: pointer;
    font-weight: normal;
    font-size: 1rem;
    color: #222;
}

/* ---- Text inputs ---- */
.sondage-wrapper .sondage-text-input,
.sondage-wrapper .sondage-textarea {
    width: 100%;
    padding: 0.6em 0.8em;
    font-size: 1rem !important;
    line-height: 1.5;
    border: 1px solid #bdbdbd;
    border-radius: 4px;
    background-color: #fafbfc;
    color: #222;
    transition: border 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    height: auto !important;
}

.sondage-wrapper .sondage-text-input:focus,
.sondage-wrapper .sondage-textarea:focus {
    outline: none;
    border-color: #097ec1;
    box-shadow: 0 0 0 2px #e3f2fd;
}

.sondage-wrapper .sondage-textarea {
    resize: vertical;
    min-height: 100px;
}

/* ---- Select ---- */
.sondage-wrapper .sondage-select {
    width: 100%;
    max-width: 360px;
    padding: 0.6em 0.8em;
    padding-right: 2.5em;
    font-size: 1rem !important;
    line-height: 1.5;
    height: auto !important;
    border: 1px solid #bdbdbd;
    border-radius: 4px;
    background-color: #fafbfc;
    color: #222;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23666' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.6em center;
    background-size: 14px 10px;
    cursor: pointer;
    transition: border 0.2s, box-shadow 0.2s;
}

.sondage-wrapper .sondage-select:focus {
    outline: none;
    border-color: #097ec1;
    box-shadow: 0 0 0 2px #e3f2fd;
}

/* ---- Scale ---- */
.sondage-echelle {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sondage-echelle-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: #666;
}

.sondage-echelle-options {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 4px;
}

.sondage-echelle-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: normal;
    flex: 1;
}

.sondage-echelle-option input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #097ec1;
    margin: 0;
}

/* ---- Step navigation ---- */
.sondage-step-nav {
    display: flex;
    gap: 12px;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e5e5;
}

.sondage-wrapper .sondage-btn {
    display: inline-block;
    width: auto !important;
    white-space: nowrap;
    padding: 0.7em 1.5em;
    border: none;
    border-radius: 4px;
    font-size: 1rem !important;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    line-height: normal;
}

.sondage-btn--next,
.sondage-btn--submit {
    background: #097ec1;
    color: #fff;
}

.sondage-btn--next:hover,
.sondage-btn--submit:hover {
    background: #065a8e;
}

.sondage-btn--next:focus,
.sondage-btn--submit:focus {
    outline: none;
}

.sondage-btn--prev {
    background: #f0f0f0;
    color: #333;
}

.sondage-btn--prev:hover {
    background: #e0e0e0;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .sondage-wrapper {
        margin: 1rem;
    }

    .sondage-echelle {
        gap: 8px;
    }

    .sondage-echelle-label {
        display: none;
    }
}

@media (max-width: 480px) {
    .sondage-step-nav {
        flex-direction: column;
    }

    .sondage-btn {
        width: auto;
        text-align: center;
    }
}
