/**
 * Auto-diagnostic PRA.
 *
 * Dépend de base.css pour les jetons et la typographie.
 */

.pc-diag__intro {
	padding: clamp(48px, 7vw, 88px) 0 clamp(28px, 4vw, 44px);
}

.pc-diag__title {
	max-width: 20ch;
	font-family: var(--pc-display);
	font-size: clamp(1.9rem, 4.2vw, 2.9rem);
	line-height: 1;
	letter-spacing: -0.035em;
	font-weight: 600;
}

.pc-diag__lead {
	max-width: 60ch;
	margin-top: 22px;
	font-family: var(--pc-display);
	font-size: clamp(1rem, 1.4vw, 1.15rem);
	line-height: 1.5;
	color: var(--pc-muted);
}

/* La promesse de confidentialité est le premier frein levé : elle doit être
   lue avant la première question, pas reléguée en bas de page. */
.pc-diag__privacy {
	max-width: 60ch;
	margin: 26px 0 0;
	padding-left: 16px;
	border-left: 2px solid var(--pc-sage-dark);
	font-family: var(--pc-mono);
	font-size: 0.8rem;
	line-height: 1.6;
	color: var(--pc-sage-dark);
}

.pc-diag__form {
	padding-top: clamp(36px, 5vw, 56px);
	padding-bottom: 24px;
}

.pc-diag__section {
	margin: 0 0 clamp(32px, 4vw, 44px);
	padding: 0;
	border: 0;
}

.pc-diag__legend {
	margin-bottom: 22px;
	padding: 0;
	font-family: var(--pc-mono);
	font-size: 0.72rem;
	font-weight: 500;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--pc-accent);
}

.pc-diag__q {
	padding: 24px 0;
	border-top: 1px solid var(--pc-line);
}

.pc-diag__label {
	font-size: 1.05rem;
	font-weight: 600;
}

.pc-diag__help {
	max-width: 68ch;
	margin-top: 8px;
	color: var(--pc-muted);
	font-size: 0.92rem;
}

.pc-diag__answers {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 18px;
}

/* Le bouton radio natif est masqué visuellement mais reste focusable :
   la navigation au clavier et les lecteurs d'écran continuent de fonctionner. */
.pc-diag__radio {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.pc-diag__choice {
	display: inline-block;
	padding: 10px 20px;
	background: transparent;
	border: 1px solid var(--pc-line-strong);
	border-radius: 0;
	font-family: var(--pc-mono);
	font-size: 0.8rem;
	letter-spacing: 0.04em;
	color: var(--pc-muted);
	cursor: pointer;
	transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.pc-diag__choice:hover {
	border-color: var(--pc-ink);
	color: var(--pc-ink);
}

.pc-diag__radio:checked + .pc-diag__choice {
	background: var(--pc-ink);
	border-color: var(--pc-ink);
	color: var(--pc-paper);
}

.pc-diag__radio:focus-visible + .pc-diag__choice {
	outline: 2px solid var(--pc-accent);
	outline-offset: 2px;
}

.pc-diag__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px 20px;
	padding-top: 28px;
	border-top: 2px solid var(--pc-accent-soft);
}

.pc-diag__reset {
	padding: 0;
	background: none;
	border: 0;
	font-family: var(--pc-mono);
	font-size: 0.78rem;
	letter-spacing: 0.04em;
	color: var(--pc-muted);
	text-decoration: underline;
	cursor: pointer;
}

.pc-diag__progress {
	font-family: var(--pc-mono);
	font-size: 0.78rem;
	letter-spacing: 0.04em;
	color: var(--pc-muted);
}

/* --------------------------------------------------- Résultat du calcul */

.pc-diag__result {
	max-width: 860px;
	padding-top: 16px;
	padding-bottom: clamp(56px, 8vw, 88px);
}

.pc-diag__result:focus {
	outline: none;
}

.pc-diag__score {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 8px 20px;
	padding: 28px;
	background: var(--pc-ink);
	color: var(--pc-paper);
}

.pc-diag__score-value {
	font-family: var(--pc-display);
	font-size: 2.6rem;
	line-height: 1;
	letter-spacing: -0.035em;
	font-weight: 600;
}

.pc-diag__score-value small {
	color: rgba(242, 239, 230, 0.5);
	font-size: 1.1rem;
}

.pc-diag__score-label {
	font-family: var(--pc-mono);
	font-size: 0.8rem;
	font-weight: 500;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--pc-sage);
}

