/* Reay — Tests de niveau
   Marine du site : rgb(4,29,73) */

.reay-test {
	--reay-marine: #041d49;
	--reay-bord: #dde3ec;
	--reay-fond: #f7f9fc;
	--reay-texte: #1d2430;
	--reay-gris: #5a6473;

	max-width: 820px;
	/* L'en-tête du site est fixe et n'a pas de hauteur figée : sur mobile il se
	   replie sur plusieurs lignes et devient plus haut qu'en grand écran. Un
	   script le mesure et publie sa hauteur dans --reay-entete ; les valeurs
	   ci-dessous ne servent que s'il ne s'exécute pas. */
	margin: calc(var(--reay-entete, 95px) + var(--reay-ecart, 35px)) auto 56px;
	padding: 36px;
	border-radius: 12px;

	/* Le bloc ne dépend pas des couleurs de la page qui l'accueille :
	   sur ce site, le contenu hérite d'un texte blanc sur fond marine,
	   ce qui rendrait les propositions illisibles. */
	background: var(--reay-fond);
	color: var(--reay-texte);
	/* Le retour après envoi saute sur #reay-test : même en-tête à dégager. */
	scroll-margin-top: calc(var(--reay-entete, 95px) + 25px);
}

.reay-test *,
.reay-test *::before,
.reay-test *::after {
	box-sizing: border-box;
}

/* Reprise en main de l'héritage du thème.
   :where() annule la spécificité du sélecteur : ces règles battent l'héritage
   du thème, mais s'effacent devant les classes du bloc (badge blanc, mentions
   grises, énoncés marine…) qui suivent plus bas. */
:where(.reay-test) p,
:where(.reay-test) span,
:where(.reay-test) label,
:where(.reay-test) legend,
:where(.reay-test) li,
:where(.reay-test) em,
:where(.reay-test) strong {
	color: var(--reay-texte);
}

:where(.reay-test) h2,
:where(.reay-test) h3 {
	color: var(--reay-marine);
}

:where(.reay-test) a {
	color: var(--reay-marine);
}

@media (max-width: 782px) {

	.reay-test {
		/* Repli plus généreux qu'en grand écran : l'en-tête mobile se replie
		   sur deux ou trois lignes selon la largeur. */
		margin: calc(var(--reay-entete, 150px) + var(--reay-ecart, 20px)) auto 32px;
		padding: 22px 18px;
	}
}

/* --- Messages ---------------------------------------------------------- */

.reay-test__erreur {
	margin: 0 0 24px;
	padding: 14px 18px;
	background: #fdf3f3;
	border-left: 4px solid #b3261e;
	border-radius: 4px;
	color: #8c1d18;
	font-size: 15px;
}

.reay-test--merci {
	padding: 48px 32px;
	background: #fff;
	border: 1px solid var(--reay-bord);
	border-radius: 10px;
	text-align: center;
}

.reay-test--merci h2 {
	margin: 0 0 16px;
	color: var(--reay-marine);
	font-size: 26px;
	line-height: 1.25;
}

.reay-test--merci p {
	margin: 0 0 12px;
	font-size: 17px;
	line-height: 1.6;
}

.reay-test__note {
	margin-top: 20px !important;
	color: var(--reay-gris);
	font-size: 14px !important;
}

/* --- Choix du niveau --------------------------------------------------- */

.reay-test__intro {
	margin-bottom: 28px;
	text-align: center;
}

.reay-test__intro h2 {
	margin: 0 0 12px;
	color: var(--reay-marine);
	font-size: 27px;
	line-height: 1.25;
}

.reay-test__intro p {
	margin: 0 auto;
	max-width: 560px;
	color: var(--reay-gris);
	font-size: 16px;
	line-height: 1.6;
}

.reay-test__niveaux {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
	gap: 16px;
}

/* Astra souligne tous les liens du contenu avec une spécificité supérieure :
   sur une carte entièrement cliquable, cela souligne les trois lignes. */
.reay-test .reay-test__niveau,
.reay-test .reay-test__niveau:hover,
.reay-test .reay-test__niveau:focus,
.reay-test .reay-test__niveau span {
	text-decoration: none !important;
}

