/* ============================================
   Variables & Fondations
   ============================================ */
:root {
    /* Couleurs principales - Charte Sophie Gironi */
    --violet: #622a71;
    --violet-light: #7a3d8a;
    --violet-dark: #4a1f55;
    --rose: #EB1779;
    --rose-light: #ff3d93;
    --turquoise: #53B6B1;
    --turquoise-light: #6fc9c4;
    --jaune: #F9AB0C;
    --jaune-light: #ffc53d;
    
    /* Couleurs sémantiques */
    --stable: #4caf50;
    --vigilance: #ff9800;
    --marque: #e53935;
    
    /* Neutres */
    --bg-cream: #faf8f5;
    --bg-white: #ffffff;
    --text-dark: #2d2d2d;
    --text-body: #4a4a4a;
    --text-light: #6b6b6b;
    --text-muted: #9a9a9a;
    --border-light: #e8e4df;
    --border: #d4cfc7;
    
    /* Typographie */
    --font-display: 'DM Serif Display', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Espacements */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Rayons */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Ombres */
    --shadow-sm: 0 1px 3px rgba(98, 42, 113, 0.08);
    --shadow-md: 0 4px 12px rgba(98, 42, 113, 0.1);
    --shadow-lg: 0 8px 24px rgba(98, 42, 113, 0.12);
    --shadow-glow: 0 0 20px rgba(235, 23, 121, 0.15);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-body);
    background: var(--bg-cream);
    min-height: 100vh;
}

/* ============================================
   Container & Layout
   ============================================ */
.container {
    max-width: 720px;
    margin: 0 auto;
    padding: var(--space-lg);
}

.hidden {
    display: none !important;
}

/* ============================================
   Header
   ============================================ */
header {
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
    margin-bottom: var(--space-lg);
}

.header-content {
    position: relative;
}

h1 {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 5vw, 2.25rem);
    font-weight: 400;
    color: var(--violet);
    margin-bottom: var(--space-sm);
    line-height: 1.2;
}

.header-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

/* ============================================
   Sections
   ============================================ */
.section {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
    box-shadow: var(--shadow-md);
    animation: fadeSlideUp 0.5s ease-out;
}

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

/* ============================================
   Introduction
   ============================================ */
.intro-content p {
    margin-bottom: var(--space-lg);
    font-size: 1.05rem;
}

.intro-lead {
    font-size: 1.15rem !important;
    color: var(--text-dark);
}

.intro-content strong {
    color: var(--violet);
}

.warning-box {
    display: flex;
    gap: var(--space-md);
    background: linear-gradient(135deg, #fff9e6 0%, #fff5d6 100%);
    border: 1px solid rgba(249, 171, 12, 0.3);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin: var(--space-xl) 0;
}

.warning-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.warning-box p {
    margin-bottom: var(--space-sm);
    font-size: 0.95rem;
    color: var(--text-body);
}

.warning-box p:last-child {
    margin-bottom: 0;
}

.intro-cta {
    margin-top: var(--space-2xl);
    text-align: center;
}

.intro-promise {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--violet);
    margin-bottom: var(--space-lg) !important;
}

/* ============================================
   Boutons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.btn svg {
    transition: transform 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--violet) 0%, var(--rose) 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

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

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

.btn-large {
    padding: var(--space-lg) var(--space-2xl);
    font-size: 1.1rem;
}

.btn-secondary {
    background: var(--bg-cream);
    color: var(--text-body);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-white);
    border-color: var(--violet);
    color: var(--violet);
}

.btn-cta {
    background: linear-gradient(135deg, var(--jaune) 0%, var(--jaune-light) 100%);
    color: var(--text-dark);
    font-size: 1.1rem;
    padding: var(--space-lg) var(--space-2xl);
    box-shadow: var(--shadow-md);
}

.btn-cta:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(249, 171, 12, 0.4);
}

/* ============================================
   Barre de progression
   ============================================ */
.progress-container {
    margin-bottom: var(--space-2xl);
    padding: var(--space-lg);
    background: var(--bg-cream);
    border-radius: var(--radius-md);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.progress-label {
    font-size: 0.9rem;
    color: var(--text-light);
}

.progress-count {
    font-weight: 600;
    color: var(--violet);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-light);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--violet) 0%, var(--rose) 100%);
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 4px;
}

/* ============================================
   Groupes de questions
   ============================================ */
