/* =========================================================================
   Resurgo – Auto-diagnostic managérial
   Palette pilotée par variables CSS (modifiables depuis le back-office).
   ========================================================================= */
:root {
	--rad-title:    #2f6b4f; /* titres */
	--rad-text:     #243733; /* texte courant */
	--rad-muted:    #6b7d76; /* texte secondaire */
	--rad-btn-bg:   #2f6b4f; /* fond des boutons */
	--rad-btn-text: #ffffff; /* texte des boutons */
	--rad-accent:   #c8772f; /* accent et liens */
	--rad-soft:     #e6efe8; /* surbrillances / fonds doux */
	--rad-border:   #e4ddd0; /* bordures */
	--rad-field:    #fbf8f3; /* fond des champs */
	--rad-ink:      #243733; /* alias texte (radar) */
	--rad-radius:   14px;
	--rad-shadow:   0 6px 24px rgba(36,55,51,0.08);
}

.rad-app {
	max-width: 980px;
	margin: 0 auto;
	color: var(--rad-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	line-height: 1.55;
}
.rad-app * { box-sizing: border-box; }

/* Messages flash */
.rad-flash { padding: 12px 16px; border-radius: var(--rad-radius); margin-bottom: 18px; font-size: 14px; }
.rad-flash--success { background: var(--rad-soft); color: var(--rad-title); }
.rad-flash--error   { background: #fbe6e0; color: #a8431f; }
.rad-flash--info    { background: #eef3f7; color: #2c5470; }

/* Légende des grandes familles (sous la toile d'araignée) */
.rad-family-legend {
	display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
	justify-content: center; margin-top: 14px; padding-top: 14px;
	border-top: 1px solid var(--rad-border); font-size: 14px;
}
.rad-family-legend-label { color: var(--rad-muted); font-weight: 600; }
.rad-family-chip { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; color: var(--rad-text); }
.rad-family-dot { width: 13px; height: 13px; border-radius: 50%; display: inline-block; }

/* Cartes */
.rad-card {
	background: #fff; border: 1px solid var(--rad-border); border-radius: var(--rad-radius);
	padding: 24px; box-shadow: var(--rad-shadow); margin-bottom: 20px;
}
h2, h3 { color: var(--rad-title); }
.rad-muted { color: var(--rad-muted); }

/* Boutons & liens */
.rad-btn {
	display: inline-block; cursor: pointer; font-size: 12px; font-weight: 400;
	padding: 12px 22px; border-radius: 0; text-decoration: none; text-transform: uppercase;
	letter-spacing: .3px; border: 1px solid transparent; transition: all .15s ease;
}
.rad-btn--primary { background: var(--rad-btn-bg); color: var(--rad-btn-text); }
.rad-btn--outline { background: #fff; color: #cc3301; border-color: var(--rad-btn-bg); }
.rad-btn--lg { padding: 15px 28px; font-size: 13px; }
.rad-btn:hover { background: #fff; color: #cc3301; border-color: #d4bfa3; box-shadow: 0 3px 12px rgba(36,55,51,.14); transform: translateY(-1px); }
.rad-link { background: none; border: none; color: var(--rad-accent); cursor: pointer; text-decoration: underline; font-size: 14px; padding: 0; }
.rad-link:hover { filter: brightness(0.9); }

/* Formulaires */
.rad-form label, .rad-quiz-meta label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 14px; color: var(--rad-text); }
.rad-form input[type=text], .rad-form input[type=email], .rad-form input[type=password],
.rad-quiz-meta input[type=text], .rad-app select {
	width: 100%; margin-top: 5px; padding: 11px 13px; border: 1px solid var(--rad-border);
	border-radius: 10px; font-size: 15px; font-weight: 400; background: var(--rad-field);
}
.rad-form input:focus, .rad-app select:focus { outline: none; border-color: var(--rad-title); background: #fff; }
.rad-row { display: flex; gap: 16px; }
.rad-row > label { flex: 1; }
.rad-check { display: flex; align-items: flex-start; gap: 10px; font-weight: 400 !important; font-size: 13px; }
.rad-check input { margin-top: 3px; }
.rad-auth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* Tableau de bord */
.rad-dash-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 16px; }
.rad-table { width: 100%; border-collapse: collapse; margin: 12px 0 24px; font-size: 14px; }
.rad-table th, .rad-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rad-border); }
.rad-table th { color: var(--rad-title); font-size: 13px; text-transform: uppercase; letter-spacing: .4px; }

/* Tableau « Mes auto-diagnostics » : renommer + supprimer */
.rad-rename { display: flex; gap: 6px; align-items: center; margin: 0; width: 100%; }
.rad-rename input[type="text"] { flex: 1 1 auto; width: auto; min-width: 0; padding: 8px 11px; border: 1px solid var(--rad-border); border-radius: 6px; background: var(--rad-field); font-size: 14px; }
.rad-cell-view, .rad-cell-delete { white-space: nowrap; }
@media (min-width: 721px) { .rad-table--sessions th:first-child, .rad-table--sessions td:first-child { width: 42%; } }
.rad-cell-delete { text-align: center; }
.rad-delete { display: inline; margin: 0; }
/* Boutons-icônes : pas de fond ni de bordure (on neutralise aussi le style de bouton du thème) */
.rad-icon-btn {
	background: none !important; background-color: transparent !important;
	border: 0 !important; box-shadow: none !important; outline: none;
	padding: 4px !important; margin: 0; min-width: 0 !important; min-height: 0 !important; height: auto !important; width: auto !important;
	cursor: pointer; line-height: 0; border-radius: 6px;
	color: var(--rad-muted); display: inline-flex; align-items: center; justify-content: center;
	transition: color .15s ease;
}
.rad-icon-btn:hover, .rad-icon-btn:focus { background: none !important; background-color: transparent !important; }
.rad-icon-btn--save { color: #2f6b4f; }
.rad-icon-btn--save:hover { color: #1f4d33; }
.rad-icon-btn--danger:hover { color: #cc3301; }
.rad-row-actions { display: flex; gap: 14px; align-items: center; white-space: nowrap; }
.rad-delete { display: inline; margin: 0; }
.rad-link--danger { color: #cc3301; }
.rad-link--danger:hover { filter: brightness(.9); }
.rad-compare-box { margin-top: 8px; }

/* Questionnaire */
.rad-theme-block { margin-bottom: 30px; }
.rad-theme-title { background: var(--rad-title); color: #fff !important; padding: 12px 20px; border-radius: 6px; font-size: 20px; letter-spacing: .5px; text-transform: uppercase; }
.rad-sous-block { padding: 8px 4px 10px; }
.rad-sous-title { color: var(--rad-accent); border-bottom: 2px solid var(--rad-border); padding-bottom: 7px; font-size: 22px; font-weight: 700; margin: 18px 0 10px; }
.rad-question { padding: 14px 0; border-bottom: 1px dashed var(--rad-border); }
.rad-q-label { margin: 0 0 10px; font-size: 15px; }
.rad-q-num { color: var(--rad-muted); font-weight: 700; margin-right: 4px; }
.rad-q-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rad-radio {
	display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
	padding: 10px 6px; border: 1px solid var(--rad-border); border-radius: 10px; cursor: pointer;
	background: var(--rad-field); transition: all .12s ease; font-size: 12px;
}
.rad-radio:hover { border-color: var(--rad-title); }
.rad-radio input { accent-color: var(--rad-title); }
.rad-radio-num { font-weight: 700; color: var(--rad-title); font-size: 16px; }
.rad-radio-lab { color: var(--rad-muted); line-height: 1.2; }
.rad-radio:has(input:checked) { border-color: var(--rad-title); background: var(--rad-soft); }
.rad-submit-box { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.rad-progress { font-size: 14px; color: var(--rad-muted); font-weight: 600; }

/* En-tête de restitution (fiche admin + PDF) */
.rad-restit-head { margin: 4px 0 18px; padding-bottom: 12px; border-bottom: 2px solid var(--rad-soft); }
.rad-restit-name { font-size: 24px; margin: 0 0 4px; color: var(--rad-title); }
.rad-restit-meta { margin: 0; font-size: 14px; }

.rad-welcome { font-size: 18px; font-weight: 700; color: var(--rad-title); margin: 6px 0 4px; line-height: 1.4; }

/* Résultats */
.rad-chart-card { display: flex; justify-content: center; flex-direction: column; align-items: center; }
.rad-chart-wrap { position: relative; width: 100%; max-width: 720px; height: 600px; margin: 0 auto; }
.rad-chart-wrap canvas { display: block; }
.rad-two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.rad-block-title { display: flex; align-items: baseline; gap: 8px; border-bottom: 2px solid; padding-bottom: 8px; font-size: 17px; }
.rad-block-title small { font-weight: 400; color: var(--rad-muted); font-size: 13px; }
.rad-block-title--forces { color: var(--rad-title); border-color: var(--rad-title); }
.rad-block-title--axes   { color: var(--rad-accent); border-color: var(--rad-accent); }
.rad-grp { margin: 12px 0 16px; }
.rad-grp-theme { font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--rad-text); font-size: 19px; margin-bottom: 4px; }
.rad-grp-sous { font-weight: 600; color: var(--rad-title); margin: 6px 0 2px; }

/* Accordéon (Mes forces / Mes axes de travail) */
.rad-acc-wrap { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.rad-acc { border: 1px solid var(--rad-border); border-radius: 10px; overflow: hidden; background: #fff; }
.rad-acc > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 13px 16px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--fam); background: color-mix(in srgb, var(--fam) 8%, #fff); transition: background .15s ease; }
.rad-acc > summary::-webkit-details-marker { display: none; }
.rad-acc > summary:hover { background: color-mix(in srgb, var(--fam) 15%, #fff); }
.rad-acc-title { flex: 1; font-size: 15px; }
.rad-acc-count { flex: none; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: var(--fam); color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.rad-acc-chevron { flex: none; width: 10px; height: 10px; border-right: 2px solid var(--fam); border-bottom: 2px solid var(--fam); transform: rotate(45deg); transition: transform .2s ease; margin-left: 2px; }
.rad-acc[open] > summary .rad-acc-chevron { transform: rotate(-135deg); }
.rad-acc-body { padding: 6px 16px 14px; }
.rad-acc-body .rad-grp-sous:first-child { margin-top: 4px; }
@supports not (background: color-mix(in srgb, red 10%, white)) {
	.rad-acc > summary { background: var(--rad-soft); }
}
.rad-grp-list { list-style: none; margin: 0 0 8px; padding: 0; }
.rad-grp-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--rad-border); font-size: 14px; }
.rad-q-text { flex: 1; }
.rad-score-pill { flex: none; min-width: 26px; text-align: center; background: var(--rad-soft); color: var(--rad-title); border-radius: 999px; padding: 2px 8px; font-weight: 700; font-size: 13px; }
.rad-axes .rad-score-pill { background: #f6e6d8; color: var(--rad-accent); }
.rad-empty { font-style: italic; }
.rad-result-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.rad-up { color: var(--rad-title); }
.rad-down { color: var(--rad-accent); }

/* Responsive */
@media (max-width: 980px) {
	.rad-chart-wrap { height: 520px; }
}
@media (max-width: 720px) {
	.rad-auth-grid, .rad-two-cols { grid-template-columns: 1fr; }
	.rad-q-options { grid-template-columns: repeat(2, 1fr); }
	.rad-row { flex-direction: column; gap: 0; }
	.rad-chart-wrap { height: 460px; }

	/* En-tête : message d'accueil sur toute la largeur */
	.rad-dash-head { flex-direction: column; align-items: stretch; gap: 10px; }
	.rad-dash-head > div { width: 100%; }
	.rad-welcome { width: 100%; font-size: 19px; }
	.rad-logout { align-self: flex-end; }

	/* Tableau « Mes auto-diagnostics » : passage en cartes empilées. */
	.rad-table--sessions, .rad-table--sessions tbody, .rad-table--sessions tr, .rad-table--sessions td { display: block; width: 100%; }
	.rad-table--sessions thead { display: none; }
	.rad-table--sessions tr { border: 1px solid var(--rad-border); border-radius: 12px; padding: 6px 14px; margin-bottom: 14px; background: #fff; }
	.rad-table--sessions td { border: none; padding: 9px 0; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
	.rad-table--sessions td + td { border-top: 1px dashed var(--rad-border); }
	.rad-table--sessions td[data-label]:not([data-label=""])::before { content: attr(data-label); font-weight: 600; color: var(--rad-title); font-size: 13px; flex: none; }
	.rad-table--sessions .rad-rename { flex: 1; justify-content: flex-end; }
	.rad-table--sessions .rad-rename input[type="text"] { width: 100%; }
	.rad-cell-delete { justify-content: flex-end; }
}
@media (max-width: 520px) {
	.rad-q-options { grid-template-columns: 1fr; }
	.rad-chart-wrap { height: 430px; }
}
@media (max-width: 400px) {
	.rad-chart-wrap { height: 390px; }
}

/* Plan d'action : sur petit écran, on n'affiche pas le document (colonnes trop étroites) ;
   on propose le téléchargement PDF à la place. */
.rad-plan-mobile-note { display: none; }
.rad-plan-mobile-actions { display: none; }
@media (max-width: 760px) {
	.rad-plan-scroll { display: none; }
	.rad-plan-desktop-actions { display: none; }
	.rad-plan-mobile-note { display: block; text-align: center; background: var(--rad-soft); border-radius: 12px; padding: 20px 18px; margin: 6px 0 16px; }
	.rad-plan-mobile-note p { margin: 0 0 14px; color: var(--rad-text); }
	.rad-plan-mobile-actions { display: flex; }
}

/* =========================================================================
   Étape 3 — Sélection des axes + document « Mon plan d'action »
   ========================================================================= */
.rad-plan-select .rad-plan-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 14px 0; }
.rad-plan-choice-group { background: var(--rad-field); border: 1px solid var(--rad-border); border-radius: 10px; padding: 12px; }
.rad-plan-choice { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; font-weight: 400; margin: 8px 0 0; cursor: pointer; }
.rad-plan-choice input { margin-top: 3px; flex: none; }
.rad-plan-choice input:disabled + span { opacity: .45; }
.rad-plan-select-foot { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.rad-plan-counter { font-weight: 700; color: var(--rad-title); }
@media (max-width: 720px) { .rad-plan-select .rad-plan-choices { grid-template-columns: 1fr; } }

.rad-plan-page .rad-plan-scroll { overflow-x: auto; }
.rad-plan { background: #fff; padding: 6px 2px 2px; min-width: 820px; }
.rad-plan-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.rad-plan-title { background: #cfd4d5; color: #3a4144; font-weight: 700; font-size: 20px; padding: 12px 22px; border-radius: 6px; }
.rad-plan-headline { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.rad-plan-person { font-weight: 800; font-size: 18px; color: #cc3301; }
.rad-plan-identity { display: flex; gap: 22px; flex-wrap: wrap; font-size: 14px; color: var(--rad-text); }
.rad-plan-colhead { display: grid; grid-template-columns: 190px 1fr 1fr 1fr; font-weight: 700; color: #5b5b5b; font-size: 13px; margin-bottom: 6px; }
.rad-plan-colhead > div { padding: 0 14px; }
.rad-plan-row { display: grid; grid-template-columns: 190px 1fr 1fr 1fr; border: 1px solid #d9d9d9; border-radius: 12px; margin-bottom: 14px; min-height: 150px; overflow: hidden; }
.rad-plan-rowlabel { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 12px 8px; border-right: 1px dashed #cfcfcf; }
.rad-plan-rowlabel img { width: 124px; height: 124px; object-fit: contain; margin-bottom: 8px; }
.rad-plan-rowname { font-weight: 800; letter-spacing: .5px; font-size: 18px; color: var(--fam); }
.rad-plan-rowtag { font-size: 12px; color: var(--fam); margin-top: 2px; }
.rad-plan-cell { padding: 12px 14px; border-right: 1px dashed #cfcfcf; font-size: 14px; }
.rad-plan-cell:last-child { border-right: none; }
.rad-plan-cell--todo ul { margin: 0; padding-left: 18px; }
.rad-plan-cell--todo li { margin-bottom: 8px; }
.rad-plan-foot { display: flex; align-items: center; gap: 12px; margin-top: 10px; font-size: 12px; color: #cc3301; }
.rad-plan-foot img { height: 30px; width: auto; }

/* =========================================================================
   Espace formateur (front)
   ========================================================================= */
.rad-fo-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
.rad-fo-head h2 { margin: 0; }
.rad-fo-tabs { display: flex; gap: 8px; border-bottom: 2px solid var(--rad-border); margin-bottom: 18px; flex-wrap: wrap; }
.rad-fo-tab { padding: 10px 18px; text-decoration: none; font-weight: 700; color: var(--rad-muted); border-bottom: 3px solid transparent; margin-bottom: -2px; }
.rad-fo-tab:hover { color: var(--rad-title); }
.rad-fo-tab.is-active { color: var(--rad-title); border-bottom-color: var(--rad-accent); }
.rad-fo-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.rad-fo-filters input[type="search"], .rad-fo-filters select { padding: 8px 11px; border: 1px solid var(--rad-border); border-radius: 6px; background: var(--rad-field); font-size: 14px; }
.rad-fo-exports { display: flex; gap: 10px; flex-wrap: wrap; }
.rad-fo-rowactions { display: flex; gap: 14px; white-space: nowrap; }
.rad-fo-detail { margin-top: 6px; }
.rad-fo-login { max-width: 440px; }
.rad-auth-form { display: flex; flex-direction: column; gap: 14px; max-width: 380px; margin-top: 12px; }
.rad-auth-form label { font-weight: 600; color: var(--rad-title); font-size: 14px; }
.rad-auth-form input[type="email"], .rad-auth-form input[type="password"] { width: 100%; padding: 10px 12px; border: 1px solid var(--rad-border); border-radius: 8px; background: var(--rad-field); font-size: 15px; margin-top: 4px; }
.rad-auth-form .rad-checkbox { font-weight: 400; display: flex; gap: 8px; align-items: center; }
.rad-fo-addq { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.rad-fo-addq input[type="text"] { flex: 1 1 200px; min-width: 0; padding: 8px 11px; border: 1px solid var(--rad-border); border-radius: 6px; background: var(--rad-field); font-size: 14px; }
.rad-fo-qtable-wrap { overflow-x: auto; }
.rad-table--fo input[type="text"], .rad-table--fo textarea, .rad-table--fo input[type="number"] { width: 100%; padding: 6px 8px; border: 1px solid var(--rad-border); border-radius: 6px; background: var(--rad-field); font-size: 13px; font-family: inherit; }
.rad-fo-qtable { min-width: 860px; }
.rad-fo-qtable td { vertical-align: top; }
@media (max-width: 720px) {
	.rad-fo-head { flex-direction: column; }
	.rad-fo-filters, .rad-fo-exports { width: 100%; }
}
.rad-admin .rad-admin-filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; align-items: center; }
.rad-admin-add { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 24px; }
.rad-admin-add input { padding: 6px 10px; }
.rad-admin-add .rad-wide, .rad-admin-table .rad-wide { min-width: 320px; width: 100%; }
.rad-admin-table input[type=text], .rad-admin-table textarea { width: 100%; }
.rad-admin-table textarea { font-family: inherit; }
.rad-colors-table code { background: #f0f0f1; padding: 2px 6px; border-radius: 4px; }
