/* ============================================
   QUASTROM QUIZ - FRONTEND STYLES
   Design minimaliste et professionnel
   ============================================ */

/* Reset et variables */
.quastrom-quiz-wrapper {
    --primary-color: #E8764B;
    --secondary-color: #7D7D7D;
    --bg-light: #f9f9f9;
    --bg-white: #ffffff;
    --text-dark: #333333;
    --text-light: #666666;
    --border-color: #e0e0e0;
    --success-color: #4CAF50;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Container principal */
.quastrom-quiz-wrapper {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
}

/* Barre de progression */
.quiz-progress-bar {
    width: 100%;
    height: 6px;
    background-color: #e0e0e0;
    border-radius: 10px;
    margin-bottom: 20px;
    overflow: hidden;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #ff9a76);
    border-radius: 10px;
    width: 14.28%; /* 1/7 steps */
    transition: width 0.4s ease;
}

/* Indicateur d'étape */
.quiz-step-indicator {
    text-align: center;
    margin-bottom: 30px;
    font-size: 14px;
    color: var(--text-light);
}

.current-step {
    font-weight: 600;
    color: var(--primary-color);
    margin-right: 8px;
}

#current-step-number {
    font-size: 18px;
    font-weight: 700;
}

.total-steps {
    color: var(--text-light);
}

/* Formulaire */
.quastrom-quiz-form {
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

/* Étapes du quiz */
.quiz-step {
    display: none;
    padding: 40px;
    animation: fadeIn 0.4s ease;
}

.quiz-step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Logo */
.quiz-logo {
    text-align: center;
    margin-bottom: 30px;
}

.quiz-logo svg {
    max-width: 100%;
    height: auto;
}

/* Titres */
.quiz-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
    margin: 0 0 10px 0;
    letter-spacing: -0.5px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
    text-align: center;
    margin: 0 0 30px 0;
}

.step-description {
    text-align: center;
    color: var(--text-light);
    font-size: 14px;
    margin: -5px 0 30px 0;
}

/* Groupes de formulaire */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-size: 15px;
}

.required {
    color: #e74c3c;
    margin-left: 4px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition);
    background-color: var(--bg-white);
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(232, 118, 75, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* Instructions */
.instructions-box {
    background: linear-gradient(135deg, #f6f9fc 0%, #f1f5f9 100%);
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 24px;
    border-left: 4px solid var(--primary-color);
}

.instructions-box p {
    margin: 0 0 20px 0;
    color: var(--text-dark);
    font-size: 15px;
    line-height: 1.7;
}

.instructions-box h4 {
    color: var(--primary-color);
    margin: 20px 0 12px 0;
    font-size: 16px;
    font-weight: 600;
}

.instructions-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.instructions-box li {
    padding: 8px 0;
    color: var(--text-dark);
    font-size: 15px;
}

/* Acceptance box */
.acceptance-box {
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 24px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-dark);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* Blocs de questions */
.question-block {
    background: var(--bg-light);
    padding: 24px;
    border-radius: 10px;
    margin-bottom: 24px;
    border-left: 4px solid var(--primary-color);
    transition: var(--transition);
}

.question-block:hover {
    box-shadow: var(--shadow-sm);
}

.question-label {
    display: block;
    margin-bottom: 12px;
}

.question-number {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-right: 8px;
}

.question-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

.question-text {
    color: var(--text-light);
    margin: 8px 0 16px 0;
    font-size: 14px;
    line-height: 1.6;
}

.question-block textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition);
    background-color: var(--bg-white);
    resize: vertical;
    min-height: 100px;
    box-sizing: border-box;
}

.question-block textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(232, 118, 75, 0.1);
}

/* Scénarios */
.scenario-block {
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    transition: var(--transition);
}

.scenario-block:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.scenario-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--bg-light);
}

.scenario-icon {
    font-size: 28px;
    margin-right: 12px;
}

.scenario-header h4 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: var(--text-dark);
}

.scenario-context {
    background: var(--bg-light);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.scenario-context strong {
    color: var(--primary-color);
    display: block;
    margin-bottom: 8px;
}

.scenario-context p {
    margin: 0;
    color: var(--text-dark);
    font-size: 14px;
    line-height: 1.6;
}

.scenario-block .question-label {
    margin-top: 16px;
}

.scenario-block textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition);
    background-color: var(--bg-white);
    resize: vertical;
    min-height: 100px;
    box-sizing: border-box;
}

.scenario-block textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(232, 118, 75, 0.1);
}

/* Navigation */
.quiz-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 2px solid var(--bg-light);
}

.quiz-btn {
    padding: 14px 32px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    text-decoration: none;
}

.quiz-btn-next,
.quiz-btn-submit {
    background: var(--primary-color);
    color: white;
    margin-left: auto;
}

.quiz-btn-next:hover:not(:disabled),
.quiz-btn-submit:hover:not(:disabled) {
    background: #d66638;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.quiz-btn-prev {
    background: var(--bg-light);
    color: var(--text-dark);
    border: 2px solid var(--border-color);
}

.quiz-btn-prev:hover {
    background: var(--bg-white);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.quiz-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.arrow {
    font-size: 18px;
    font-weight: 700;
}

.submit-icon {
    font-size: 20px;
}

/* Confirmation */
.quiz-confirmation {
    text-align: center;
    padding: 60px 40px !important;
}

.confirmation-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--success-color), #45a049);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    margin: 0 auto 24px;
    box-shadow: 0 8px 24px rgba(76, 175, 80, 0.3);
    animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.confirmation-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 20px 0;
}

.confirmation-message {
    font-size: 16px;
    color: var(--text-dark);
    line-height: 1.7;
    max-width: 600px;
    margin: 0 auto 30px;
    padding: 24px;
    background: var(--bg-light);
    border-radius: 10px;
}

.confirmation-contact {
    padding: 20px;
    background: linear-gradient(135deg, #e8f4f8 0%, #d5e9f2 100%);
    border-radius: 8px;
    margin-top: 30px;
}

.confirmation-contact p {
    margin: 0;
    color: var(--text-light);
    font-size: 14px;
}

/* Loader */
.quiz-loader {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.quiz-loader.active {
    display: flex;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.quiz-loader p {
    color: white;
    margin-top: 20px;
    font-size: 16px;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .quastrom-quiz-wrapper {
        padding: 0 15px;
        margin: 20px auto;
    }
    
    .quiz-step {
        padding: 24px 20px;
    }
    
    .quiz-title {
        font-size: 24px;
    }
    
    .section-title {
        font-size: 18px;
    }
    
    .quiz-navigation {
        flex-direction: column;
    }
    
    .quiz-btn {
        width: 100%;
        justify-content: center;
    }
    
    .quiz-btn-next,
    .quiz-btn-submit {
        margin-left: 0;
        order: -1;
    }
    
    .instructions-box,
    .question-block,
    .scenario-block {
        padding: 20px;
    }
    
    .quiz-confirmation {
        padding: 40px 20px !important;
    }
    
    .confirmation-title {
        font-size: 26px;
    }
}

@media (max-width: 480px) {
    .quiz-title {
        font-size: 20px;
    }
    
    .section-title {
        font-size: 16px;
    }
    
    .quiz-logo svg {
        width: 160px;
    }
    
    .quiz-btn {
        padding: 12px 24px;
        font-size: 14px;
    }
}

/* Accessibilité */
.quiz-btn:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Animation d'entrée */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.quiz-step.active {
    animation: slideInUp 0.4s ease;
}