.question-group {
    margin-bottom: var(--space-2xl);
    padding-bottom: var(--space-xl);
    border-bottom: 2px solid var(--border-light);
}

.question-group:last-of-type {
    border-bottom: none;
    margin-bottom: var(--space-lg);
}

.group-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-light);
}

.group-icon {
    font-size: 1.5rem;
}

.group-header h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--violet);
}

/* ============================================
   Questions
   ============================================ */
.question-item {
    margin-bottom: var(--space-xl);
    padding: var(--space-lg);
    background: var(--bg-cream);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.question-item:hover {
    background: linear-gradient(135deg, rgba(98, 42, 113, 0.03) 0%, rgba(235, 23, 121, 0.03) 100%);
}

.question-item.answered {
    border-left: 3px solid var(--turquoise);
}

.question-content {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.question-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--violet);
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 50%;
    flex-shrink: 0;
}

.question-text {
    font-size: 1.05rem;
    color: var(--text-dark);
    line-height: 1.5;
    padding-top: 2px;
}

/* ============================================
   Radio Buttons
   ============================================ */
.radio-group {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-sm);
}

.radio-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--bg-white);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.radio-label:hover {
    border-color: var(--violet-light);
    background: rgba(98, 42, 113, 0.02);
}

.radio-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 50%;
    transition: all 0.2s ease;
    position: relative;
}

.radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    background: var(--rose);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.2s ease;
}

.radio-label input[type="radio"]:checked ~ .radio-custom {
    border-color: var(--rose);
}

.radio-label input[type="radio"]:checked ~ .radio-custom::after {
    transform: translate(-50%, -50%) scale(1);
}

.radio-label input[type="radio"]:checked ~ .radio-text {
    color: var(--violet);
    font-weight: 600;
}

.radio-label:has(input:checked) {
    border-color: var(--rose);
    background: rgba(235, 23, 121, 0.04);
}

.radio-text {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.3;
}

/* ============================================
   Section Cycle
   ============================================ */
.cycle-group {
    background: linear-gradient(135deg, rgba(83, 182, 177, 0.05) 0%, rgba(83, 182, 177, 0.02) 100%);
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    margin-top: var(--space-md);
}

.cycle-toggle {
    margin-bottom: var(--space-xl);
}

.toggle-wrapper {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    cursor: pointer;
    padding: var(--space-md);
    background: var(--bg-white);
    border-radius: var(--radius-md);
    border: 2px solid var(--border-light);
    transition: all 0.2s ease;
}

.toggle-wrapper:hover {
    border-color: var(--turquoise);
}

.toggle-wrapper input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    width: 48px;
    height: 26px;
    background: var(--border);
    border-radius: 13px;
    position: relative;
    flex-shrink: 0;
    transition: background 0.3s ease;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}

.toggle-wrapper input:checked ~ .toggle-slider {
    background: var(--turquoise);
}

.toggle-wrapper input:checked ~ .toggle-slider::after {
    transform: translateX(22px);
}

.toggle-text {
    font-size: 0.95rem;
    color: var(--text-body);
    line-height: 1.4;
}

.toggle-hint {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.cycle-question.disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* ============================================
   Actions du formulaire
   ============================================ */
.form-actions {
    margin-top: var(--space-2xl);
    text-align: center;
}

/* ============================================
   Messages d'erreur
   ============================================ */
.error-message {
    background: linear-gradient(135deg, #fff0f0 0%, #ffe8e8 100%);
    color: #c62828;
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-xl);
    border-left: 4px solid #c62828;
    font-size: 0.95rem;
}

/* ============================================
   Résultats
   ============================================ */
.results-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.results-header h2 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: var(--violet);
    margin-bottom: var(--space-sm);
}

.results-subtitle {
    color: var(--text-light);
}

.axis-result {
    margin-bottom: var(--space-lg);
    padding: var(--space-lg);
    background: var(--bg-cream);
    border-radius: var(--radius-md);
}

.axis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.axis-name {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--violet);
}

.axis-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.axis-score {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-light);
    padding: var(--space-xs) var(--space-md);
    background: var(--bg-white);
    border-radius: var(--radius-sm);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-xs) var(--space-md);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-prioritaire {
    background: var(--marque);
    color: white;
}

.badge-secondaire {
    background: var(--vigilance);
    color: white;
}

.badge-stable {
    background: var(--stable);
    color: white;
}

/* Barres de score */
.score-bar-container {
    width: 100%;
    height: 12px;
    background: var(--bg-white);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: var(--space-sm);
}

