/**
 * Quiz 108 Patterns d'Auto-Sabotage - Version 1
 * Charte graphique : Spirituel/Mystique
 */

/* =====================================================
   CSS VARIABLES
   ===================================================== */
:root {
    --violet: #5B3A7D;
    --violet-deep: #3D2555;
    --violet-light: #7B5A9D;
    --or: #D4A574;
    --or-light: #E8C9A0;
    --fond: #1a1a2e;
    --fond-card: #242440;
    --texte: #e8e8e8;
    --texte-muted: #9a9ab0;

    --profil1: #4A3B5C;
    --profil2: #3D4F5F;
    --profil3: #5C3D4A;
    --profil4: #5F4A3D;
    --profil5: #4F5C3D;
    --profil6: #3D5C5C;

    --font-title: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;

    --transition-fast: 200ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 400ms ease;

    --shadow-glow-violet: 0 0 30px rgba(91, 58, 125, 0.3);
    --shadow-glow-or: 0 0 20px rgba(212, 165, 116, 0.3);
}

/* =====================================================
   RESET & BASE
   ===================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--texte);
    background: var(--fond);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Fond avec gradients radiaux */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(91, 58, 125, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(212, 165, 116, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 100%, rgba(61, 37, 85, 0.2) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* =====================================================
   LAYOUT
   ===================================================== */
.container {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.screen {
    display: none;
    min-height: 100vh;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.screen.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    opacity: 1;
    transform: translateY(0);
}

/* =====================================================
   ÉCRAN 1 : LANDING
   ===================================================== */
.landing-content {
    text-align: center;
    padding: 2rem 0;
}

.badge {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: rgba(91, 58, 125, 0.2);
    border: 1px solid rgba(91, 58, 125, 0.4);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--or-light);
    margin-bottom: 2rem;
}

.landing-title {
    font-family: var(--font-title);
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--texte);
}

.landing-subtitle {
    font-size: 1.125rem;
    color: var(--texte);
    margin-bottom: 1rem;
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
}

.landing-text {
    font-size: 0.95rem;
    color: var(--texte-muted);
    margin-bottom: 2.5rem;
}

.profile-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.chip {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid;
    opacity: 0.85;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.chip:hover {
    opacity: 1;
    transform: scale(1.05);
}

.chip-1 { background: rgba(74, 59, 92, 0.3); border-color: var(--profil1); color: var(--texte); }
.chip-2 { background: rgba(61, 79, 95, 0.3); border-color: var(--profil2); color: var(--texte); }
.chip-3 { background: rgba(92, 61, 74, 0.3); border-color: var(--profil3); color: var(--texte); }
.chip-4 { background: rgba(95, 74, 61, 0.3); border-color: var(--profil4); color: var(--texte); }
.chip-5 { background: rgba(79, 92, 61, 0.3); border-color: var(--profil5); color: var(--texte); }
.chip-6 { background: rgba(61, 92, 92, 0.3); border-color: var(--profil6); color: var(--texte); }

.landing-mention {
    font-size: 0.85rem;
    color: var(--texte-muted);
    margin-bottom: 2rem;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--violet) 0%, var(--violet-deep) 100%);
    color: var(--texte);
    border: 2px solid transparent;
    box-shadow: var(--shadow-glow-violet);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--violet-light) 0%, var(--violet) 100%);
    border-color: var(--or);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-violet), var(--shadow-glow-or);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-large {
    padding: 1.125rem 2.5rem;
    font-size: 1.0625rem;
}

.btn-arrow {
    transition: transform var(--transition-fast);
}

.btn:hover .btn-arrow {
    transform: translateX(4px);
}

.btn-text,
.btn-loader {
    display: inline-flex;
    align-items: center;
}

.spinner {
    animation: spin 1s linear infinite;
}

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

/* =====================================================
   ÉCRAN 2 : QUIZ
   ===================================================== */
.progress-bar-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 1rem 1.5rem;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--violet) 0%, var(--or) 100%);
    border-radius: 3px;
    transition: width var(--transition-slow);
    width: 0%;
}

.progress-text {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--texte-muted);
    white-space: nowrap;
}

#screen-quiz {
    padding-top: 80px;
}

#screen-quiz.active {
    justify-content: flex-start;
    padding-top: 100px;
}

.quiz-content {
    padding: 2rem 0;
}

