/**
 * QUESTIONNAIRE WIZARD - Styles
 * Design moderne type Typeform avec animations fluides
 * VERSION FINALE OPTIMISÉE - Code allégé et performant
 */

/* ============================================
   VARIABLES
   ============================================ */
:root {
    --wizard-primary: #2c3e91;
    --wizard-secondary: #5e2b8f;
    --wizard-accent: #667eea;
    --wizard-success: #4CAF50;
    --wizard-radius-lg: 24px;
    --wizard-radius-md: 20px;
    --wizard-radius-sm: 12px;
    --wizard-shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.1);
    --wizard-shadow-md: 0 10px 30px rgba(0, 0, 0, 0.08);
    --wizard-shadow-sm: 0 5px 15px rgba(0, 0, 0, 0.05);
    --wizard-transition: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   CHOICE CARDS - Oui/Non
   ============================================ */
.choices-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    max-width: 600px;
    margin: 0 auto;
}

.choices-container.choices-vertical {
    grid-template-columns: 1fr;
    max-width: 500px;
}

.choice-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2.5rem 2rem;
    background: white;
    border: 3px solid #e0e0e0;
    border-radius: var(--wizard-radius-md);
    cursor: pointer;
    transition: all 0.3s var(--wizard-transition);
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    min-height: 150px;
    overflow: hidden;
}

.choice-card i {
    font-size: 2.5rem;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.choice-card:hover {
    border-color: var(--wizard-primary);
    background: #f8f9ff;
    transform: translateY(-8px);
    box-shadow: var(--wizard-shadow-md);
}

.btn-check:checked + .choice-card {
    background: var(--wizard-primary);
    border-color: var(--wizard-primary);
    color: white;
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 15px 40px rgba(44, 62, 145, 0.3);
}

.btn-check:checked + .choice-card i {
    opacity: 1;
    transform: scale(1.2);
}

/* Cards verticales (pour choix multiples) */
.choice-card-vertical {
    min-height: 80px;
    padding: 1.5rem 2rem;
    font-size: 1.1rem;
}

.choice-card-vertical:hover {
    transform: translateX(10px);
}

.btn-check:checked + .choice-card-vertical {
    transform: translateX(10px) scale(1.02);
}

/* Cards larges (sélection profil) */
.choice-card-lg {
    padding: 3rem 2rem;
    min-height: 200px;
}

.choice-card-lg i {
    font-size: 3.5rem;
}

.choice-card-lg h4 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.choice-card-lg p {
    margin: 0;
    opacity: 0.8;
    font-size: 1rem;
    font-weight: 400;
}

.btn-check:checked + .choice-card-lg h4,
.btn-check:checked + .choice-card-lg p {
    color: white;
}

/* Effet ripple sur clic */
.choice-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--wizard-radius-md);
    opacity: 0;
    transition: opacity 0.3s ease;
    background: radial-gradient(circle at center, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
}

