/* Medical Feedback System - Frontend Premium Design - FIXED */

/* Global box-sizing fix */
* {
    box-sizing: border-box;
}

html, body {
    width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

.mfs-feedback-container {
    max-width: 900px;
    width: 100%;
    margin: 50px auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    position: relative;
}

/* Particules décoratives subtiles en arrière-plan */
.mfs-feedback-container::before,
.mfs-feedback-container::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
}

.mfs-feedback-container::before {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #2E2A39 0%, transparent 70%);
    top: -150px;
    right: -150px;
}

.mfs-feedback-container::after {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, #D7D3D2 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
}

.mfs-feedback-wrapper {
    background: #E5E2E1;
    border-radius: 28px;
    box-shadow: 
        0 20px 60px rgba(46, 42, 57, 0.06),
        0 0 0 1px rgba(215, 211, 210, 0.2);
    padding: 55px 50px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

/* Effet glassmorphism subtil */
.mfs-feedback-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        #2E2A39 20%, 
        #D7D3D2 50%, 
        #2E2A39 80%, 
        transparent 100%
    );
    animation: slideGradient 3s ease-in-out infinite;
}

@keyframes slideGradient {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.mfs-title {
    color: #2E2A39;
    font-size: 38px;
    font-weight: 800;
    text-align: center;
    margin: 0 0 45px 0;
    letter-spacing: -0.8px;
    position: relative;
    padding-bottom: 25px;
    line-height: 1.2;
    text-transform: none !important;
}

.mfs-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 5px;
    background: linear-gradient(90deg, #2E2A39 0%, #D7D3D2 50%, #2E2A39 100%);
    border-radius: 3px;
    animation: pulseWidth 2s ease-in-out infinite;
}

@keyframes pulseWidth {
    0%, 100% { width: 100px; }
    50% { width: 120px; }
}

/* Barre de progression premium avec compteur */
.mfs-progress-bar {
    width: 100%;
    height: 14px;
    background: linear-gradient(90deg, #ebe9ea 0%, #f0eeef 50%, #ebe9ea 100%);
    border-radius: 25px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 
        inset 0 2px 6px rgba(46, 42, 57, 0.08),
        0 2px 8px rgba(46, 42, 57, 0.04);
    position: relative;
}

.mfs-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2E2A39 0%, #4a4550 50%, #2E2A39 100%);
    background-size: 200% 100%;
    width: 0%;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 25px;
    position: relative;
    overflow: hidden;
    animation: gradientFlow 3s ease infinite;
}

@keyframes gradientFlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.mfs-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

.mfs-progress-text {
    text-align: center;
    color: #6b6570;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 40px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 13px;
}

/* Chapitres avec animations */
.mfs-chapter {
    animation: fadeInSlide 0.7s ease-in-out;
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.mfs-chapter.slide-out-left {
    animation: slideOutLeft 0.5s ease-in-out;
}

.mfs-chapter.slide-out-right {
    animation: slideOutRight 0.5s ease-in-out;
}

@keyframes slideOutLeft {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(-50px) scale(0.95);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(50px) scale(0.95);
    }
}

.mfs-chapter-title {
    color: #2E2A39;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 40px 0;
    padding-bottom: 20px;
    border-bottom: 3px solid transparent;
    background: linear-gradient(to right, #f0eeef, #f0eeef) no-repeat bottom;
    background-size: 100% 3px;
    position: relative;
    text-transform: none !important;
}

.mfs-chapter-title::before {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, #2E2A39 0%, #D7D3D2 100%);
    animation: expandWidth 1s ease-out;
}

@keyframes expandWidth {
    from { width: 0; }
    to { width: 80px; }
}

/* Questions avec design alterné élégant */
.mfs-question-block {
    margin-bottom: 35px;
    padding: 32px;
    background: linear-gradient(135deg, #F2F2F2 0%, #ECE9E8 100%);
    border-radius: 18px;
    border: 2px solid #ebe9ea;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(46, 42, 57, 0.03);
    position: relative;
    overflow: hidden;
}

/* Alternance de couleurs subtile */
.mfs-question-block:nth-child(even) {
    background: linear-gradient(135deg, #F2F2F2 0%, #ECE9E8 100%);
}

.mfs-question-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 0;
    background: linear-gradient(180deg, #2E2A39 0%, #D7D3D2 100%);
    transition: height 0.5s ease;
}

.mfs-question-block:hover {
    border-color: #D7D3D2;
    box-shadow: 
        0 12px 35px rgba(46, 42, 57, 0.08),
        0 0 0 1px rgba(215, 211, 210, 0.2);
    transform: translateY(-4px);
}

.mfs-question-block:hover::before {
    height: 100%;
}

/* Badge de statut sur les questions répondues */
.mfs-question-block.answered {
    border-color: #D7D3D2;
    background: linear-gradient(135deg, #f5f4f6 0%, #ebe9ea 100%);
    box-shadow: 
        0 8px 25px rgba(46, 42, 57, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.mfs-question-block.answered::after {
    content: '✓';
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #2E2A39 0%, #3d3847 100%);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    animation: popIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 4px 12px rgba(46, 42, 57, 0.2);
}

@keyframes popIn {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.mfs-question-text {
    color: #2E2A39;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 28px 0;
    line-height: 1.7;
    padding-right: 40px;
}

/* Boutons de réponse ultra premium */
.mfs-answer-buttons {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.mfs-btn {
    flex: 1;
    padding: 20px 35px;
    font-size: 17px;
    font-weight: 700;
    border: 2px solid transparent;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.mfs-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.mfs-btn:active::before {
    width: 500px;
    height: 500px;
}

.mfs-check-icon {
    font-size: 22px;
    font-weight: bold;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.mfs-btn:hover .mfs-check-icon {
    transform: scale(1.3) rotate(10deg);
}

/* Bouton Oui - Design premium */
.mfs-btn-yes {
    background: 
        linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    color: #2E2A39;
    border-color: #e0dde0;
    box-shadow: 
        0 6px 18px rgba(46, 42, 57, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.mfs-btn-yes::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(46, 42, 57, 0.05), transparent);
    transition: left 0.6s ease;
}

.mfs-btn-yes:hover::after {
    left: 100%;
}

.mfs-btn-yes:hover {
    background: linear-gradient(135deg, #f8f7f8 0%, #ebe9ea 100%);
    border-color: #D7D3D2;
    transform: translateY(-5px) scale(1.02);
    box-shadow: 
        0 12px 30px rgba(46, 42, 57, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}



.mfs-btn-yes.selected {
    background: linear-gradient(135deg, #2E2A39 0%, #3d3847 100%);
    color: #ffffff;
    border: 5px solid #ffffff;
    box-shadow: 
        0 10px 35px rgba(46, 42, 57, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.mfs-btn-yes.selected .mfs-check-icon {
    animation: bounceRotate 0.6s ease;
}

@keyframes bounceRotate {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.3) rotate(-10deg); }
    75% { transform: scale(1.3) rotate(10deg); }
}

/* Bouton Non - Design premium */
.mfs-btn-no {
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    color: #2E2A39;
    border-color: #e0dde0;
    box-shadow: 
        0 6px 18px rgba(46, 42, 57, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.mfs-btn-no::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(107, 101, 112, 0.05), transparent);
    transition: left 0.6s ease;
}

.mfs-btn-no:hover::after {
    left: 100%;
}

.mfs-btn-no:hover {
    background: linear-gradient(135deg, #f8f7f8 0%, #ebe9ea 100%);
    border-color: #D7D3D2;
    transform: translateY(-5px) scale(1.02);
    box-shadow: 
        0 12px 30px rgba(107, 101, 112, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}


.mfs-btn-no.selected {
    background: linear-gradient(135deg, #2E2A39 0%, #3d3847 100%);
    color: #ffffff;
    border: 5px solid #ffffff;
    box-shadow: 
        0 10px 35px rgba(46, 42, 57, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.mfs-btn-no.selected .mfs-check-icon {
    animation: shakeRotate 0.6s ease;
}

@keyframes shakeRotate {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.3) rotate(-15deg); }
    50% { transform: scale(1.3) rotate(15deg); }
    75% { transform: scale(1.3) rotate(-10deg); }
}

/* Champ de commentaire premium */
.mfs-comment-container {
    margin-top: 22px;
    animation: slideDownFade 0.6s ease-out;
}

@keyframes slideDownFade {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        max-height: 280px;
        transform: translateY(0);
    }
}

.mfs-comment-field {
    width: 100%;
    min-height: 120px;
    padding: 20px;
    border: 2px solid #e0dde0;
    border-radius: 14px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    transition: all 0.4s ease;
    background: 
        linear-gradient(135deg, #fdfcfd 0%, #f8f7f8 100%);
    color: #2E2A39;
    box-shadow: inset 0 2px 6px rgba(46, 42, 57, 0.03);
}

.mfs-comment-field:focus {
    outline: none;
    border-color: #D7D3D2;
    background: #ffffff;
    box-shadow: 
        0 6px 20px rgba(46, 42, 57, 0.1),
        inset 0 1px 2px rgba(46, 42, 57, 0.05),
        0 0 0 4px rgba(215, 211, 210, 0.15);
    transform: translateY(-2px);
}

.mfs-comment-field::placeholder {
    color: #9a959d;
    font-style: italic;
}

/* Boutons de navigation ultra premium */
.mfs-navigation-buttons {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 50px;
    padding-top: 40px;
    border-top: 3px solid transparent;
    background: linear-gradient(to right, #f0eeef, #f0eeef) no-repeat top;
    background-size: 100% 3px;
}

.mfs-btn-prev,
.mfs-btn-next,
.mfs-btn-submit {
    padding: 20px 42px;
    font-size: 17px;
    font-weight: 800;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, #2E2A39 0%, #3d3847 50%, #2E2A39 100%);
    background-size: 200% 100%;
    color: #ffffff;
    min-width: 170px;
    box-shadow: 
        0 8px 25px rgba(46, 42, 57, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 15px;
}

.mfs-btn-prev::before,
.mfs-btn-next::before,
.mfs-btn-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.mfs-btn-prev:hover::before,
.mfs-btn-next:hover::before,
.mfs-btn-submit:hover::before {
    left: 100%;
}

.mfs-btn-prev:hover:not(:disabled),
.mfs-btn-next:hover:not(:disabled),
.mfs-btn-submit:hover:not(:disabled) {
    background-position: 100% 0;
    transform: translateY(-6px) scale(1.02);
    box-shadow: 
        0 15px 40px rgba(46, 42, 57, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.mfs-btn-prev:active:not(:disabled),
.mfs-btn-next:active:not(:disabled),
.mfs-btn-submit:active:not(:disabled) {
    transform: translateY(-3px) scale(1);
}

.mfs-btn-next:disabled,
.mfs-btn-submit:disabled {
    background: linear-gradient(135deg, #d0cdd0 0%, #e0dde0 100%);
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: 0 4px 12px rgba(46, 42, 57, 0.08);
}

.mfs-btn-next {
    margin-left: auto;
}

/* Message de succès avec confettis effect */
.mfs-success-message {
    text-align: center;
    padding: 80px 40px;
    animation: fadeInScale 1s ease-in-out;
    position: relative;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.mfs-success-icon {
    width: 110px;
    height: 110px;
    background: linear-gradient(135deg, #2E2A39 0%, #3d3847 100%);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    margin: 0 auto 40px;
    animation: successBounce 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 
        0 20px 50px rgba(46, 42, 57, 0.25),
        inset 0 2px 0 rgba(255, 255, 255, 0.2);
    position: relative;
}

.mfs-success-icon::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border-radius: 50%;
    border: 4px solid #D7D3D2;
    animation: pulseBorder 2s infinite;
}

.mfs-success-icon::after {
    content: '';
    position: absolute;
    top: -15px;
    left: -15px;
    right: -15px;
    bottom: -15px;
    border-radius: 50%;
    border: 2px solid rgba(215, 211, 210, 0.3);
    animation: pulseBorder 2s infinite 0.5s;
}

@keyframes pulseBorder {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.3;
        transform: scale(1.15);
    }
}

@keyframes successBounce {
    0% {
        transform: scale(0) rotate(-360deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.15) rotate(-180deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.mfs-success-message h3 {
    color: #2E2A39;
    font-size: 34px;
    font-weight: 800;
    margin: 0 0 20px 0;
    letter-spacing: -0.5px;
}

.mfs-success-message p {
    color: #6b6570;
    font-size: 19px;
    margin: 0;
    line-height: 1.8;
    font-weight: 500;
}

/* Animations d'entrée décalées pour les questions */
.mfs-question-block {
    animation: fadeInUp 0.6s ease-out backwards;
}

.mfs-question-block:nth-child(1) { animation-delay: 0.1s; }
.mfs-question-block:nth-child(2) { animation-delay: 0.2s; }
.mfs-question-block:nth-child(3) { animation-delay: 0.3s; }
.mfs-question-block:nth-child(4) { animation-delay: 0.4s; }
.mfs-question-block:nth-child(5) { animation-delay: 0.5s; }
.mfs-question-block:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive optimisé - FIXED */
@media (max-width: 768px) {
    .mfs-feedback-container {
        max-width: 100%;
        width: 100%;
        padding: 15px;
        margin: 30px auto;
    }
    
    .mfs-feedback-wrapper {
        padding: 35px 22px;
        border-radius: 24px;
    }
    
    .mfs-title {
        font-size: 30px;
        margin-bottom: 35px;
    }
    
    .mfs-chapter-title {
        font-size: 24px;
    }
    
    .mfs-question-text {
        font-size: 17px;
        padding-right: 0;
    }
    
    .mfs-question-block {
        padding: 26px 20px;
    }
    
    .mfs-question-block.answered::after {
        width: 28px;
        height: 28px;
        font-size: 14px;
        top: 12px;
        right: 12px;
    }
    
    .mfs-answer-buttons {
        flex-direction: column;
        gap: 14px;
    }
    
    .mfs-btn {
        width: 100%;
        padding: 18px 28px;
    }
    
    .mfs-navigation-buttons {
        flex-direction: column;
        gap: 14px;
    }
    
    .mfs-btn-prev,
    .mfs-btn-next,
    .mfs-btn-submit {
        width: 100%;
        margin-left: 0 !important;
    }
    
    .mfs-success-icon {
        width: 90px;
        height: 90px;
        font-size: 50px;
    }
    
    .mfs-success-message h3 {
        font-size: 28px;
    }
    
    .mfs-success-message p {
        font-size: 17px;
    }
}