/* ==========================================================================
   Resurgo Diagnostic — styles front
   Tout est scopé sous .rd-app pour ne pas entrer en conflit avec le thème.
   ========================================================================== */

/* ---------- Police Raleway (auto-hébergée, sans CDN externe) ---------- */
@font-face { font-family: "Raleway"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/raleway-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Raleway"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/raleway-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Raleway"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/raleway-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Raleway"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/raleway-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Raleway"; font-style: italic; font-weight: 600; font-display: swap; src: url("../fonts/raleway-latin-600-italic.woff2") format("woff2"); }
@font-face { font-family: "Raleway"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/raleway-latin-700-normal.woff2") format("woff2"); }

/* ---------- Onglets ---------- */
.rd-tabs { max-width: 880px; margin: 0 auto; }
.rd-tabs__list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 auto 14px; padding: 0 4px; }
.rd-tab {
	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size: 15px; font-weight: 700; cursor: pointer;
	padding: 10px 20px; border-radius: 999px;
	border: 1px solid #e2e2e2; background: #fff; color: #555;
	transition: background .15s, color .15s, border-color .15s;
}
.rd-tab:hover { border-color: #15807d; color: #15807d; }
.rd-tab.is-active { background: #15807d; border-color: #15807d; color: #fff; }
.rd-tab:focus-visible { outline: 2px solid #15807d; outline-offset: 2px; }
.rd-tabs__panel[hidden] { display: none; }

.rd-results__subtitle { text-align: center; font-size: 15px; font-weight: 600; color: #15807d; margin: 2px 0 0; }

.rd-app {
	--rd-ink: #2b2b2b;
	--rd-muted: #000000;
	--rd-raleway: "Raleway", "Helvetica Neue", Helvetica, Arial, sans-serif;
	--rd-line: #e2e2e2;
	--rd-soft: #f5f4f1;
	--rd-teal: #15807d;
	--rd-radius: 14px;
	max-width: 880px;
	margin: 0 auto;
	padding: 36px 34px 26px;
	background: #fff;
	border: 1px solid var(--rd-line);
	border-radius: 22px;
	box-shadow: 0 18px 50px -28px rgba(0, 0, 0, .25);
	color: var(--rd-ink);
	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
	line-height: 1.5;
	box-sizing: border-box;
}
.rd-app *,
.rd-app *::before,
.rd-app *::after { box-sizing: border-box; }

/* L'attribut hidden doit toujours l'emporter (la partie « Vos résultats »
   reste masquée tant que l'utilisateur n'a pas cliqué sur « Voir mes résultats »,
   même si le thème force un display sur les sections). */
.rd-app [hidden] { display: none !important; }

/* ---------- En-tête ---------- */
.rd-head { text-align: center; margin-bottom: 22px; }
.rd-kicker {
	display: inline-block;
	font-size: 11px;
	letter-spacing: .18em;
	text-transform: uppercase;
	color: #fff;
	background: #9c9c9c;
	padding: 4px 12px;
	border-radius: 20px;
	margin: 0 0 14px;
}
.rd-title {
	font-size: clamp(24px, 4vw, 34px);
	font-weight: 800;
	margin: 0 0 6px;
	color: var(--rd-ink);
	line-height: 1.15;
}
.rd-subtitle { font-size: 19px; font-weight: 600; margin: 0 0 8px; color: #444; }
.rd-hint { font-family: var(--rd-raleway); font-size: 14px; color: var(--rd-muted); margin: 0; }

/* ---------- Identité ---------- */
.rd-identity {
	display: grid;
	grid-template-columns: 1fr 1fr 0.8fr;
	gap: 14px;
	margin: 0 0 30px;
	padding: 18px;
	background: var(--rd-soft);
	border-radius: var(--rd-radius);
}
.rd-field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.rd-field > span { font-weight: 600; color: #555; }
.rd-app input[type="text"],
.rd-app input[type="email"],
.rd-app textarea {
	width: 100%;
	font: inherit;
	color: #000;
	background: #fff;
	border: 1px solid var(--rd-line);
	border-radius: 9px;
	padding: 10px 12px;
}
.rd-app input:focus,
.rd-app textarea:focus,
.rd-app [data-track]:focus-visible,
.rd-app .rd-btn:focus-visible {
	outline: 3px solid rgba(21, 128, 125, .35);
	outline-offset: 2px;
	border-color: var(--rd-teal);
}

/* ---------- Bloc ---------- */
.rd-block {
	padding: 26px 6px 30px;
	border-top: 1px solid var(--rd-line);
}
.rd-block:first-of-type { border-top: none; }

.rd-block__head {
	display: grid;
	grid-template-columns: 56px 1fr 56px;
	align-items: center;
	gap: 14px;
	margin-bottom: 18px;
}
.rd-totem { color: var(--rd-accent); display: flex; justify-content: center; }
.rd-totem--neg { justify-content: flex-start; }
.rd-totem--pos { justify-content: flex-end; }
.rd-totem-img { max-height: 88px; max-width: 100%; width: auto; height: auto; display: block; }

/* Illustrations de groupe agrandies (onglets « Mon collectif » et « Ensemble ») */
[data-panel="collectif"] .rd-block__head,
[data-panel="ensemble"] .rd-block__head {
	grid-template-columns: 108px 1fr 108px;
	gap: 18px;
}
[data-panel="collectif"] .rd-totem-img,
[data-panel="ensemble"] .rd-totem-img {
	max-height: 128px;
}

.rd-block__titles {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	text-align: center;
}
.rd-pole { display: flex; flex-direction: column; gap: 2px; }
.rd-pole__label {
	font-size: clamp(17px, 2.4vw, 22px);
	font-weight: 800;
	letter-spacing: .02em;
	text-transform: uppercase;
	color: var(--rd-accent-ink);
}
.rd-pole__desc { font-size: 13px; color: #000; }

/* ---------- Échelle ---------- */
.rd-scale {
	display: flex;
	align-items: center;
	gap: 8px;
	max-width: 560px;
	margin: 0 auto 16px;
}
.rd-scale__chev { color: #b8b8b8; font-size: 22px; line-height: 1; }
.rd-scale__track {
	position: relative;
	flex: 1;
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 8px 4px;
	border-radius: 12px;
	cursor: pointer;
	touch-action: none;
}
.rd-scale__line {
	position: absolute;
	left: 14px; right: 14px; top: 50%;
	height: 2px;
	background: var(--rd-line);
	transform: translateY(-50%);
	z-index: 0;
}
.rd-stop {
	position: relative;
	z-index: 1;
	appearance: none;
	border: none;
	background: transparent;
	width: 30px; height: 30px;
	border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	cursor: pointer;
	font: inherit;
	color: #8a8a8a;
	font-size: 13px;
	font-weight: 600;
	transition: background-color .12s ease, color .12s ease, transform .12s ease;
}
.rd-stop:hover { background: rgba(0,0,0,.05); }
.rd-stop__num { pointer-events: none; }
/* Le « petit rond » sélectionné */
.rd-stop.is-selected {
	background: var(--rd-accent);
	color: #fff;
	transform: scale(1.18);
	box-shadow: 0 4px 12px -3px rgba(0,0,0,.4);
}
.rd-block.is-untouched .rd-scale__track { background: rgba(0,0,0,.015); }

/* ---------- Pourquoi ---------- */
.rd-why { display: block; max-width: 620px; margin: 0 auto; }
.rd-why__label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: #555; }
.rd-why__label em { font-family: var(--rd-raleway); font-weight: 400; color: var(--rd-muted); font-style: italic; }
.rd-why textarea {
	resize: vertical;
	min-height: 60px;
	background:
		repeating-linear-gradient(to bottom, transparent 0 27px, var(--rd-line) 27px 28px);
	line-height: 28px;
	padding-top: 6px;
}

/* ---------- Boutons ---------- */
.rd-form__actions { text-align: center; margin-top: 14px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.rd-btn {
	appearance: none;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	border: 1px solid var(--rd-teal);
	background: #fff;
	color: var(--rd-teal);
	padding: 12px 22px;
	border-radius: 10px;
	transition: background-color .15s ease, color .15s ease, opacity .15s ease;
}
.rd-btn:hover { background: rgba(21,128,125,.08); }
.rd-btn--primary { background: var(--rd-teal); color: #fff; }
.rd-btn--primary:hover { background: #0f6361; }
.rd-btn--ghost { border-color: var(--rd-line); color: #777; }
.rd-btn--ghost:hover { background: var(--rd-soft); }
.rd-btn[disabled] { opacity: .5; cursor: not-allowed; }

.rd-form__error {
	text-align: center;
	color: #c0392b;
	font-weight: 600;
	margin: 12px 0 0;
}

/* ---------- Résultats ---------- */
.rd-results { animation: rd-fade .35s ease; }
@keyframes rd-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.rd-head--results { margin-bottom: 18px; }
.rd-results__meta { font-size: 15px; color: #555; margin: 4px 0 0; font-weight: 600; }

.rd-results__list { display: flex; flex-direction: column; gap: 16px; }
/* Pagination PDF : on ne coupe jamais à l'intérieur de ces blocs. */
.rd-pdf-logo, .rd-head--results, .rd-result-card, .rd-brand {
	break-inside: avoid; page-break-inside: avoid;
}
.rd-result-card {
	border: 1px solid var(--rd-line);
	border-left: 5px solid var(--rd-accent);
	border-radius: var(--rd-radius);
	padding: 18px 20px;
	background: #fff;
}
.rd-result-card__poles {
	font-size: 12px;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--rd-accent-ink);
	font-weight: 700;
	margin: 0 0 6px;
}
.rd-result-card__band { font-size: 17px; font-weight: 800; margin: 0 0 2px; color: var(--rd-ink); }
.rd-result-card__score { font-family: var(--rd-raleway); font-size: 14px; color: var(--rd-muted); font-weight: 600; }
.rd-result-card__scale {
	display: flex; gap: 4px; margin: 10px 0 14px; flex-wrap: wrap;
}
.rd-pill {
	width: 26px; height: 26px; border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	font-size: 11px; font-weight: 600;
	background: var(--rd-soft); color: #aaa;
}
.rd-pill.is-on { background: var(--rd-accent); color: #fff; }
.rd-result-card__analysis {
	background: color-mix(in srgb, var(--rd-accent) 8%, #fff);
	border-radius: 10px;
	padding: 14px 16px;
	font-size: 15px;
	line-height: 1.55;
	color: #000;
}
.rd-result-card__why {
	margin: 12px 0 0; font-size: 14px; color: #555;
	border-top: 1px dashed var(--rd-line); padding-top: 10px;
}
.rd-result-card__why strong { color: var(--rd-accent-ink); }

.rd-results__disclaimer {
	font-size: 13px; color: #fff; font-weight: 600;
	background: #c0392b; border-radius: 10px;
	padding: 14px 18px; margin: 20px 0;
}

.rd-actions {
	display: flex; flex-direction: column; gap: 16px;
	padding-top: 6px;
}
.rd-actions__group {
	display: flex; flex-direction: column; gap: 10px;
	padding: 16px; border: 1px solid var(--rd-line); border-radius: var(--rd-radius);
}
.rd-actions__group .rd-btn { align-self: flex-start; }
.rd-field--inline { font-size: 14px; }
.rd-consent {
	display: flex; gap: 10px; align-items: flex-start;
	font-size: 13px; color: #000; line-height: 1.45;
}
.rd-consent input { margin-top: 3px; flex: none; }
.rd-feedback { font-size: 14px; font-weight: 600; min-height: 20px; margin: 4px 0 0; }
.rd-feedback.is-error { color: #c0392b; }
.rd-feedback.is-ok { color: var(--rd-teal); }

/* ---------- Marque / pied ---------- */
/* Logo en haut de la version imprimable (PDF), centré.
   Masqué sur la version en ligne ; révélé uniquement dans le PDF et à l'impression. */
.rd-pdf-logo { display: none; text-align: center; margin: 0 auto 16px; }
.rd-printing .rd-pdf-logo { display: block; }
.rd-pdf-logo__img { max-height: 150px; width: auto; }

/* Pied (coordonnées) de la version imprimable, centré.
   Masqué en ligne ; révélé uniquement dans le PDF et à l'impression. */
.rd-brand {
	display: none; align-items: center; justify-content: center; text-align: center;
	margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--rd-line);
}
.rd-printing .rd-brand { display: flex; }
.rd-brand__site { font-size: 12px; font-weight: 700; color: #c0392b; }
.rd-brand__wordmark { text-align: right; line-height: 1.05; }
.rd-brand__wordmark--center { display: inline-block; text-align: center; }
.rd-brand__name { display: block; font-size: 24px; font-weight: 800; color: #c0392b; letter-spacing: .01em; }
.rd-brand__macron { font-weight: 800; }
.rd-brand__school { display: block; font-size: 15px; font-weight: 700; letter-spacing: .28em; color: var(--rd-teal); }
.rd-brand__tag { display: block; font-size: 9px; letter-spacing: .22em; text-transform: uppercase; color: #999; }

/* ---------- Responsive ---------- */
/* ---------- Écran objectifs : roue « perspective » ---------- */
.rd-wheel-wrap { position: relative; width: 100%; max-width: 600px; aspect-ratio: 1 / 1; margin: 10px auto 6px; }
.rd-wheel-bg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.rd-wheel-sector {
	position: absolute; transform: translate(-50%, -50%); width: 30%;
	display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px;
}
.rd-wheel-sector__fig {
	position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
	width: 62px; height: 62px; object-fit: contain; opacity: .13; z-index: 0; pointer-events: none;
}
.rd-wheel-sector__verb { position: relative; z-index: 1; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--rd-accent); font-size: 15px; line-height: 1.1; }
.rd-wheel-sector__phrase { position: relative; z-index: 1; font-style: italic; font-size: 12px; line-height: 1.2; color: var(--rd-accent-ink); }
.rd-wheel-sector__input {
	position: relative; z-index: 1; width: 100%; box-sizing: border-box; margin-top: 2px;
	border: 1px solid var(--rd-accent); border-radius: 8px; background: rgba(255, 255, 255, .82);
	padding: 6px 8px; font: inherit; font-size: 13px; line-height: 1.35; color: #000; resize: none; text-align: center;
}
.rd-wheel-sector__input:focus { outline: 2px solid var(--rd-accent); outline-offset: 1px; background: #fff; }
.rd-wheel-sector__text { position: relative; z-index: 1; width: 100%; margin-top: 2px; font-size: 13px; line-height: 1.35; color: #000; white-space: pre-wrap; word-break: break-word; }

/* Bloc objectifs dans les résultats / PDF */
.rd-results__objectives { margin-top: 24px; }
.rd-results__objectives-title { font-size: 18px; color: #15807d; margin: 0 0 4px; font-weight: 700; text-align: center; }

@media (max-width: 640px) {
	.rd-app { padding: 24px 16px; border-radius: 16px; }
	.rd-identity { grid-template-columns: 1fr; }
	.rd-block__head { grid-template-columns: 40px 1fr 40px; gap: 8px; }
	.rd-totem-img { max-height: 60px; }
	[data-panel="collectif"] .rd-block__head,
	[data-panel="ensemble"] .rd-block__head { grid-template-columns: 66px 1fr 66px; gap: 8px; }
	[data-panel="collectif"] .rd-totem-img,
	[data-panel="ensemble"] .rd-totem-img { max-height: 86px; }
	.rd-block__titles { gap: 8px; }
	.rd-stop { width: 24px; height: 24px; font-size: 11px; }
	.rd-scale { gap: 4px; }
	.rd-wheel-sector { width: 33%; }
	.rd-wheel-sector__fig { width: 42px; height: 42px; }
	.rd-wheel-sector__verb { font-size: 12px; }
	.rd-wheel-sector__phrase { font-size: 9.5px; }
	.rd-wheel-sector__input, .rd-wheel-sector__text { font-size: 10.5px; padding: 4px 5px; }
}

@media (prefers-reduced-motion: reduce) {
	.rd-results { animation: none; }
	.rd-stop, .rd-btn { transition: none; }
}

/* color-mix fallback (anciens navigateurs) */
@supports not (background: color-mix(in srgb, red 8%, white)) {
	.rd-result-card__analysis { background: var(--rd-soft); }
}

/* ---------- Impression ---------- */
@media print {
	.rd-no-print { display: none !important; }
	.rd-pdf-logo { display: block !important; }
	.rd-brand { display: flex !important; }
	.rd-app { box-shadow: none; border: none; max-width: none; padding: 0; }
	.rd-result-card { break-inside: avoid; }
}