.reay-test__niveau {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 22px 20px 18px;
	border: 1px solid var(--reay-bord);
	border-radius: 10px;
	background: #fff;
	color: var(--reay-texte);
	transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.reay-test__niveau:hover,
.reay-test__niveau:focus {
	border-color: var(--reay-marine);
	transform: translateY(-2px);
	box-shadow: 0 6px 18px rgba(4, 29, 73, 0.12);
	color: var(--reay-texte);
}

.reay-test__niveau-code {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	margin-bottom: 4px;
	border-radius: 8px;
	background: var(--reay-marine);
	color: #fff;
	font-size: 18px;
	font-weight: 700;
	letter-spacing: 0.02em;
}

.reay-test__niveau-nom {
	color: var(--reay-marine);
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
}

.reay-test__niveau-phrase {
	flex: 1 1 auto;
	color: var(--reay-gris);
	font-size: 14px;
	line-height: 1.5;
}

.reay-test__niveau-lien {
	margin-top: 8px;
	color: var(--reay-marine);
	font-size: 14px;
	font-weight: 600;
}

.reay-test__niveau:hover .reay-test__niveau-lien span {
	margin-left: 4px;
}

/* --- En-tête du questionnaire ------------------------------------------ */

.reay-test__entete {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 24px;
	padding-bottom: 16px;
	border-bottom: 2px solid var(--reay-bord);
}

.reay-test__badge {
	display: inline-block;
	padding: 5px 12px;
	border-radius: 5px;
	background: var(--reay-marine);
	color: #fff;
	font-size: 15px;
	font-weight: 700;
}

.reay-test__entete-nom {
	margin-left: 10px;
	color: var(--reay-marine);
	font-size: 17px;
	font-weight: 700;
}

.reay-test__entete-info {
	margin-left: 10px;
	color: var(--reay-gris);
	font-size: 14px;
}

.reay-test__changer {
	color: var(--reay-marine);
	font-size: 14px;
	font-weight: 600;
	text-decoration: underline;
}

/* --- Coordonnées ------------------------------------------------------- */

.reay-test fieldset {
	margin: 0 0 28px;
	padding: 0;
	border: 0;
}

.reay-test__identite {
	padding: 24px !important;
	background: #fff;
	border: 1px solid var(--reay-bord) !important;
	border-radius: 10px;
}

.reay-test__identite legend {
	padding: 0 8px;
	color: var(--reay-marine);
	font-size: 18px;
	font-weight: 700;
}

.reay-test__grille {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

.reay-test__champ {
	margin: 0;
}

.reay-test__champ label {
	display: block;
	margin-bottom: 6px;
	font-size: 14px;
	font-weight: 600;
	color: var(--reay-marine);
}

.reay-test__champ input {
	width: 100%;
	padding: 11px 13px;
	border: 1px solid var(--reay-bord);
	border-radius: 6px;
	background: #fff;
	font-size: 16px; /* < 16px déclenche un zoom sur iOS */
	color: var(--reay-texte);
}

.reay-test__champ input:focus {
	outline: 2px solid var(--reay-marine);
	outline-offset: 1px;
	border-color: var(--reay-marine);
}

.reay-test__requis {
	color: #b3261e;
}

.reay-test__facultatif {
	color: var(--reay-gris);
	font-weight: 400;
}

/* --- Questions --------------------------------------------------------- */

.reay-test__question {
	margin: 0 0 18px !important;
	padding: 20px 22px !important;
	border: 1px solid var(--reay-bord) !important;
	border-radius: 10px;
	background: #fff;
}

.reay-test__question legend {
	display: block;
	width: 100%;
	padding: 0;
	margin-bottom: 14px;
}

.reay-test__compteur {
	display: block;
	margin-bottom: 6px;
	color: var(--reay-gris);
	font-size: 13px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.reay-test__enonce {
	display: block;
	color: var(--reay-marine);
	font-size: 18px;
	font-weight: 600;
	line-height: 1.5;
}

.reay-test__choix {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}

.reay-test__choix-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	border: 1px solid var(--reay-bord);
	border-radius: 8px;
	background: var(--reay-fond);
	font-size: 16px;
	line-height: 1.4;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.reay-test__choix-item:hover {
	border-color: var(--reay-marine);
	background: #eef2f8;
}

.reay-test__choix-item input {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--reay-marine);
}

.reay-test__choix-item:has(input:checked) {
	border-color: var(--reay-marine);
	background: #e8eef7;
	font-weight: 600;
}

.reay-test__choix-item:has(input:focus-visible) {
	outline: 2px solid var(--reay-marine);
	outline-offset: 2px;
}

/* --- Consentement et envoi --------------------------------------------- */

.reay-test__consentement {
	margin: 0 0 24px;
	padding: 16px 18px;
	background: #fff;
	border: 1px solid var(--reay-bord);
	border-radius: 8px;
}

.reay-test__consentement label {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	font-size: 15px;
	line-height: 1.5;
	cursor: pointer;
}

.reay-test__consentement input {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin-top: 2px;
	accent-color: var(--reay-marine);
}

.reay-test__envoi {
	margin: 0 0 20px;
	text-align: center;
}

.reay-test__bouton {
	display: inline-block;
	padding: 15px 44px;
	border: 0;
	border-radius: 6px;
	background: var(--reay-marine);
	color: #fff;
	font-size: 17px;
	font-weight: 700;
	letter-spacing: 0.02em;
	cursor: pointer;
	transition: background 0.15s ease;
}

.reay-test__bouton:hover,
.reay-test__bouton:focus {
	background: #0a2f70;
	color: #fff;
}

.reay-test__mentions {
	margin: 0;
	color: var(--reay-gris);
	font-size: 13px;
	line-height: 1.55;
	text-align: center;
}

.reay-test__mentions a {
	color: var(--reay-marine);
	text-decoration: underline;
}

/* --- Piège à robots ---------------------------------------------------- */

.reay-test__pot {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* --- Mobile ------------------------------------------------------------ */

@media (max-width: 600px) {

	.reay-test__grille,
	.reay-test__choix {
		grid-template-columns: 1fr;
	}

	.reay-test__question {
		padding: 16px !important;
	}

	.reay-test__identite {
		padding: 18px !important;
	}

	.reay-test__bouton {
		width: 100%;
		padding: 16px 20px;
	}
}