.question-container {
    opacity: 1;
    transform: translateY(0);
    transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.question-container.fade-out {
    opacity: 0;
    transform: translateY(-10px);
}

.question-container.fade-in {
    opacity: 0;
    transform: translateY(10px);
}

.question-text {
    font-family: var(--font-title);
    font-size: clamp(1.375rem, 4vw, 1.75rem);
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 2rem;
    color: var(--texte);
    text-align: center;
}

.answers-container {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.answer-card {
    display: block;
    width: 100%;
    padding: 1.125rem 1.25rem;
    background: var(--fond-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: var(--texte);
    text-align: left;
    font-size: 0.95rem;
    line-height: 1.5;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.answer-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(91, 58, 125, 0.1) 0%, transparent 100%);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.answer-card:hover {
    border-color: rgba(91, 58, 125, 0.5);
    box-shadow: var(--shadow-glow-violet);
    transform: translateY(-2px);
}

.answer-card:hover::before {
    opacity: 1;
}

.answer-card.selected {
    border-color: var(--or);
    background: rgba(212, 165, 116, 0.1);
    box-shadow: var(--shadow-glow-or);
}

.answer-card.flash {
    animation: flash-gold 400ms ease;
}

@keyframes flash-gold {
    0% { border-color: var(--or); box-shadow: 0 0 30px rgba(212, 165, 116, 0.5); }
    50% { border-color: var(--or-light); box-shadow: 0 0 40px rgba(212, 165, 116, 0.6); }
    100% { border-color: var(--or); box-shadow: var(--shadow-glow-or); }
}

.answer-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: rgba(91, 58, 125, 0.3);
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 0.875rem;
    flex-shrink: 0;
    transition: background var(--transition-fast);
}

.answer-card:hover .answer-key,
.answer-card.selected .answer-key {
    background: var(--violet);
}

.btn-previous {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding: 0.625rem 1rem;
    background: transparent;
    border: none;
    color: var(--texte-muted);
    font-family: var(--font-body);
    font-size: 0.875rem;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.btn-previous:hover {
    color: var(--texte);
}

/* =====================================================
   ÉCRAN 3 : CAPTURE EMAIL
   ===================================================== */
.email-content {
    text-align: center;
    padding: 2rem 0;
    max-width: 420px;
    margin: 0 auto;
}

.email-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: rgba(79, 92, 61, 0.2);
    border: 2px solid var(--profil5);
    border-radius: 50%;
    margin-bottom: 1.5rem;
    color: var(--profil5);
}

.email-title {
    font-family: var(--font-title);
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--texte);
}

.email-subtitle {
    font-size: 1rem;
    color: var(--texte-muted);
    margin-bottom: 2rem;
}

.email-form {
    text-align: left;
}

.form-group {
    margin-bottom: 1rem;
}

.form-input {
    width: 100%;
    padding: 1rem 1.25rem;
    background: var(--fond-card);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--texte);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input::placeholder {
    color: var(--texte-muted);
}

.form-input:focus {
    outline: none;
    border-color: var(--violet);
    box-shadow: 0 0 0 3px rgba(91, 58, 125, 0.2);
}

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 3px;
    accent-color: var(--violet);
    cursor: pointer;
    flex-shrink: 0;
}

.form-checkbox label {
    font-size: 0.8rem;
    color: var(--texte-muted);
    line-height: 1.5;
    cursor: pointer;
}

.email-form .btn {
    width: 100%;
    margin-top: 1rem;
}

.btn-skip {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.5rem;
    background: transparent;
    border: none;
    color: var(--texte-muted);
    font-family: var(--font-body);
    font-size: 0.85rem;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.btn-skip:hover {
    color: var(--texte);
}

/* =====================================================
   ÉCRAN 4 : RÉSULTATS
   ===================================================== */
#screen-results.active {
    justify-content: flex-start;
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.results-content {
    padding: 1rem 0;
}

.results-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.results-label {
    font-size: 0.9rem;
    color: var(--texte-muted);
    margin-bottom: 0.5rem;
}

.results-profile-name {
    font-family: var(--font-title);
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0;
}

/* Image du profil */
.profile-image-container {
    max-width: 320px;
    margin: 0 auto 2.5rem;
    position: relative;
}

.profile-image-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    padding: 4px;
    background: linear-gradient(135deg, var(--or) 0%, var(--or-light) 100%);
}

.profile-image-inner {
    border-radius: 8px;
    overflow: hidden;
    padding: 3px;
}

.profile-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
}

.profile-image-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 6px;
    font-family: var(--font-title);
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    padding: 2rem;
    color: var(--texte);
}

.profile-image-caption {
    font-family: var(--font-title);
    font-style: italic;
    font-size: 1rem;
    color: var(--texte-muted);
    text-align: center;
    margin-top: 1rem;
}

/* Citation / description courte */
.profile-quote {
    background: var(--fond-card);
    border-left: 4px solid var(--or);
    border-radius: 0 8px 8px 0;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}

.profile-quote p {
    font-family: var(--font-title);
    font-style: italic;
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--texte);
    margin: 0;
}

/* Description longue */
.profile-description {
    margin-bottom: 2.5rem;
}

