/*
 * L'estimation de rachat (includes/rachat-grille.php).
 * Numéro de série, modèle, état, estimation : violet CYBER-JAY, cadre métallisé,
 * grandes cibles tactiles, aucune bibliothèque. Version d'enfilement :
 * CYBERJAY_RACHAT_GRILLE_VERSION, à incrémenter à chaque modification.
 */

.cje {
	--cje-violet: #8f15ff;
	--cje-fonce: #6a0fd1;
	--cje-nuit: #2a0a52;
	--cje-encre: #17121f;
	--cje-gris: #6b6478;
	--cje-pale: #f7f1ff;
	--cje-bord: #e6dcf7;
	padding-top: 44px;
}
.cje [hidden] { display: none !important; }
/* L'identifiant l'emporte sur la feuille des blocs Rachat (rachat-v2-style.php), qui aligne ses titres à gauche. */
#estimation .cjr-tete { margin: 0 auto 26px; text-align: center; }
#estimation .cjr-surtitre { justify-content: center; }
#estimation .cjr-titre, #estimation .cjr-chapeau { text-align: center !important; }
#estimation .cjr-chapeau { max-width: 640px; margin-left: auto; margin-right: auto; }

/* ---- la barre des étapes ---- */
.cje .cje-progres {
	position: relative;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	max-width: 760px;
	margin: 0 auto 30px !important;
	counter-reset: none;
}
.cje .cje-progres::before {
	content: "";
	position: absolute;
	top: 19px;
	left: 12.5%;
	right: 12.5%;
	height: 3px;
	border-radius: 3px;
	background: var(--cje-bord);
}
.cje .cje-progres::after {
	content: "";
	position: absolute;
	top: 19px;
	left: 12.5%;
	height: 3px;
	border-radius: 3px;
	width: 0;
	background: linear-gradient(90deg, #c9a7ff, var(--cje-violet));
	transition: width .6s cubic-bezier(.2, .7, .2, 1);
}
.cje[data-etape="2"] .cje-progres::after { width: 25%; }
.cje[data-etape="3"] .cje-progres::after { width: 50%; }
.cje[data-etape="4"] .cje-progres::after { width: 75%; }
.cje .cje-progres li {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	text-align: center;
}
.cje .cje-progres b {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border: 2px solid var(--cje-bord);
	border-radius: 50%;
	background: #fff;
	color: var(--cje-gris);
	font-size: 15px;
	font-weight: 800;
	transition: background .3s, border-color .3s, color .3s, transform .3s, box-shadow .3s;
}
.cje .cje-progres span { font-size: 13.5px; font-weight: 700; line-height: 1.2; color: var(--cje-gris); }
.cje .cje-progres .cje-fait b { border-color: var(--cje-violet); background: var(--cje-pale); color: var(--cje-fonce); }
.cje .cje-progres .cje-ici b {
	border-color: var(--cje-violet);
	background: var(--cje-violet);
	color: #fff;
	transform: scale(1.08);
	box-shadow: 0 0 0 6px rgba(143, 21, 255, .14), 0 12px 24px -12px rgba(143, 21, 255, .9);
}
.cje .cje-progres .cje-ici span { color: var(--cje-encre); }

/* ---- les étapes ---- */
.cje .cje-etape { min-width: 0; margin: 0; padding: 0; border: 0; }
.cje .cje-entre { animation: cje-entre .5s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes cje-entre {
	from { opacity: 0; transform: translateY(16px); }
	to { opacity: 1; transform: none; }
}
.cje .cje-question {
	display: block;
	float: none;
	width: 100%;
	margin: 0 0 8px;
	padding: 0;
	font-size: clamp(21px, 2.4vw, 27px);
	line-height: 1.2;
	font-weight: 800;
	letter-spacing: -.015em;
	color: var(--cje-encre);
	text-align: center;
}
.cje .cje-question:focus { outline: none; }
.cje .cje-aide { margin: 0 0 18px; font-size: 15.5px; line-height: 1.5; color: var(--cje-gris); text-align: center; }
.cje .cje-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 12px 18px;
	margin: 26px 0 0;
}
.cje .cje-bouton {
	box-sizing: border-box;
	max-width: 100%;
	display: inline-flex;
	text-align: center;
	align-items: center;
	justify-content: center;
	min-height: 56px;
	padding: 0 34px;
	border: 0;
	border-radius: 999px;
	background: linear-gradient(135deg, var(--cje-violet), var(--cje-fonce));
	color: #fff !important;
	font-family: inherit;
	font-size: 16.5px;
	font-weight: 800;
	text-decoration: none !important;
	cursor: pointer;
	box-shadow: 0 16px 30px -18px rgba(143, 21, 255, .95);
	transition: transform .2s, box-shadow .2s;
}
.cje .cje-bouton:hover { transform: translateY(-2px); box-shadow: 0 22px 36px -18px rgba(143, 21, 255, .95); }
.cje .cje-bouton:focus-visible, .cje .cje-lien:focus-visible { outline: 3px solid #d9b3ff; outline-offset: 3px; }
.cje .cje-bouton-clair { background: #fff; color: var(--cje-fonce) !important; box-shadow: inset 0 0 0 2px #d9c2ff; }
.cje .cje-lien {
	display: inline;
	min-height: 0;
	padding: 4px 0;
	border: 0;
	background: none;
	color: var(--cje-fonce) !important;
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

/* ---- 1 · le numéro de série ---- */
.cje .cje-etape-serie { max-width: 780px; margin: 0 auto; }
.cje .cje-serie { margin: 0; }
.cje .cje-serie-champ {
	display: flex;
	gap: 10px;
	margin: 14px 0 0;
	padding: 10px;
	border: 2px solid var(--cje-violet);
	border-radius: 999px;
	background: #fff;
	box-shadow: 0 30px 60px -40px rgba(74, 11, 143, .8);
	transition: box-shadow .2s;
}
.cje .cje-serie-champ:focus-within { box-shadow: 0 0 0 5px rgba(143, 21, 255, .16), 0 30px 60px -40px rgba(74, 11, 143, .8); }
.cje .cje-serie-champ input {
	flex: 1;
	min-width: 0;
	height: 60px;
	margin: 0;
	padding: 0 22px;
	border: 0 !important;
	border-radius: 999px;
	background: transparent !important;
	box-shadow: none !important;
	font-family: inherit;
	font-size: 19px;
	font-weight: 700;
	letter-spacing: .06em;
	color: var(--cje-encre);
	text-transform: uppercase;
}
.cje .cje-serie-champ input::placeholder { font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--cje-violet); opacity: 1; }
.cje .cje-serie-champ input:focus { outline: none; }
.cje .cje-serie-champ button {
	flex: none;
	min-height: 60px;
	padding: 0 32px;
	border: 0;
	border-radius: 999px;
	background: linear-gradient(135deg, var(--cje-violet), var(--cje-fonce));
	color: #fff;
	font-family: inherit;
	font-size: 16.5px;
	font-weight: 800;
	cursor: pointer;
	transition: transform .2s;
}
.cje .cje-serie-champ button:hover { transform: translateY(-1px); }
.cje .cje-serie-champ button:focus-visible { outline: 3px solid #d9b3ff; outline-offset: 3px; }
.cje .cje-ou { margin: 18px 0 0; text-align: center; }
.cje .cje-ou summary {
	display: inline-block;
	padding: 6px 0;
	font-size: 15px;
	font-weight: 700;
	color: var(--cje-fonce);
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
	list-style: none;
}
.cje .cje-ou summary::-webkit-details-marker { display: none; }
.cje .cje-ou-grille { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 14px 0 0; }
.cje .cje-ou-grille p { margin: 0; padding: 16px 18px; border-radius: 18px; background: var(--cje-pale); font-size: 14px; line-height: 1.5; color: #3b3548; text-align: left; }
.cje .cje-ou-grille strong { display: block; margin: 0 0 4px; font-size: 14.5px; color: var(--cje-encre); }
.cje .cje-sans-serie { margin: 22px 0 0; text-align: center; }

/* ---- 2 · le modèle ---- */
.cje .cje-avis {
	max-width: 760px;
	margin: 14px auto 22px;
	padding: 16px 20px;
	border: 1px solid #f0d9a8;
	border-radius: 18px;
	background: #fff8ea;
	font-size: 15.5px;
	line-height: 1.55;
	color: #5a4410;
	text-align: left;
}
.cje [data-cje-sous="familles"] .cje-sous-modeles,
.cje [data-cje-sous="modeles"] .cje-sous-familles { display: none; }
.cje .cje-familles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.cje .cje-famille {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	margin: 0;
	padding: 10px 10px 18px;
	text-align: center;
	cursor: pointer;
}
.cje .cje-famille input, .cje .cje-modele input, .cje .cje-etat input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
}
.cje .cje-famille-dessin { display: block; width: 100%; max-width: 220px; }
.cje .cje-famille-nom { position: relative; z-index: 2; font-size: 17px; font-weight: 800; letter-spacing: -.01em; color: var(--cje-encre); }
.cje .cje-famille-nombre { position: relative; z-index: 2; font-size: 13px; color: var(--cje-gris); }
.cje .cje-famille:has(input:checked) { background: var(--cje-pale); box-shadow: 0 0 0 3px var(--cje-violet), 0 24px 44px -24px rgba(74, 11, 143, .6); }
.cje .cje-famille:has(input:focus-visible) { outline: 3px solid #d9b3ff; outline-offset: 4px; }
.cje .cje-sous-modeles .cje-aide { font-size: 17px; font-weight: 800; color: var(--cje-encre); }
.cje .cje-changer { margin-left: 10px; font-size: 14.5px; font-weight: 700; }
.cje .cje-recherche { max-width: 420px; margin: 0 auto 18px; }
.cje .cje-recherche input {
	box-sizing: border-box;
	width: 100%;
	min-height: 52px;
	margin: 0;
	padding: 0 20px;
	border: 2px solid #d9c2ff;
	border-radius: 999px;
	background: #fff;
	font-family: inherit;
	font-size: 16px;
	color: var(--cje-encre);
}
.cje .cje-recherche input:focus { outline: none; border-color: var(--cje-violet); box-shadow: 0 0 0 4px rgba(143, 21, 255, .14); }
.cje .cje-modeles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cje .cje-modele { position: relative; display: block; margin: 0; cursor: pointer; }
.cje .cje-modele > span {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	box-sizing: border-box;
	height: 100%;
	min-height: 60px;
	padding: 12px 16px;
	border: 1.5px solid var(--cje-bord);
	border-radius: 16px;
	background: #fff;
	text-align: left;
	transition: border-color .15s, transform .2s, box-shadow .2s, background .15s;
}
.cje .cje-modele b { font-size: 15.5px; line-height: 1.3; font-weight: 700; color: var(--cje-encre); }
.cje .cje-modele i {
	flex: none;
	padding: 4px 10px;
	border-radius: 999px;
	background: var(--cje-pale);
	font-size: 12.5px;
	font-style: normal;
	font-weight: 700;
	color: var(--cje-fonce);
}
.cje .cje-modele:hover > span { border-color: #c9a7ff; transform: translateY(-2px); box-shadow: 0 14px 26px -18px rgba(74, 11, 143, .55); }
.cje .cje-modele input:checked + span { border-color: var(--cje-violet); background: var(--cje-pale); box-shadow: inset 0 0 0 1px var(--cje-violet); }
.cje .cje-modele input:focus-visible + span { outline: 3px solid #d9b3ff; outline-offset: 2px; }
.cje .cje-vide { margin: 10px 0 0; font-size: 15px; color: var(--cje-gris); text-align: center; }

/* ---- l'appareil choisi, aux étapes 3 et 4 ---- */
.cje .cje-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.cje[data-etape="3"] .cje-form, .cje[data-etape="4"] .cje-form { grid-template-columns: minmax(0, 330px) minmax(0, 1fr); align-items: start; }
.cje .cje-appareil {
	position: sticky;
	top: 100px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 14px 20px 22px;
	text-align: center;
}
.cje .cje-appareil-dessin { display: block; width: 100%; max-width: 260px; }
.cje .cje-appareil-texte { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.cje .cje-appareil strong { font-size: 20px; line-height: 1.2; font-weight: 800; letter-spacing: -.01em; color: var(--cje-encre); }
.cje .cje-appareil-annee { font-size: 14.5px; font-weight: 700; color: var(--cje-fonce); }
.cje .cje-appareil-serie { font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--cje-gris); }
.cje .cje-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0 0 4px;
	padding: 5px 12px;
	border-radius: 999px;
	background: #e2f5ec;
	font-size: 12.5px;
	font-weight: 800;
	color: #0d6b52;
}
.cje .cje-badge::before { content: "✓"; }

/* ---- 3 · l'état ---- */
.cje .cje-etats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cje .cje-etat { position: relative; display: block; margin: 0; cursor: pointer; }
.cje .cje-etat > span {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	box-sizing: border-box;
	height: 100%;
	min-height: 150px;
	padding: 18px 18px 16px;
	border: 1.5px solid var(--cje-bord);
	border-radius: 22px;
	background: #fff;
	text-align: left;
	transition: border-color .15s, transform .2s, box-shadow .2s, background .15s;
}
.cje .cje-picto { display: block; width: 52px; height: 52px; margin: 0 0 6px; }
.cje .cje-etat b { font-size: 17px; font-weight: 800; color: var(--cje-encre); }
.cje .cje-etat i { font-size: 13.5px; font-style: normal; line-height: 1.4; color: var(--cje-gris); }
.cje .cje-etat > span::after {
	content: "";
	position: absolute;
	top: 14px;
	right: 14px;
	width: 26px;
	height: 26px;
	box-sizing: border-box;
	border: 2px solid #d9c2ff;
	border-radius: 8px;
	background: #fff center / 16px no-repeat;
	transition: background-color .15s, border-color .15s;
}
.cje .cje-etat:hover > span { border-color: #c9a7ff; transform: translateY(-3px); box-shadow: 0 18px 30px -20px rgba(74, 11, 143, .55); }
.cje .cje-etat input:checked + span { border-color: var(--cje-violet); background: var(--cje-pale); box-shadow: inset 0 0 0 1px var(--cje-violet); }
.cje .cje-etat input:checked + span::after {
	border-color: var(--cje-violet);
	background-color: var(--cje-violet);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}
.cje .cje-etat input:focus-visible + span { outline: 3px solid #d9b3ff; outline-offset: 2px; }
.cje .cje-etat-parfait > span { border-style: dashed; }
.cje .cje-etat-parfait input:checked + span { border-style: solid; background: #eefaf4; border-color: #1f9d76; box-shadow: inset 0 0 0 1px #1f9d76; }
.cje .cje-etat-parfait input:checked + span::after { border-color: #1f9d76; background-color: #1f9d76; }
.cje .cje-alerte {
	margin: 16px 0 0;
	padding: 12px 16px;
	border-radius: 14px;
	background: #fdf0f0;
	font-size: 15px;
	font-weight: 700;
	color: #7a1c1c;
	text-align: center;
}
.cje [data-cje-etape="3"] .cje-question, .cje [data-cje-etape="3"] .cje-aide, .cje [data-cje-etape="4"] .cje-question { text-align: left; }
.cje [data-cje-etape="3"] .cje-actions { justify-content: flex-start; }

/* ---- 4 · l'estimation ---- */
.cje .cje-resultat { display: flex; flex-direction: column; gap: 18px; }
.cje .cje-res-etats { margin: 0; font-size: 15px; line-height: 1.5; color: var(--cje-gris); text-align: left; }
.cje .cje-res-etats b { color: var(--cje-encre); }
.cje .cje-res-etats .cje-lien { margin-left: 6px; font-size: 14.5px; }
.cje .cje-res-cas { display: none; }
.cje [data-cje-cas="offre"] .cje-res-offre,
.cje [data-cje-cas="recyclage"] .cje-res-recyclage,
.cje [data-cje-cas="demande"] .cje-res-demande { display: block; }
.cje .cje-res-cas {
	position: relative;
	overflow: hidden;
	padding: 30px 32px 32px;
	border-radius: 30px;
	background: radial-gradient(70% 90% at 85% 15%, rgba(143, 21, 255, .55) 0%, rgba(143, 21, 255, 0) 62%), linear-gradient(135deg, #16052e 0%, var(--cje-nuit) 48%, #4a0b8f 100%);
	color: #fff;
	text-align: left;
	box-shadow: 0 30px 60px -36px rgba(42, 10, 82, .9);
}
.cje .cje-res-cas .cje-question { margin: 0 0 6px; font-size: 16px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #e3d2ff; }
.cje .cje-res-recyclage .cje-question, .cje .cje-res-demande .cje-question { font-size: clamp(26px, 3vw, 34px); letter-spacing: -.015em; text-transform: none; color: #fff; }
.cje .cje-prix { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 14px; line-height: 1; }
.cje .cje-montant {
	font-size: clamp(76px, 10vw, 112px);
	font-weight: 800;
	letter-spacing: -.04em;
	font-variant-numeric: tabular-nums;
	background: linear-gradient(180deg, #fff 30%, #e3d2ff 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}
.cje .cje-euro { margin-top: .18em; font-size: clamp(34px, 4vw, 48px); font-weight: 800; color: #e3d2ff; }
.cje .cje-prix.cje-fini .cje-montant { animation: cje-eclat .6s ease-out; }
@keyframes cje-eclat {
	0% { filter: drop-shadow(0 0 0 rgba(227, 210, 255, 0)); }
	40% { filter: drop-shadow(0 0 18px rgba(227, 210, 255, .9)); }
	100% { filter: drop-shadow(0 0 0 rgba(227, 210, 255, 0)); }
}
.cje .cje-mention, .cje .cje-res-texte { max-width: 56ch; margin: 0 0 22px; font-size: 15.5px; line-height: 1.55; color: #e3d2ff; text-align: left; }
.cje .cje-res-texte { font-size: 17px; color: #fff; }
.cje .cje-res-cas .cje-bouton { background: #fff; color: var(--cje-fonce) !important; box-shadow: 0 16px 30px -18px rgba(0, 0, 0, .6); }
.cje .cje-recommencer { margin: 0; text-align: left; }

/* La demande, sous l'estimation. */
.cje-demande { scroll-margin-top: 90px; }
.cje-demande.cje-entre { animation: cje-entre .5s cubic-bezier(.2, .7, .2, 1) both; }

/* ---- étroit ---- */
@media (max-width: 1100px) {
	.cje .cje-familles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.cje .cje-modeles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.cje .cje-etats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
	.cje .cje-familles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
	.cje[data-etape="3"] .cje-form, .cje[data-etape="4"] .cje-form { grid-template-columns: minmax(0, 1fr); }
	.cje .cje-appareil { position: relative; top: auto; flex-direction: row; gap: 14px; padding: 12px 16px; text-align: left; }
	.cje .cje-appareil-dessin { flex: none; width: 120px; }
	.cje .cje-appareil-texte { align-items: flex-start; }
	.cje .cje-appareil strong { font-size: 18px; }
	.cje .cje-ou-grille { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
	.cje { padding-top: 32px; }
	.cje .cje-progres span { font-size: 12px; }
	.cje .cje-progres b { width: 36px; height: 36px; }
	.cje .cje-progres::before, .cje .cje-progres::after { top: 17px; }
	.cje .cje-serie-champ { flex-direction: column; padding: 10px; border-radius: 26px; }
	.cje .cje-serie-champ input { flex: none; height: 56px; text-align: center; font-size: 17px; }
	.cje .cje-serie-champ button { width: 100%; min-height: 56px; }
	.cje .cje-familles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.cje .cje-famille { padding: 6px 6px 14px; border-radius: 20px; }
	.cje .cje-famille-nom { font-size: 15.5px; }
	.cje .cje-modeles, .cje .cje-etats { grid-template-columns: minmax(0, 1fr); }
	.cje .cje-etat > span { flex-direction: row; flex-wrap: wrap; align-items: center; min-height: 0; padding: 14px 52px 14px 14px; column-gap: 12px; }
	.cje .cje-picto { width: 44px; height: 44px; margin: 0; }
	.cje .cje-etat b { flex: 1; }
	.cje .cje-etat i { flex-basis: 100%; padding-left: 56px; }
	.cje .cje-etat > span::after { top: 50%; transform: translateY(-50%); }
	.cje .cje-actions .cje-bouton { width: 100%; }
	.cje .cje-res-cas { padding: 24px 22px 26px; border-radius: 24px; }
	.cje .cje-res-cas .cje-bouton { width: 100%; }
	.cje .cje-appareil-dessin { width: 96px; }
}
@media (prefers-reduced-motion: reduce) {
	.cje .cje-entre, .cje-demande.cje-entre, .cje .cje-prix.cje-fini .cje-montant { animation: none; }
	.cje .cje-progres::after, .cje .cje-progres b, .cje .cje-bouton, .cje .cje-modele > span, .cje .cje-etat > span { transition: none; }
}
