body {
    font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background: #f4f5f7;
    margin: 0;
    padding: 20px;
    color: #1f2937;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

.card.intro {
    background: white;
    border-radius: 10px;
    padding: 32px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

h1 { font-size: 1.5rem; margin-top: 0; }
h2 { font-size: 1.15rem; margin: 20px 0 12px; }

.btn-primary, .btn-choice {
    background: #2563eb;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
}
.btn-primary:hover, .btn-choice:hover { background: #1d4ed8; }

.btn-secondary {
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
}
.btn-secondary:hover { background: #f3f4f6; }

.progress {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 4px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 20px;
}
.progress-bar-fill { height: 100%; background: #2563eb; }

/* Profil / vignette */
.profil-texte {
    font-size: 1rem;
    line-height: 1.6;
    background: #f9fafb;
    border-left: 3px solid #2563eb;
    padding: 14px 16px;
    border-radius: 4px;
}
.profil-consigne { font-size: 0.88rem; color: #6b7280; }

.profil-rappel {
    background: white;
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    font-size: 0.85rem;
}
.profil-rappel summary {
    cursor: pointer;
    font-weight: 600;
    color: #374151;
}
.profil-rappel p { color: #4b5563; line-height: 1.5; margin: 10px 0 2px; }
.profil-card { margin-bottom: 16px; }

/* Table de carte de choix */
.choice-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.choice-table th, .choice-table td {
    padding: 12px 14px;
    text-align: center;
    border-bottom: 1px solid #eee;
}
.choice-table thead th { background: #111827; color: white; font-size: 0.95rem; }
.choice-table .attr-col {
    text-align: left;
    font-weight: 600;
    color: #374151;
    background: #f9fafb;
    width: 30%;
}
.level-detail {
    display: inline-block;
    margin-top: 3px;
    font-size: 0.78rem;
    color: #6b7280;
    font-weight: 400;
    line-height: 1.3;
}

.choix-row td { padding-top: 16px; }
.cellule-radio-large {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 14px;
    margin: -14px;
    cursor: pointer;
}
.cellule-radio-large input[type="radio"] { width: 22px; height: 22px; cursor: pointer; }

/* Bloc certitude / échelle */
.certitude-block {
    background: white;
    border-radius: 8px;
    padding: 16px 18px;
    margin-top: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.certitude-question { font-weight: 600; margin: 0 0 16px; font-size: 0.95rem; }

.slider-wrap { position: relative; padding-top: 26px; }

.certitude-slider {
    --fill: 0%;
    --n-intervals: 9; /* écrasé en ligne selon (max - min) de chaque jauge */
    width: 100%;
    height: 22px;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
    background:
        repeating-linear-gradient(to right,
            transparent 0, transparent calc(100% / var(--n-intervals) - 1px),
            #9ca3af calc(100% / var(--n-intervals) - 1px), #9ca3af calc(100% / var(--n-intervals))),
        linear-gradient(to right,
            #4a90d9 0%, #4a90d9 var(--fill),
            #ffffff var(--fill), #ffffff 100%);
    border: 1px solid #6b7280;
    border-radius: 4px;
    cursor: pointer;
    outline: none;
}
.certitude-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 3px;
    height: 22px;
    background: #1f2937;
    border-radius: 1px;
    cursor: pointer;
}
.certitude-slider::-moz-range-thumb {
    width: 3px;
    height: 22px;
    background: #1f2937;
    border: none;
    border-radius: 1px;
    cursor: pointer;
}
.certitude-slider::-moz-range-track { background: transparent; border: none; }

.certitude-badge {
    position: absolute;
    top: 0;
    left: 0;
    transform: translateX(-50%);
    font-weight: 700;
    font-size: 0.95rem;
    color: #1a4fe0;
    pointer-events: none;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    color: #1a4fe0;
    font-weight: 600;
    margin-top: 4px;
}
.slider-labels-graduees {
    position: relative;
    height: 18px;
    font-size: 0.78rem;
    font-weight: 600;
    display: block;
}
.graduation-clic {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    cursor: pointer;
    padding: 4px 5px;
    border-radius: 4px;
    white-space: nowrap;
}
.graduation-clic:hover {
    background: #eff6ff;
    color: #1a4fe0;
}
.slider-hint { font-size: 0.82rem; color: #6b7280; margin-top: 10px; }
.slider-hint-erreur { color: #b91c1c; font-weight: 600; }

.nav-buttons { display: flex; justify-content: space-between; margin-top: 20px; }

/* Questionnaire générique */
.quest-card {
    background: white;
    border-radius: 10px;
    padding: 32px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.quest-intro { font-size: 0.88rem; color: #6b7280; margin-bottom: 4px; }
.hint-multiple { color: #1a4fe0; font-size: 0.95rem; font-weight: 600; }
.label-detail-normal { font-weight: 400; color: inherit; }

.cellule-radio {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
    margin: -12px;
    cursor: pointer;
}
.cellule-radio input[type="radio"] { width: 20px; height: 20px; cursor: pointer; }

.option-list { list-style: none; padding: 0; margin: 16px 0; }
.option-list li { margin-bottom: 10px; }
.option-list label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
}
.option-list label:hover { background: #f9fafb; }
.option-list input[type="radio"], .option-list input[type="checkbox"] {
    width: 19px;
    height: 19px;
    cursor: pointer;
    flex-shrink: 0;
}

.autre-input {
    margin-top: 6px;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    width: 60%;
    display: block;
}

input[type="number"] {
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    width: 140px;
    margin-right: 8px;
}
select {
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
}

.champ-label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin: 16px 0 6px;
}
.champ-label:first-of-type { margin-top: 0; }

#geo_input {
    width: 100%;
    max-width: 420px;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
    display: block;
    margin-top: 8px;
}

.erreur {
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 14px;
    font-size: 0.9rem;
}

.likert-table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.likert-table th, .likert-table td {
    text-align: center;
    padding: 8px 6px;
    font-size: 0.82rem;
    border-bottom: 1px solid #f0f0f0;
}
.likert-table td.statement { text-align: left; font-size: 0.92rem; width: 34%; }
.likert-table thead th { color: #6b7280; font-weight: 500; }

/* Format Oui/Non explicite (AIDDOM_AID) */
.oui-non-ligne {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
.oui-non-label { flex: 1; }
.oui-non-choix { display: flex; gap: 8px; white-space: nowrap; }
.oui-non-choix label {
    display: flex; align-items: center; gap: 6px; cursor: pointer;
    padding: 8px 10px; border-radius: 6px;
}
.oui-non-choix label:hover { background: #f9fafb; }
.oui-non-choix input[type="radio"] { width: 19px; height: 19px; cursor: pointer; }

/* Bulle d'information (GIR, services...) */
.info-bulle {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 8px 14px;
    margin-bottom: 16px;
    font-size: 0.85rem;
}
.info-bulle summary {
    cursor: pointer;
    font-weight: 600;
    color: #1a4fe0;
}
.info-bulle p { color: #374151; line-height: 1.5; margin: 10px 0 2px; }

.consent-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 18px 0;
    font-size: 0.95rem;
    line-height: 1.5;
    cursor: pointer;
}
.consent-label input[type="checkbox"] {
    width: 19px; height: 19px; flex-shrink: 0; margin-top: 2px; cursor: pointer;
}
#consent_btn:disabled { opacity: 0.5; cursor: not-allowed; }

.intro-liste { line-height: 1.6; }
.profil-rappel ul { margin: 8px 0 0; padding-left: 20px; color: #4b5563; line-height: 1.5; }

.choice-table td { vertical-align: top; }
.choice-table .niveau-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    height: 100%;
}
.niveau-texte { display: block; }

.level-picto-img {
    display: block;
    margin: 0 auto;
    height: 70px;
    width: auto;
}

.attr-info {
    display: inline-block;
    margin-left: 6px;
    vertical-align: middle;
}
.attr-info summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #1a4fe0;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    font-style: italic;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.attr-info summary::-webkit-details-marker { display: none; }
.attr-info summary:hover { background: #1440c0; }
.attr-info p {
    margin: 8px 0 0;
    font-size: 0.82rem;
    font-weight: 400;
    color: #374151;
    line-height: 1.5;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 8px 10px;
}

.consentement {
    background: #f9fafb;
    border-left: 3px solid #1a4fe0;
    margin: 16px 0;
    padding: 4px 18px;
    border-radius: 4px;
}
.consentement p { font-size: 0.92rem; line-height: 1.6; }

.rank-list { list-style: none; padding: 0; margin: 16px 0; }
.rank-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    cursor: grab;
}
.rank-item.rank-dragging { opacity: 0.4; background: #eff6ff; }
.rank-handle { color: #9ca3af; font-size: 1.1rem; flex-shrink: 0; }
.rank-texte { flex: 1; font-size: 0.95rem; }
.rank-arrows { display: flex; flex-direction: column; gap: 2px; flex-shrink: 0; }
.rank-arrows button {
    border: 1px solid #d1d5db;
    background: #f9fafb;
    border-radius: 4px;
    width: 26px;
    height: 22px;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0;
}
.rank-arrows button:hover { background: #eff6ff; color: #1a4fe0; }

.texte-libre {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
}