.pc-diag__verdict {
	/* Pas de max-width : le verdict prolonge visuellement le bandeau de score,
	   les deux doivent avoir exactement la même largeur. */
	max-width: none;
	padding: 24px 28px;
	background: var(--pc-alt);
	border: 1px solid var(--pc-line);
	border-top: 0;
}

.pc-diag__partial {
	margin-top: 14px;
	color: var(--pc-muted);
	font-size: 0.9rem;
}

.pc-diag__flags-title {
	margin: clamp(32px, 5vw, 48px) 0 18px;
	font-family: var(--pc-display);
	font-size: clamp(1.25rem, 2vw, 1.55rem);
	line-height: 1.1;
	letter-spacing: -0.025em;
	font-weight: 600;
}

.pc-diag__flags {
	counter-reset: flag;
	border-top: 1px solid var(--pc-line);
}

.pc-diag__flag {
	position: relative;
	padding: 20px 0 20px 62px;
	border-bottom: 1px solid var(--pc-line);
	counter-increment: flag;
}

/* Le poids se lit à la couleur du filet : le visiteur doit voir d'un coup
   d'œil ce qui relève de la survie et ce qui relève du confort. */
.pc-diag__flag::after {
	content: '';
	position: absolute;
	top: 20px;
	bottom: 20px;
	left: 44px;
	width: 2px;
	background: var(--pc-muted);
}

.pc-diag__flag--w3::after {
	background: var(--pc-alert);
}

.pc-diag__flag--w2::after {
	background: #e08e0b;
}

.pc-diag__flag--w1::after {
	background: var(--pc-sage-dark);
}

.pc-diag__flag::before {
	position: absolute;
	top: 21px;
	left: 0;
	font-family: var(--pc-mono);
	font-size: 0.8rem;
	font-weight: 500;
	color: var(--pc-muted);
	content: counter(flag, decimal-leading-zero);
}

.pc-diag__flag-q {
	margin-bottom: 6px;
	font-weight: 600;
}

.pc-diag__flag-risk {
	color: var(--pc-muted);
	font-size: 0.94rem;
}

/* Question laissée sans réponse au moment du calcul. */
.pc-diag__q--missing {
	margin-left: -16px;
	padding-left: 16px;
	border-left: 3px solid var(--pc-alert);
}

/* Justification du plafonnement : sans elle, un score bridé passe pour un
   bug de calcul. */
.pc-diag__capped {
	margin-top: 14px;
	padding-left: 14px;
	border-left: 3px solid var(--pc-alert);
	color: var(--pc-muted);
	font-size: 0.92rem;
}

/* Relance placée à la fin du résultat : séparée par un filet pour qu'elle se
   lise comme une suite proposée, pas comme un dernier point à traiter. */
.pc-diag__cta {
	margin-top: 32px;
	padding-top: 24px;
	border-top: 1px solid var(--pc-line);
}

.pc-diag__cta-pitch {
	margin-bottom: 18px;
	font-family: var(--pc-display);
	font-size: 1.08rem;
	line-height: 1.5;
}

@media (max-width: 600px) {
	.pc-diag__answers {
		gap: 8px;
	}

	.pc-diag__choice {
		padding: 9px 15px;
		font-size: 0.76rem;
	}

	.pc-diag__score {
		padding: 22px;
	}

	.pc-diag__verdict {
		padding: 20px 22px;
	}
}