.profile-description p {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--texte);
    margin-bottom: 1rem;
}

.profile-description p:last-child {
    margin-bottom: 0;
}

/* Barres de scores */
.scores-section {
    background: var(--fond-card);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2.5rem;
}

.scores-title {
    font-family: var(--font-title);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--texte);
}

.score-item {
    margin-bottom: 1rem;
}

.score-item:last-child {
    margin-bottom: 0;
}

.score-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.375rem;
}

.score-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--texte);
}

.score-value {
    font-size: 0.8rem;
    color: var(--texte-muted);
}

.score-bar {
    height: 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 5px;
    overflow: hidden;
}

.score-fill {
    height: 100%;
    border-radius: 5px;
    width: 0;
    transition: width 800ms ease-out;
}

/* Section recommandation */
.recommendation-section {
    background: linear-gradient(135deg, rgba(91, 58, 125, 0.15) 0%, rgba(61, 37, 85, 0.2) 100%);
    border: 1px solid rgba(91, 58, 125, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.recommendation-title {
    font-family: var(--font-title);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--or);
}

.recommendation-text {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--texte);
    margin-bottom: 1.5rem;
}

.recommendation-text:last-of-type {
    margin-bottom: 0;
}

/* CTA Ebook */
.cta-section {
    text-align: center;
    margin-bottom: 2rem;
}

.btn-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.125rem 2rem;
    background: linear-gradient(135deg, var(--or) 0%, var(--or-light) 100%);
    color: var(--fond);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-glow-or);
}

.btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 40px rgba(212, 165, 116, 0.4);
}

/* Actions */
.results-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-share,
.btn-restart {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: var(--texte-muted);
    font-family: var(--font-body);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-share:hover,
.btn-restart:hover {
    border-color: var(--violet);
    color: var(--texte);
}

.share-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--fond-card);
    border: 1px solid var(--profil5);
    border-radius: 8px;
    padding: 0.875rem 1.5rem;
    color: var(--texte);
    font-size: 0.9rem;
    opacity: 0;
    transition: all var(--transition-normal);
    z-index: 1000;
}

.share-toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 640px) {
    .container {
        padding: 0 1rem;
    }

    .badge {
        font-size: 0.7rem;
        padding: 0.4rem 1rem;
    }

    .landing-content {
        padding: 1.5rem 0;
    }

    .profile-chips {
        gap: 0.4rem;
    }

    .chip {
        font-size: 0.7rem;
        padding: 0.35rem 0.75rem;
    }

    .btn-large {
        padding: 1rem 1.75rem;
        font-size: 1rem;
    }

    .progress-bar-container {
        padding: 0.875rem 1rem;
    }

    .answer-card {
        padding: 1rem;
        font-size: 0.9rem;
    }

    .answer-key {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
    }

    .email-content {
        padding: 1.5rem 0;
    }

    .profile-image-container {
        max-width: 280px;
    }

    .scores-section {
        padding: 1.25rem;
    }

    .recommendation-section {
        padding: 1.25rem;
    }

    .results-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .btn-share,
    .btn-restart {
        width: 100%;
        justify-content: center;
    }
}

/* Touch devices */
@media (hover: none) and (pointer: coarse) {
    .answer-card {
        min-height: 48px;
    }

    .answer-card:hover {
        transform: none;
        box-shadow: none;
    }

    .answer-card:active {
        border-color: rgba(91, 58, 125, 0.5);
        box-shadow: var(--shadow-glow-violet);
    }
}

/* Animations d'entrée */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-header,
.profile-image-container,
.profile-quote,
.profile-description,
.scores-section,
.recommendation-section,
.cta-section,
.results-actions {
    animation: fadeInUp 0.5s ease forwards;
}

.profile-image-container { animation-delay: 0.1s; }
.profile-quote { animation-delay: 0.2s; }
.profile-description { animation-delay: 0.3s; }
.scores-section { animation-delay: 0.4s; }
.recommendation-section { animation-delay: 0.5s; }
.cta-section { animation-delay: 0.6s; }
.results-actions { animation-delay: 0.7s; }



.share-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.share-menu {
    background: var(--fond-card);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    min-width: 260px;
}

.share-menu-title {
    font-family: var(--ff-display);
    color: var(--or);
    text-align: center;
    margin-bottom: 0.5rem;
}

.share-btn {
    display: block;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    font-family: var(--ff-body);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    color: #fff;
    transition: opacity 0.2s;
}
.share-btn:hover { opacity: 0.85; }

.share-facebook { background: #1877F2; }
.share-twitter { background: #000; }
.share-whatsapp { background: #25D366; color: #000; }
.share-linkedin { background: #0A66C2; }
.share-close {
    background: transparent;
    color: var(--texte-muted);
    border: 1px solid rgba(255,255,255,0.1);
}