/* ==========================================================================
   ELR Core — formulaires, suivi, espace chauffeur
   S'appuie sur les couleurs du thème ELR Transport, avec des valeurs de secours.
   ========================================================================== */

.elr-form-devis, .elr-form-contact, .elr-suivi, .elr-chauffeur {
	--v: var(--wp--preset--color--vert, #00C833);
	--b: var(--wp--preset--color--bleu, #0066FF);
	--a: var(--wp--preset--color--anthracite, #0B0F14);
	--g: var(--wp--preset--color--gris-texte, #5A6472);
	--l: var(--wp--preset--color--gris-bordure, #D5DCE5);
	--f: var(--wp--preset--color--gris-fond, #F5F7FA);
	--r: #D92D20;
	--titre: var(--wp--preset--font-family--montserrat, system-ui, sans-serif);
	font-size: 1rem;
}

/* ---------- Champs ---------- */
.elr-form { position: relative; }
.elr-form *, .elr-suivi *, .elr-chauffeur * { box-sizing: border-box; }
.elr-f-grille { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1rem 1.1rem; }
.elr-f-champ { grid-column: span 6; display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.elr-f-champ--demi { grid-column: span 3; }
.elr-f-champ--tiers { grid-column: span 2; }
@media (max-width: 640px) { .elr-f-champ--demi, .elr-f-champ--tiers { grid-column: span 6; } }

.elr-f-champ > label, .elr-prestations legend { font-family: var(--titre); font-weight: 600; font-size: .9rem; color: var(--a); }
.elr-f-champ abbr, .elr-prestations abbr { color: var(--v); text-decoration: none; }

.elr-form input:not([type=checkbox]):not([type=radio]),
.elr-form select,
.elr-form textarea,
.elr-suivi input {
	width: 100%;
	font: inherit;
	color: var(--a);
	background: #fff;
	border: 1.5px solid var(--l);
	border-radius: 12px;
	padding: .85rem 1rem;
	min-height: 52px;
	transition: border-color .18s, box-shadow .18s;
	appearance: none;
}
.elr-form select { background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%235A6472' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") right 1rem center / 18px no-repeat; padding-right: 2.6rem; }
.elr-form textarea { min-height: 120px; resize: vertical; }
.elr-form input:focus, .elr-form select:focus, .elr-form textarea:focus, .elr-suivi input:focus {
	outline: none;
	border-color: var(--b);
	box-shadow: 0 0 0 4px rgba(0, 102, 255, .15);
}
.elr-form ::placeholder, .elr-suivi ::placeholder { color: #9AA4B2; }

.elr-f-champ--case label { display: flex; gap: .7rem; align-items: flex-start; font-family: inherit; font-weight: 400; font-size: .92rem; line-height: 1.5; cursor: pointer; color: var(--g); }
.elr-f-champ--case input, .elr-form input[type=checkbox] { width: 22px; height: 22px; flex: none; margin: 0; accent-color: var(--v); }

.has-erreur input, .has-erreur select, .has-erreur textarea { border-color: var(--r) !important; }
.elr-f-erreur { color: var(--r); font-size: .85rem; margin: 0; font-weight: 500; }
.elr-f-alerte { background: #FEF3F2; color: #912018; border-left: 4px solid var(--r); padding: .9rem 1.1rem; border-radius: 10px; font-size: .95rem; }
.elr-f-ok { background: #ECFDF3; color: #05603A; border-left: 4px solid var(--v); padding: .9rem 1.1rem; border-radius: 10px; }
.elr-f-note { color: var(--g); font-size: .85rem; margin-top: 1rem; }
.elr-piege { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Boutons ---------- */
.elr-btn {
	font-family: var(--titre);
	font-weight: 700;
	font-size: .95rem;
	border: 0;
	border-radius: 999px;
	padding: .95rem 1.7rem;
	min-height: 52px;
	background: var(--v);
	color: var(--a);
	cursor: pointer;
	box-shadow: 0 10px 30px -10px rgba(0, 200, 51, .55);
	transition: background .18s, transform .18s;
}
.elr-btn:hover { background: #1BE04E; }
.elr-btn:active { transform: scale(.98); }
.elr-btn:focus-visible { outline: 2px solid var(--b); outline-offset: 3px; }
.elr-btn--secondaire { background: transparent; box-shadow: inset 0 0 0 2px var(--l); }
.elr-btn--secondaire:hover { background: var(--f); }
.elr-btn--alerte { background: #fff; color: var(--r); box-shadow: inset 0 0 0 2px #FDA29B; }
.elr-btn--alerte:hover { background: #FEF3F2; }
.elr-btn--grand { width: 100%; min-height: 60px; font-size: 1.05rem; }
.elr-btn[disabled] { opacity: .7; cursor: wait; }
.elr-btn.is-envoi::after { content: ""; display: inline-block; width: 14px; height: 14px; margin-left: .6rem; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -2px; animation: elr-tourne .7s linear infinite; }
@keyframes elr-tourne { to { transform: rotate(360deg); } }
.elr-f-actions { display: flex; gap: .8rem; justify-content: space-between; margin-top: 1.6rem; flex-wrap: wrap; }
.elr-f-actions .elr-btn:only-child, .elr-f-actions [type=submit], .elr-f-actions [data-elr-suivant] { margin-left: auto; }

/* ---------- Devis en étapes ---------- */
.elr-form-devis .elr-form {
	background: #fff;
	border: 1px solid #E8ECF1;
	border-radius: 22px;
	padding: clamp(1.25rem, 4vw, 2.5rem);
	box-shadow: 0 30px 60px -35px rgba(11, 15, 20, .35);
}
.elr-progression { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; padding: 0; margin: 0 0 2rem; counter-reset: e; }
.elr-progression li { position: relative; display: flex; align-items: center; gap: .6rem; padding-top: .9rem; font-family: var(--titre); font-weight: 600; font-size: .85rem; color: #9AA4B2; }
.elr-progression li::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; border-radius: 4px; background: #E8ECF1; transition: background .3s; }
.elr-progression span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #E8ECF1; color: var(--g); font-size: .78rem; flex: none; transition: background .3s, color .3s; }
.elr-progression li.is-active, .elr-progression li.is-fait { color: var(--a); }
.elr-progression li.is-active::before { background: linear-gradient(90deg, var(--v), var(--b)); }
.elr-progression li.is-fait::before { background: var(--v); }
.elr-progression li.is-active span { background: var(--a); color: #fff; }
.elr-progression li.is-fait span { background: var(--v); color: var(--a); }
@media (max-width: 520px) { .elr-progression li { font-size: 0; gap: 0; } .elr-progression span { font-size: .78rem; } }

.elr-etape-form { border: 0; padding: 0; margin: 0 0 2rem; min-width: 0; }
.is-etapes .elr-etape-form { margin: 0; animation: elr-glisse .35s cubic-bezier(.2, .7, .2, 1); }
.elr-form:not(.is-etapes) .elr-etape-form + .elr-etape-form { border-top: 1px solid #E8ECF1; padding-top: 2rem; }
.elr-form:not(.is-etapes) .elr-progression { display: none; }
.elr-etape-form__titre { font-family: var(--titre); font-weight: 800; font-size: 1.3rem; padding: 0; margin-bottom: 1.2rem; color: var(--a); outline: none; }
@keyframes elr-glisse { from { opacity: 0; translate: 16px 0; } }
@media (prefers-reduced-motion: reduce) { .is-etapes .elr-etape-form { animation: none; } }

.elr-f-ligne { grid-column: span 6; display: grid; grid-template-columns: repeat(6, 1fr); gap: 1rem 1.1rem; }
.elr-f-sous-titre { grid-column: span 6; font-family: var(--titre); font-weight: 700; font-size: .78rem; letter-spacing: .08em; color: var(--b); margin-bottom: -.4rem; }

.elr-prestations { grid-column: span 6; border: 0; padding: 0; margin: 0; }
.elr-prestations legend { margin-bottom: .7rem; padding: 0; }
.elr-prestations__grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .6rem; }
.elr-prestation { position: relative; cursor: pointer; }
.elr-prestation input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.elr-prestation span {
	display: flex;
	align-items: center;
	min-height: 58px;
	padding: .8rem 1rem .8rem 2.7rem;
	border: 1.5px solid var(--l);
	border-radius: 14px;
	font-size: .9rem;
	font-weight: 500;
	line-height: 1.3;
	transition: border-color .18s, background .18s, box-shadow .18s;
}
.elr-prestation span::before { content: ""; position: absolute; left: 1rem; top: 50%; translate: 0 -50%; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #B4BECB; transition: all .18s; }
.elr-prestation:hover span { border-color: #9AA4B2; }
.elr-prestation input:checked + span { border-color: var(--v); background: rgba(0, 200, 51, .06); box-shadow: 0 0 0 3px rgba(0, 200, 51, .15); }
.elr-prestation input:checked + span::before { border-color: var(--v); background: var(--v); box-shadow: inset 0 0 0 3px #fff; }
.elr-prestation input:focus-visible + span { outline: 2px solid var(--b); outline-offset: 2px; }
.elr-prestations.has-erreur .elr-prestation span { border-color: #FDA29B; }

/* ---------- Succès ---------- */
.elr-f-succes { text-align: center; padding: clamp(2rem, 6vw, 3.5rem) 1.5rem; background: #fff; border-radius: 22px; border: 1px solid #E8ECF1; outline: none; }
.elr-f-succes svg { width: 72px; height: 72px; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.elr-f-succes circle { stroke: var(--v); stroke-dasharray: 160; stroke-dashoffset: 160; animation: elr-trait .6s ease-out forwards; }
.elr-f-succes path { stroke: var(--a); stroke-dasharray: 40; stroke-dashoffset: 40; animation: elr-trait .4s .5s ease-out forwards; }
.elr-f-succes h3 { font-family: var(--titre); font-size: 1.6rem; margin: 1rem 0 .4rem; }
.elr-f-succes p { color: var(--g); max-width: 46ch; margin: 0 auto; }
@keyframes elr-trait { to { stroke-dashoffset: 0; } }

/* ---------- Suivi ---------- */
.elr-suivi__form { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: .7rem; align-items: end; }
.elr-suivi__form label { display: flex; flex-direction: column; gap: .35rem; font-family: var(--titre); font-weight: 600; font-size: .82rem; }
.elr-suivi__form input[name=suivi] { text-transform: uppercase; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .elr-suivi__form { grid-template-columns: 1fr 1fr; } .elr-suivi__form label:first-child { grid-column: span 2; } }
.elr-suivi--compact .elr-suivi__form { align-items: center; }
.elr-suivi--compact .elr-suivi__form label { gap: 0; }
.elr-suivi--compact .elr-suivi__form label span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.elr-suivi .elr-f-alerte { margin-top: 1rem; }
.elr-suivi__resultat { margin-top: 1.6rem; background: #fff; border: 1px solid #E8ECF1; border-radius: 22px; padding: clamp(1.25rem, 4vw, 2.25rem); box-shadow: 0 30px 60px -35px rgba(11, 15, 20, .35); }
.elr-suivi__entete { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.elr-suivi__entete small { display: block; color: var(--g); font-size: .8rem; }
.elr-suivi__entete strong { font-family: var(--titre); font-size: 1.4rem; letter-spacing: .04em; }
.elr-suivi__message { font-size: 1.15rem; font-weight: 500; margin: 1rem 0 1.4rem; }
.elr-suivi__trajet { display: grid; grid-template-columns: auto 1fr auto; gap: 1.2rem; align-items: center; }
.elr-suivi__trajet > div:not(.elr-suivi__route) small { display: block; color: var(--g); font-size: .75rem; }
.elr-suivi__trajet strong { display: block; font-family: var(--titre); font-size: 1.15rem; }
.elr-suivi__trajet span { color: var(--g); font-size: .85rem; }
.elr-suivi__trajet > div:last-child { text-align: right; }
.elr-suivi__route { position: relative; height: 8px; border-radius: 99px; background: #E8ECF1; }
.elr-suivi__route span { position: absolute; inset: 0 auto 0 0; width: var(--avancement); border-radius: inherit; background: linear-gradient(90deg, var(--v), var(--b)); animation: elr-avance 1.2s cubic-bezier(.2, .7, .2, 1) both; }
.elr-suivi__route span::after { content: ""; position: absolute; right: -9px; top: 50%; translate: 0 -50%; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 4px solid var(--b); }
.is-incident .elr-suivi__route span { background: var(--r); }
@keyframes elr-avance { from { width: 0; } }
@media (max-width: 640px) { .elr-suivi__trajet { grid-template-columns: 1fr 1fr; } .elr-suivi__route { grid-column: span 2; order: 3; } }

.elr-suivi__jalons { list-style: none; padding: 0; margin: 1.6rem 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; font-size: .8rem; font-weight: 600; color: #9AA4B2; }
.elr-suivi__jalons li { border-top: 3px solid #E8ECF1; padding-top: .5rem; }
.elr-suivi__jalons li.is-fait { border-color: var(--v); color: var(--a); }
.elr-suivi__jalons li.is-courant { border-color: var(--b); color: var(--b); }
.elr-suivi__h { font-family: var(--titre); font-size: 1rem; margin: 1.8rem 0 .6rem; }
.elr-suivi__historique { list-style: none; padding: 0; margin: 0; border-left: 2px solid #E8ECF1; }
.elr-suivi__historique li { position: relative; padding: 0 0 1rem 1.2rem; }
.elr-suivi__historique li::before { content: ""; position: absolute; left: -7px; top: .35rem; width: 12px; height: 12px; border-radius: 50%; background: var(--v); box-shadow: 0 0 0 3px #fff; }
.elr-suivi__historique time { display: block; font-size: .78rem; color: var(--g); }
.elr-suivi__historique p { margin: .2rem 0 0; color: var(--g); font-size: .92rem; }

.elr-badge { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .75rem; border-radius: 99px; font-size: .78rem; font-weight: 700; color: var(--c, #5A6472); background: color-mix(in srgb, var(--c, #5A6472) 12%, #fff); white-space: nowrap; }
.elr-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---------- Espace chauffeur (téléphone d'abord) ---------- */
.elr-chauffeur { max-width: 640px; margin-inline: auto; }
.elr-chauffeur__bonjour { color: var(--g); }
.elr-chauffeur__mission { background: #fff; border: 1px solid #E8ECF1; border-radius: 20px; padding: 1.2rem; margin-bottom: 1.2rem; box-shadow: 0 20px 40px -30px rgba(11, 15, 20, .35); scroll-margin-top: 90px; }
.elr-chauffeur__mission header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .8rem; font-family: var(--titre); font-size: 1.1rem; }
.elr-chauffeur__mission dl { display: grid; grid-template-columns: 7.5rem 1fr; gap: .55rem .8rem; margin: 0 0 1rem; font-size: .95rem; }
.elr-chauffeur__mission dt { color: var(--g); font-size: .85rem; }
.elr-chauffeur__mission dd { margin: 0; }
.elr-chauffeur__mission dd a { font-weight: 700; color: var(--b); }
.elr-chauffeur__actions { display: grid; gap: .6rem; }
.elr-chauffeur__actions textarea { width: 100%; font: inherit; border: 1.5px solid var(--l); border-radius: 12px; padding: .7rem .9rem; }
@media (max-width: 480px) { .elr-chauffeur__mission dl { grid-template-columns: 1fr; gap: .1rem; } .elr-chauffeur__mission dd { margin-bottom: .6rem; } }

/* ---------- Coordonnées ---------- */
.elr-coord { list-style: none; padding: 0; margin: 0; display: grid; gap: .8rem; font-size: .95rem; }
.elr-coord li { position: relative; padding-left: 1.9rem; }
.elr-coord li::before { content: ""; position: absolute; left: 0; top: .15rem; width: 1.2rem; height: 1.2rem; background: var(--wp--preset--color--vert, #00C833); -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.elr-coord a { color: inherit; text-decoration: none; }
.elr-coord a:hover { text-decoration: underline; }
.elr-coord__adresse { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M12 21s-7-6-7-11a7 7 0 0 1 14 0c0 5-7 11-7 11z'/%3E%3Ccircle cx='12' cy='10' r='2.5'/%3E%3C/svg%3E"); }
.elr-coord__tel { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M5 4h4l2 5-2.5 1.5a11 11 0 0 0 5 5L15 13l5 2v4a2 2 0 0 1-2 2A16 16 0 0 1 3 6a2 2 0 0 1 2-2'/%3E%3C/svg%3E"); }
.elr-coord__email { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M3 7l9 6 9-6'/%3E%3C/svg%3E"); }
.elr-coord__horaires { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E"); }

.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
