/**
 * Leadgen Quiz Funnel — CSS
 * Design premium : carte blanche sur fond coloré, radio cards,
 * progress bar, transitions slide entre questions.
 * ~250 lignes. Zéro framework externe.
 */

/* ══════════════════════════════════════════════════
   1. WRAPPER & CARTE
══════════════════════════════════════════════════ */

.lgq-wrapper {
    width: 100%;
    padding: 80px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lgq-card {
    width: 100%;
    /* max-width: 680px;
    background: #ffffff;
    border-radius: 16px;
    padding: 40px 48px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15); */
    position: relative;
    overflow: hidden; /* clip les slides qui débordent */
}

/* ══════════════════════════════════════════════════
   2. HEADER (titre + sous-titre)
══════════════════════════════════════════════════ */

.lgq-header {
    text-align: center;
    margin-bottom: 28px;
}

.lgq-main-title {
    font-size: clamp(18px, 3vw, 24px);
    font-weight: 800;
    line-height: 1.3;
    color: #111827;
    margin: 0 0 10px;
}

.lgq-main-subtitle {
    font-size: 14px;
    line-height: 1.7;
    color: #6B7280;
    margin: 0;
}

/* ══════════════════════════════════════════════════
   3. BARRE DE PROGRESSION
══════════════════════════════════════════════════ */

.lgq-progress-wrap {
    margin-bottom: 28px;
}

.lgq-progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.lgq-progress-text {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #0A5C55;
}

.lgq-progress-pct {
    font-size: 12px;
    font-weight: 600;
    color: #9CA3AF;
}

.lgq-progress-bar {
    height: 5px;
    background: #E5E7EB;
    border-radius: 99px;
    overflow: hidden;
}

.lgq-progress-fill {
    height: 100%;
    background: #0A5C55;
    border-radius: 99px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
}

/* ══════════════════════════════════════════════════
   4. STEPS — TRANSITION SLIDE
══════════════════════════════════════════════════ */

.lgq-steps {
    position: relative;
    /* Hauteur gérée par JS pour éviter les sauts */
    overflow: hidden;
}

.lgq-step {
    display: none; /* caché par défaut */
    flex-direction: column;
    animation: lgq-slide-in 0.35s ease forwards;
}

.lgq-step.is-active {
    display: flex;
}

.lgq-step.is-leaving {
    animation: lgq-slide-out 0.35s ease forwards;
}

@keyframes lgq-slide-in {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes lgq-slide-out {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(-40px); }
}

/* Direction inverse (bouton Précédent) */
.lgq-step.going-back {
    animation: lgq-slide-in-back 0.35s ease forwards;
}

@keyframes lgq-slide-in-back {
    from { opacity: 0; transform: translateX(-40px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Résultats & Contact & Succès : même système */
.lgq-step-result,
.lgq-step-contact,
.lgq-step-success { display: none; }
.lgq-step-result.is-active,
.lgq-step-contact.is-active,
.lgq-step-success.is-active { display: flex; }

/* ══════════════════════════════════════════════════
   5. QUESTION & LABEL
══════════════════════════════════════════════════ */

.lgq-question-label {
    font-size: 17px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 20px;
    line-height: 1.4;
}

.lgq-required {
    color: #E74C3C;
    margin-left: 3px;
}

.lgq-helper {
    font-size: 13px;
    color: #9CA3AF;
    margin: -12px 0 16px;
}

/* ══════════════════════════════════════════════════
   6. OPTIONS RADIO / CHECKBOX (cards cliquables)
══════════════════════════════════════════════════ */

.lgq-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border: 1.5px solid #E5E7EB;
    border-radius: 10px;
    cursor: pointer;
    margin-bottom: 10px;
    transition: border-color 0.18s, background 0.18s;
    user-select: none;
    position: relative;
}

.lgq-option:hover {
    border-color: #9ECEC9;
    background: #F9FFFE;
}

.lgq-option.is-selected {
    border-color: #0A5C55;
    background: #F0FAF9;
}

/* Cacher l'input natif (remplacé visuellement) */
.lgq-option-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Bouton radio visuel */
.lgq-radio-dot {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border-radius: 50%;
    border: 2px solid #D1D5DB;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.18s, background 0.18s;
    flex-shrink: 0;
}

/* Checkbox : carré arrondi */
.lgq-option[data-type="checkbox"] .lgq-radio-dot {
    border-radius: 5px;
}

.lgq-option.is-selected .lgq-radio-dot {
    border-color: #0A5C55;
    background: #0A5C55;
}

/* Coche interne */
.lgq-option.is-selected .lgq-radio-dot::after {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
}

/* Coche checkbox */
.lgq-option[data-type="checkbox"].is-selected .lgq-radio-dot::after {
    width: 5px;
    height: 8px;
    border-radius: 0;
    background: transparent;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg) translate(-1px, -1px);
}

.lgq-option-label {
    font-size: 14px;
    color: #374151;
    line-height: 1.5;
}

.lgq-option.is-selected .lgq-option-label {
    color: #111827;
    font-weight: 500;
}

/* ══════════════════════════════════════════════════
   7. CHAMPS TEXTE / INPUT / SELECT / TEXTAREA
══════════════════════════════════════════════════ */

.lgq-input,
.lgq-select,
.lgq-textarea {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid #E5E7EB;
    border-radius: 10px;
    font-size: 14px;
    color: #111827;
    background: #fff;
    transition: border-color 0.18s, box-shadow 0.18s;
    appearance: none;
    font-family: inherit;
    line-height: 1.5;
}

.lgq-input:focus,
.lgq-select:focus,
.lgq-textarea:focus {
    outline: none;
    border-color: #0A5C55;
    box-shadow: 0 0 0 3px rgba(10,92,85,0.12);
}

.lgq-input.has-error,
.lgq-select.has-error {
    border-color: #E74C3C;
    box-shadow: 0 0 0 3px rgba(231,76,60,0.1);
}

.lgq-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7280' stroke-width='1.5' stroke-linecap='round' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    cursor: pointer;
}

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

/* ══════════════════════════════════════════════════
   8. RANGE SLIDER
══════════════════════════════════════════════════ */

.lgq-range-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lgq-range {
    width: 100%;
    accent-color: #0A5C55;
    cursor: pointer;
    height: 6px;
}

.lgq-range-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #9CA3AF;
}

