/**
 * Quiz Public Styles
 * Un regard intérieur
 */

:root {
    --quiz-primary: #6C5CE7;
    --quiz-secondary: #A29BFE;
    --quiz-bg: #F8F9FA;
    --quiz-text: #2D3436;
    --quiz-text-muted: #636E72;
    --quiz-border: #DFE6E9;
    --quiz-success: #00B894;
    --quiz-warning: #FDCB6E;
    --quiz-danger: #D63031;
}

* {
    box-sizing: border-box;
}

body.quiz-page {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, var(--quiz-bg) 0%, #E8ECEF 100%);
    min-height: 100vh;
    color: var(--quiz-text);
}

.quiz-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.quiz-header {
    padding: 1.5rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quiz-logo img {
    height: 40px;
    width: auto;
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--quiz-primary);
}

.quiz-progress-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.quiz-progress {
    width: 120px;
    height: 6px;
    background: var(--quiz-border);
    border-radius: 3px;
    overflow: hidden;
}

.quiz-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--quiz-primary), var(--quiz-secondary));
    border-radius: 3px;
    transition: width 0.3s ease;
}

.quiz-progress-text {
    font-size: 0.875rem;
    color: var(--quiz-text-muted);
    white-space: nowrap;
}

/* Sections */
.quiz-section {
    flex: 1;
    display: none;
    padding: 2rem 0;
}

.quiz-section.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.quiz-content {
    text-align: center;
}

/* Landing */
.quiz-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--quiz-text);
}

.quiz-description {
    font-size: 1.1rem;
    color: var(--quiz-text-muted);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.quiz-profiles-preview {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.quiz-profiles-preview h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--quiz-text);
}

.profiles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.profile-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    color: var(--profile-color);
    transition: transform 0.2s ease;
}

.profile-preview:hover {
    transform: translateY(-2px);
}

.profile-preview i {
    font-size: 1.5rem;
}

.quiz-info {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--quiz-text-muted);
    font-size: 0.9rem;
}

.info-item i {
    color: var(--quiz-primary);
}

.btn-quiz-start {
    background: linear-gradient(135deg, var(--quiz-primary), var(--quiz-secondary));
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-quiz-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(108, 92, 231, 0.3);
}

.quiz-resume-hint {
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

.quiz-resume-hint a {
    color: var(--quiz-primary);
    text-decoration: none;
}

/* Questions */
.quiz-questions {
    padding: 0;
}

.quiz-question {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.question-number {
    font-size: 0.875rem;
    color: var(--quiz-text-muted);
    margin-bottom: 1rem;
    font-weight: 500;
}

.question-text {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    line-height: 1.4;
    color: var(--quiz-text);
}

/* Options (single choice) */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.option-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 1rem 1.25rem;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.option-btn:hover {
    background: #f1f3f5;
    border-color: var(--quiz-secondary);
}

.option-btn.selected {
    background: rgba(108, 92, 231, 0.1);
    border-color: var(--quiz-primary);
}

.option-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: white;
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--quiz-text-muted);
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.option-btn.selected .option-letter {
    background: var(--quiz-primary);
    color: white;
}

.option-text {
    flex: 1;
    font-size: 1rem;
    color: var(--quiz-text);
}

/* Ranking */
.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ranking-instruction {
    font-size: 0.9rem;
    color: var(--quiz-text-muted);
    margin-bottom: 0.5rem;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 0.75rem;
    cursor: grab;
    transition: all 0.2s ease;
    user-select: none;
}

.ranking-item:active {
    cursor: grabbing;
}

.ranking-item.dragging {
    opacity: 0.5;
    border-color: var(--quiz-primary);
}

.ranking-item.drag-over {
    border-color: var(--quiz-secondary);
    background: rgba(108, 92, 231, 0.05);
}

.ranking-item.placed {
    background: rgba(108, 92, 231, 0.1);
    border-color: var(--quiz-primary);
}

.ranking-position {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--quiz-primary);
    color: white;
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.ranking-position::before {
    content: attr(data-position);
}

.ranking-text {
    flex: 1;
    font-size: 1rem;
    color: var(--quiz-text);
}

.ranking-handle {
    color: var(--quiz-text-muted);
    font-size: 1.25rem;
}

.btn-validate-ranking {
    margin-top: 1rem;
    background: var(--quiz-primary);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.btn-validate-ranking:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(108, 92, 231, 0.3);
}

/* Email Capture */
.quiz-email-capture {
    text-align: center;
}

.email-capture-icon {
    font-size: 4rem;
    color: var(--quiz-primary);
    margin-bottom: 1.5rem;
}

.email-form {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-top: 1.5rem;
}

.email-form .form-control {
    border: 2px solid var(--quiz-border);
    border-radius: 0.5rem;
    padding: 0.875rem 1rem;
}

.email-form .form-control:focus {
    border-color: var(--quiz-primary);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

.btn-quiz-primary {
    background: linear-gradient(135deg, var(--quiz-primary), var(--quiz-secondary));
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-quiz-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(108, 92, 231, 0.3);
    color: white;
}

.skip-email {
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

.skip-email a {
    color: var(--quiz-text-muted);
    text-decoration: none;
}

.skip-email a:hover {
    color: var(--quiz-primary);
}

/* Loading */
.quiz-loading {
    text-align: center;
}

.loading-animation {
    margin-bottom: 2rem;
}

.loading-animation .spinner-border {
    width: 4rem;
    height: 4rem;
    border-width: 4px;
    color: var(--quiz-primary);
}

.loading-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.loading-text {
    color: var(--quiz-text-muted);
    margin-bottom: 2rem;
}

.loading-steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 300px;
    margin: 0 auto;
}

.loading-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    color: var(--quiz-text-muted);
    transition: all 0.3s ease;
}

.loading-step.active {
    background: rgba(108, 92, 231, 0.1);
    color: var(--quiz-text);
}

.loading-step.active i {
    color: var(--quiz-success);
}

.loading-step.completed i {
    color: var(--quiz-success);
}

/* Footer */
.quiz-footer {
    padding: 2rem 0;
    text-align: center;
    color: var(--quiz-text-muted);
    font-size: 0.875rem;
    margin-top: auto;
}

/* Responsive */
@media (max-width: 576px) {
    .quiz-title {
        font-size: 1.5rem;
    }

    .profiles-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .quiz-info {
        gap: 1rem;
    }

    .info-item {
        font-size: 0.8rem;
    }

    .quiz-question {
        padding: 1.5rem;
    }

    .question-text {
        font-size: 1.1rem;
    }
}
