:root {
    /* Palette de couleurs terre/beige inspirée de l'image */
    --primary-color: #3D3021;        /* Marron très foncé */
    --secondary-color: #6B5939;      /* Marron moyen */
    --accent-color: #5F5347;         /* Gris-brun */
    --text-dark: #3C3C3C;            /* Gris très foncé */
    --text-light: #5A5A5A;           /* Gris moyen */
    --text-medium: #787878;          /* Gris */
    --bg-light: #F5F3EE;             /* Beige très clair */
    --bg-white: #FEFEFE;             /* Blanc cassé */
    --border-color: #E8E4DC;         /* Beige clair */
    --success-color: #6B5939;        /* Marron moyen */
    --error-color: #8B4513;          /* Marron-rouge */
    --warning-color: #D4A574;        /* Beige doré */
    --unanswered-bg: #FFF8E7;        /* Beige très pâle */
    --answered-bg: #F0EBE3;          /* Beige clair */
    --shadow: 0 2px 8px rgba(61, 48, 33, 0.08);
    --shadow-lg: 0 4px 20px rgba(61, 48, 33, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.7;
    color: var(--text-dark);
    background: linear-gradient(135deg, #F5F3EE 0%, #E8E4DC 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-white);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--bg-white);
    padding: 40px 30px;
    text-align: center;
    border-bottom: 3px solid var(--accent-color);
}

.logo h1 {
    font-size: 2.8em;
    font-weight: 300;
    margin-bottom: 8px;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.tagline {
    font-size: 1em;
    opacity: 0.92;
    font-weight: 300;
    font-style: italic;
    letter-spacing: 0.5px;
}

/* Main Content */
main {
    padding: 50px 40px;
}

.intro-section {
    margin-bottom: 50px;
}

.intro-section h2 {
    color: var(--primary-color);
    font-size: 2.2em;
    margin-bottom: 25px;
    font-weight: 400;
    line-height: 1.3;
}

.intro-text {
    color: var(--text-light);
    margin-bottom: 18px;
    line-height: 1.9;
    font-size: 1.05em;
}

.benefit-box {
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--border-color) 100%);
    border-left: 5px solid var(--primary-color);
    padding: 30px;
    margin: 35px 0;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.benefit-box h3 {
    color: var(--primary-color);
    margin-bottom: 18px;
    font-size: 1.3em;
    font-weight: 500;
}

.benefit-box ul {
    list-style: none;
    padding-left: 0;
}

.benefit-box li {
    padding: 10px 0;
    color: var(--text-light);
    font-size: 1.02em;
}

/* Form Sections */
.form-section {
    display: none;
}

.form-section.active {
    display: block;
    animation: fadeIn 0.6s ease-in;
}

/* Instructions Box */
.instructions-box {
    background: linear-gradient(135deg, #FFF8E7 0%, #F5F3EE 100%);
    border-left: 4px solid var(--warning-color);
    padding: 20px 25px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

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

.instructions-box strong {
    color: var(--primary-color);
}

.instructions-box em {
    color: var(--secondary-color);
    font-weight: 500;
}

/* Chart Container */
.chart-container {
    background: white;
    padding: 35px;
    border-radius: 12px;
    margin: 35px 0;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--border-color);
}

.chart-title {
    font-size: 1.6em;
    color: var(--primary-color);
    margin-bottom: 10px;
    text-align: center;
    font-weight: 500;
}

.chart-subtitle {
    font-size: 0.95em;
    color: var(--text-medium);
    text-align: center;
    margin-bottom: 30px;
    font-style: italic;
}

.chart-bars {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.chart-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chart-bar-label {
    width: 200px;
    flex-shrink: 0;
    font-size: 0.9em;
    color: var(--text-dark);
    font-weight: 500;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chart-bar-container {
    flex: 1;
    height: 32px;
    background: var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.chart-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    border-radius: 6px;
    transition: width 0.8s ease-out;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    min-width: 45px;
}

.chart-bar-fill.top-profile {
    background: linear-gradient(90deg, #D4A574 0%, var(--secondary-color) 100%);
    font-weight: 600;
}

.chart-bar-value {
    font-size: 0.85em;
    color: white;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

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

.form-section h3 {
    color: var(--primary-color);
    font-size: 2em;
    margin-bottom: 12px;
    font-weight: 400;
}

.section-description {
    color: var(--text-light);
    margin-bottom: 35px;
    font-style: italic;
    font-size: 1.05em;
}

/* Form Groups */
.form-group {
    margin-bottom: 28px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.98em;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="date"] {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
    font-family: inherit;
    background: var(--bg-white);
    color: var(--text-dark);
}

.form-group input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 4px rgba(107, 89, 57, 0.1);
    background: white;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-weight: normal;
}

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

/* Question Card */
.question-card {
    background: white;
    border-radius: 8px;
    padding: 18px 22px;
    margin-bottom: 10px;
    border-left: 4px solid var(--border-color);
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.question-card.unanswered {
    border-left-color: var(--warning-color);
    background: var(--unanswered-bg);
}

.question-card.answered {
    border-left-color: var(--success-color);
    background: white;
}

.question-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.question-number {
    font-weight: 600;
    color: var(--secondary-color);
    min-width: 40px;
    font-size: 0.95em;
}

.question-text {
    font-size: 1em;
    color: var(--text-dark);
    line-height: 1.6;
    flex: 1;
}

.options-container {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding-left: 52px;
}

.option-label {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 6px;
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8em;
    text-align: center;
}

.option-label:hover {
    border-color: var(--secondary-color);
    background: var(--bg-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.option-label input[type="radio"] {
    margin-bottom: 6px;
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.option-label.selected {
    border-color: var(--primary-color);
    background: var(--bg-light);
    font-weight: 600;
    box-shadow: var(--shadow);
}

.option-text {
    display: block;
    line-height: 1.3;
    color: var(--text-medium);
}

.option-label.selected .option-text {
    color: var(--primary-color);
}

/* Progress Bar */
.progress-section {
    position: sticky;
    top: 0;
    background: white;
    padding: 25px 0;
    margin-bottom: 25px;
    border-bottom: 3px solid var(--border-color);
    z-index: 100;
    box-shadow: var(--shadow);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.progress-text {
    color: var(--text-medium);
    font-size: 1em;
    font-weight: 500;
}

.progress-text strong {
    color: var(--primary-color);
    font-size: 1.2em;
}

.unanswered-count {
    color: var(--warning-color);
    font-weight: 600;
    font-size: 0.95em;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    transition: width 0.4s ease;
    border-radius: 12px;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 16px 38px;
    border: none;
    border-radius: 6px;
    font-size: 1.05em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    font-family: inherit;
    letter-spacing: 0.5px;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(61, 48, 33, 0.2);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    background: var(--accent-color);
}

.btn-secondary {
    background: var(--bg-white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--bg-light);
    transform: translateY(-1px);
}

.navigation-buttons {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin-top: 35px;
}

/* Results Section */
.results-container {
    max-width: 800px;
    margin: 0 auto;
}

.results-container h3 {
    font-size: 2.2em;
    color: var(--primary-color);
    margin-bottom: 15px;
    text-align: center;
    font-weight: 400;
}

#profileName {
    display: block;
    font-size: 1.4em;
    color: var(--secondary-color);
    margin-top: 12px;
    margin-bottom: 40px;
    font-weight: 600;
    text-align: center;
}

.profiles-intro {
    margin-bottom: 35px;
    padding: 25px;
    background: linear-gradient(135deg, #FFF8E7 0%, #F5F3EE 100%);
    border-left: 4px solid var(--warning-color);
    border-radius: 8px;
}

.profile-card {
    text-align: left;
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-white) 100%);
    padding: 35px;
    border-radius: 12px;
    margin: 30px 0;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--border-color);
}

.profile-card.main-profile {
    border: 3px solid var(--primary-color);
    background: linear-gradient(135deg, #FEFEFE 0%, #F5F3EE 100%);
}

.profile-rank {
    font-size: 0.95em;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-weight: 600;
}

.profile-title {
    font-size: 1.8em;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-weight: 600;
}

.profile-score {
    font-size: 1.2em;
    color: var(--text-medium);
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.profile-content {
    line-height: 1.9;
}

#profileDescription {
    text-align: left;
}

#profileDescription h4 {
    color: var(--primary-color);
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 1.4em;
    font-weight: 500;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px;
}

#profileDescription h4:first-child {
    margin-top: 0;
}

#profileDescription p {
    color: var(--text-light);
    margin-bottom: 18px;
    font-size: 1.05em;
}

#profileDescription ul {
    padding-left: 28px;
    margin-bottom: 20px;
}

#profileDescription li {
    color: var(--text-light);
    margin-bottom: 12px;
    font-size: 1.02em;
    line-height: 1.7;
}

#profileDescription strong {
    color: var(--primary-color);
    font-weight: 600;
}

.cta-box {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--bg-white);
    padding: 45px;
    border-radius: 8px;
    margin-top: 45px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.cta-box h4 {
    font-size: 1.7em;
    margin-bottom: 18px;
    font-weight: 400;
}

.cta-box p {
    margin-bottom: 28px;
    opacity: 0.95;
    font-size: 1.08em;
    line-height: 1.7;
}

.cta-box .btn-primary {
    background: var(--bg-white);
    color: var(--primary-color);
}

.cta-box .btn-primary:hover {
    background: var(--bg-light);
}

/* Loading */
.loading {
    text-align: center;
    padding: 70px 20px;
}

.spinner {
    border: 5px solid var(--border-color);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 0 auto 25px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: var(--text-light);
    font-size: 1.1em;
}

/* Footer */
footer {
    background: var(--bg-light);
    padding: 35px;
    text-align: center;
    color: var(--text-light);
    font-size: 0.95em;
    border-top: 2px solid var(--border-color);
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

footer a:hover {
    text-decoration: underline;
    color: var(--secondary-color);
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    main {
        padding: 30px 20px;
    }

    .logo h1 {
        font-size: 2.2em;
    }

    .intro-section h2 {
        font-size: 1.7em;
    }

    .navigation-buttons {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        text-align: center;
    }

    .options-container {
        padding-left: 0;
        flex-wrap: wrap;
    }

    .option-label {
        font-size: 0.75em;
        padding: 8px 4px;
    }

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

    .question-number {
        margin-bottom: 6px;
    }

    .progress-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    #profileDescription {
        padding: 25px;
    }

    #profileDescription h4 {
        font-size: 1.2em;
    }

    .chart-bar-label {
        width: 150px;
        flex-shrink: 0;
        font-size: 0.85em;
    }

    .chart-container {
        padding: 25px 20px;
    }

    .chart-title {
        font-size: 1.3em;
    }
}

@media (max-width: 480px) {
    .option-label {
        min-width: 45px;
    }
    
    .option-text {
        font-size: 0.9em;
    }

    .logo h1 {
        font-size: 1.8em;
    }

    header {
        padding: 30px 20px;
    }

    .chart-bar-label {
        width: 110px;
        flex-shrink: 0;
        font-size: 0.75em;
    }

    .chart-bar-row {
        gap: 8px;
    }

    .chart-bar-value {
        font-size: 0.75em;
    }

    .chart-container {
        padding: 20px 15px;
    }
}