.lgq-range-val {
    font-size: 18px;
    font-weight: 800;
    color: #0A5C55;
}

/* ══════════════════════════════════════════════════
   9. MESSAGE D'ERREUR
══════════════════════════════════════════════════ */

.lgq-error {
    font-size: 12px;
    color: #E74C3C;
    margin: 6px 0 0;
    min-height: 16px;
    display: none;
}

.lgq-error.is-visible {
    display: block;
}

/* ══════════════════════════════════════════════════
   10. RÉSULTAT / PROFIL
══════════════════════════════════════════════════ */

.lgq-step-result {
    align-items: center;
    text-align: center;
    padding: 8px 0 20px;
    gap: 12px;
}

.lgq-result-badge {
    display: inline-block;
    padding: 6px 20px;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.lgq-result-title {
    font-size: 20px;
    font-weight: 800;
    color: #111827;
    margin: 0;
    line-height: 1.3;
}

.lgq-result-desc {
    font-size: 14px;
    color: #6B7280;
    line-height: 1.75;
    margin: 0;
    max-width: 480px;
}

.lgq-score-display {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-top: 8px;
}

.lgq-score-num {
    font-size: 48px;
    font-weight: 900;
    color: #0A5C55;
    line-height: 1;
}

.lgq-score-label {
    font-size: 14px;
    color: #9CA3AF;
}

/* ══════════════════════════════════════════════════
   11. FORMULAIRE CONTACT
══════════════════════════════════════════════════ */

.lgq-step-contact {
    gap: 0;
}

.lgq-contact-title {
    font-size: 20px;
    font-weight: 800;
    color: #111827;
    margin: 0 0 8px;
}

.lgq-contact-subtitle {
    font-size: 14px;
    color: #6B7280;
    line-height: 1.7;
    margin: 0 0 24px;
}

.lgq-contact-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lgq-field-group {
    display: flex;
    flex-direction: column;
}

/* ══════════════════════════════════════════════════
   12. SUCCÈS
══════════════════════════════════════════════════ */

.lgq-step-success {
    align-items: center;
    text-align: center;
    padding: 20px 0;
    gap: 16px;
}

.lgq-success-icon svg circle {
    stroke: #0A5C55;
}

.lgq-success-message {
    font-size: 16px;
    line-height: 1.75;
    color: #374151;
    margin: 0;
    max-width: 440px;
}

/* ══════════════════════════════════════════════════
   13. NAVIGATION (boutons)
══════════════════════════════════════════════════ */

.lgq-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 28px;
    gap: 12px;
}

/* Bouton Précédent */
.lgq-btn-prev {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    font-size: 13px;
    color: #6B7280;
    cursor: pointer;
    padding: 8px 0;
    transition: color 0.18s;
    font-family: inherit;
}

.lgq-btn-prev:hover { color: #111827; }

.lgq-btn-prev.is-hidden,
.lgq-btn-submit.is-hidden,
.lgq-btn-next.is-hidden { display: none; }

/* Bouton Suivant */
.lgq-btn-next {
    margin-left: auto;
    padding: 13px 28px;
    background: #F4C842;
    color: #111827;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.18s, transform 0.15s;
    font-family: inherit;
    line-height: 1;
}

.lgq-btn-next:hover  { opacity: 0.88; transform: translateY(-1px); }
.lgq-btn-next:active { transform: scale(0.98); }

/* Bouton Envoyer (même style) */
.lgq-btn-submit {
    margin-left: auto;
    padding: 13px 28px;
    background: #0A5C55;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.18s, transform 0.15s;
    font-family: inherit;
    line-height: 1;
}

.lgq-btn-submit:hover   { opacity: 0.88; transform: translateY(-1px); }
.lgq-btn-submit:active  { transform: scale(0.98); }
.lgq-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ══════════════════════════════════════════════════
   14. NOTE RGPD
══════════════════════════════════════════════════ */

.lgq-gdpr {
    font-size: 11px;
    color: #9CA3AF;
    text-align: center;
    margin: 16px 0 0;
    line-height: 1.6;
}

/* ══════════════════════════════════════════════════
   15. RESPONSIVE
══════════════════════════════════════════════════ */

@media (max-width: 600px) {
    .lgq-card    { padding: 28px 20px; }
    .lgq-wrapper { padding: 40px 16px; }

    .lgq-question-label { font-size: 15px; }
    .lgq-option { padding: 12px 14px; }
    .lgq-option-label { font-size: 13px; }

    .lgq-btn-next,
    .lgq-btn-submit { padding: 12px 20px; font-size: 13px; }
}

/* Pas d'animations si reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .lgq-step, .lgq-progress-fill { animation: none; transition: none; }
}