.choice-card:active::before {
    opacity: 1;
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* ============================================
   ÉTAPES - Contenu
   ============================================ */
.step-icon {
    text-align: center;
    margin-bottom: 1.5rem;
}

.step-icon i {
    font-size: 3rem;
    color: var(--wizard-primary);
    opacity: 0.9;
}

.step-title {
    text-align: center;
    color: var(--wizard-primary);
    font-size: 2rem;
    font-weight: 700;
}

.step-question {
    text-align: center;
    color: #333;
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 2rem;
}

.step-description,
.step-helper {
    text-align: center;
    color: #666;
    font-size: 1.1rem;
    line-height: 1.6;
}

.step-helper {
    font-size: 1rem;
    font-style: italic;
}

/* ============================================
   FORM CONTROLS (Coordonnées & Texte libre)
   ============================================ */
.wizard-step .form-control,
.wizard-step .form-control-lg {
    border: 2px solid #e0e0e0;
    border-radius: var(--wizard-radius-sm);
    padding: 1rem 1.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.wizard-step .form-control:focus,
.wizard-step .form-control-lg:focus {
    border-color: var(--wizard-primary);
    box-shadow: 0 0 0 0.25rem rgba(44, 62, 145, 0.1);
}

.wizard-step textarea.form-control-lg {
    resize: vertical;
    min-height: 150px;
    font-size: 1.05rem;
    line-height: 1.8;
}

/* ============================================
   RÉCAPITULATIF
   ============================================ */
.recap-summary {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 2rem;
    max-width: 700px;
    margin: 0 auto;
}

.recap-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #e0e0e0;
}

.recap-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.recap-section h4 {
    color: var(--wizard-primary);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.recap-section h4 i {
    font-size: 1.5rem;
}

.recap-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem 0;
}

.recap-item i {
    color: var(--wizard-success);
    font-size: 1.2rem;
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.recap-item-content {
    flex: 1;
}

.recap-item-label {
    font-weight: 600;
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.recap-item-value {
    color: #333;
    font-size: 1.05rem;
    word-wrap: break-word;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .step-icon i {
        font-size: 2.5rem;
    }

    .step-title {
        font-size: 1.5rem;
    }

    .step-question {
        font-size: 1.4rem;
    }

    .choices-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .choice-card {
        padding: 2rem 1.5rem;
        min-height: 120px;
        font-size: 1.1rem;
    }

    .choice-card i {
        font-size: 2rem;
    }

    .choice-card-lg {
        padding: 2.5rem 1.5rem;
        min-height: 180px;
    }

    .choice-card-lg i {
        font-size: 3rem;
    }

    .choice-card-lg h4 {
        font-size: 1.3rem;
    }

    .recap-summary {
        padding: 1.5rem;
    }
}

@media (max-width: 576px) {
    .step-question {
        font-size: 1.2rem;
    }

    .step-description,
    .step-helper {
        font-size: 1rem;
    }

    .choice-card {
        padding: 1.5rem 1rem;
        min-height: 100px;
        font-size: 1rem;
    }

    .choice-card i {
        font-size: 1.8rem;
    }

    .choice-card-vertical {
        min-height: 70px;
        padding: 1.25rem 1.5rem;
        font-size: 1rem;
    }

    .wizard-step .form-control,
    .wizard-step .form-control-lg {
        padding: 0.875rem 1.25rem;
        font-size: 0.95rem;
    }

    .recap-section h4 {
        font-size: 1.1rem;
    }

    .recap-item-label {
        font-size: 0.9rem;
    }

    .recap-item-value {
        font-size: 1rem;
    }
}

/* ============================================
   OPTIMISATIONS PERFORMANCE
   ============================================ */

/* Limiter repaints sur animations */
.choice-card,
.wizard-step,
.wizard-navigation .btn {
    will-change: transform;
}

/* Désactiver will-change après animations */
.choice-card:not(:hover),
.wizard-step:not(.active):not(.exiting) {
    will-change: auto;
}

/* Utiliser transform au lieu de top/left pour meilleures perfs */
.choice-card:hover,
.btn-check:checked + .choice-card {
    transform: translateY(-8px);
}

/* GPU acceleration pour transitions critiques */
.wizard-step.active,
.wizard-step.exiting {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* ============================================
   ACCESSIBILITÉ
   ============================================ */

/* Focus visible pour navigation clavier */
.choice-card:focus-within {
    outline: 3px solid var(--wizard-accent);
    outline-offset: 3px;
}

.btn-check:focus + .choice-card {
    outline: 3px solid var(--wizard-accent);
    outline-offset: 3px;
}

/* Améliorer contraste texte helper */
.step-helper {
    color: #555;
}

/* Messages d'erreur plus visibles */
.alert-warning {
    border-left: 4px solid #ffc107;
}

.alert-danger {
    border-left: 4px solid #dc3545;
}

.alert-success {
    border-left: 4px solid var(--wizard-success);
}

/* ============================================
   DARK MODE (optionnel)
   ============================================ */
@media (prefers-color-scheme: dark) {
    /* À implémenter si besoin */
}

/* ============================================
   PRINT
   ============================================ */
@media print {
    .choice-card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }
    
    .btn-check:checked + .choice-card {
        background: #f0f0f0 !important;
        color: #000 !important;
    }
    
    .btn-check:checked + .choice-card::after {
        color: #000 !important;
    }
    
    .step-icon,
    .wizard-brand {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}

/* ============================================
   ANIMATIONS DÉSACTIVÉES (reduced motion)
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .wizard-step.active,
    .wizard-step.exiting {
        animation: none !important;
    }
    
    .choice-card:hover,
    .btn-check:checked + .choice-card {
        transform: none !important;
    }
}


/* Grid vertical 1 colonne (texte long ou peu de choix) */
.wizard-step .choices-container.choices-vertical {
    grid-template-columns: 1fr;
}

/* Grid vertical 2 colonnes (listes longues avec texte court) */
.wizard-step .choices-container.choices-vertical-2col {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-width: 700px;
}

/* Mobile : toujours 1 colonne */
@media (max-width: 768px) {
    .wizard-step .choices-container.choices-vertical-2col {
        grid-template-columns: 1fr;
        max-width: 500px;
    }
}