.score-bar {
    height: 100%;
    border-radius: 6px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.score-bar.stable {
    background: linear-gradient(90deg, var(--stable) 0%, #66bb6a 100%);
}

.score-bar.vigilance {
    background: linear-gradient(90deg, var(--vigilance) 0%, #ffb74d 100%);
}

.score-bar.marque {
    background: linear-gradient(90deg, var(--marque) 0%, #ef5350 100%);
}

.interpretation {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ============================================
   Synthèse
   ============================================ */
.summary-section {
    margin-top: var(--space-2xl);
    padding: var(--space-xl);
    background: linear-gradient(135deg, rgba(98, 42, 113, 0.04) 0%, rgba(235, 23, 121, 0.04) 100%);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--violet);
}

.summary-section h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--violet);
    margin-bottom: var(--space-lg);
}

.summary-text {
    font-size: 1.05rem;
    color: var(--text-body);
    line-height: 1.7;
    margin-bottom: var(--space-md);
}

.priority-list {
    list-style: none;
    padding: 0;
    margin: var(--space-md) 0;
}

.priority-list li {
    position: relative;
    padding: var(--space-md) 0 var(--space-md) var(--space-xl);
    color: var(--text-body);
    font-size: 1rem;
}

.priority-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--rose);
    font-weight: bold;
}

.stable-message {
    text-align: center;
    padding: var(--space-xl);
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1) 0%, rgba(102, 187, 106, 0.1) 100%);
    border-radius: var(--radius-lg);
    border: 2px solid var(--stable);
}

.stable-message p {
    font-size: 1.15rem;
    color: var(--stable);
    font-weight: 600;
}

/* ============================================
   CTA Section
   ============================================ */
.cta-section {
    margin-top: var(--space-2xl);
    padding: var(--space-2xl);
    background: linear-gradient(135deg, rgba(249, 171, 12, 0.1) 0%, rgba(255, 193, 7, 0.08) 100%);
    border-radius: var(--radius-xl);
    border: 2px solid rgba(249, 171, 12, 0.3);
}

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

.cta-content h3 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--text-dark);
    margin-bottom: var(--space-md);
    line-height: 1.4;
}

.cta-content p {
    color: var(--text-body);
    margin-bottom: var(--space-xl);
}

/* ============================================
   Footer
   ============================================ */
footer {
    text-align: center;
    padding: var(--space-xl) 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

footer a {
    color: var(--violet);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 640px) {
    .container {
        padding: var(--space-md);
    }

    header {
        padding: var(--space-xl) var(--space-md);
    }

    .section {
        padding: var(--space-lg);
        border-radius: var(--radius-lg);
    }

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

    .radio-label {
        padding: var(--space-sm) var(--space-xs);
    }

    .radio-text {
        font-size: 0.8rem;
    }

    .question-content {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .question-number {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }

    .btn {
        width: 100%;
    }

    .btn-large {
        padding: var(--space-md) var(--space-lg);
    }

    .axis-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .axis-meta {
        width: 100%;
        justify-content: space-between;
    }

    .cta-section {
        padding: var(--space-xl);
    }

    .cta-content h3 {
        font-size: 1.2rem;
    }

    .toggle-wrapper {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .warning-box {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 380px) {
    .radio-group {
        grid-template-columns: 1fr;
    }

    .radio-label {
        flex-direction: row;
        justify-content: flex-start;
        padding: var(--space-md);
    }

    .radio-custom {
        margin-right: var(--space-md);
    }
}

/* ============================================
   Accessibilité
   ============================================ */
.radio-label:focus-within {
    outline: 2px solid var(--violet);
    outline-offset: 2px;
}

button:focus-visible,
a.btn:focus-visible {
    outline: 2px solid var(--violet);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Mode sombre automatique pour utilisateurs qui préfèrent */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-cream: #1a1a1a;
        --bg-white: #252525;
        --text-dark: #f0f0f0;
        --text-body: #d0d0d0;
        --text-light: #a0a0a0;
        --text-muted: #707070;
        --border-light: #3a3a3a;
        --border: #4a4a4a;
    }

    .warning-box {
        background: linear-gradient(135deg, rgba(249, 171, 12, 0.15) 0%, rgba(249, 171, 12, 0.1) 100%);
    }

    .cycle-group {
        background: linear-gradient(135deg, rgba(83, 182, 177, 0.1) 0%, rgba(83, 182, 177, 0.05) 100%);
    }
}
