/*
 * Formulaire de devis. Reprend les couleurs du thème quand elles existent
 * (variables --wp--preset--color--…), avec des valeurs de secours sinon.
 */
.ddd {
	--d-bordeaux: var(--wp--preset--color--bordeaux, #8E1638);
	--d-nuit: var(--wp--preset--color--bordeaux-nuit, #3D0213);
	--d-nuit-3: var(--wp--preset--color--nuit-profonde, #1A0509);
	--d-voile: var(--wp--preset--color--rose-voile, #FBF1F3);
	--d-poudre: var(--wp--preset--color--rose-poudre, #FFB0C2);
	--d-lumiere: var(--wp--preset--color--rose-lumiere, #F27A98);
	--d-prune: var(--wp--preset--color--prune, #5E4A50);
	--d-clair: var(--wp--preset--color--texte-clair, #F3E3E7);
	--d-filet: #EBDDE1;
	--d-titre: var(--wp--preset--font-family--titre, Georgia, serif);
	scroll-margin-top: 24px;
}
.ddd *, .ddd *::before, .ddd *::after { box-sizing: border-box; }
.ddd p { margin: 0; }

/* Progression */
.ddd-progression { list-style: none; margin: 0 0 48px; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.ddd-progression li { display: flex; align-items: center; gap: 12px; color: var(--d-prune); }
.ddd-progression li + li::before { content: ""; flex: 0 0 60px; height: 3px; background: var(--d-filet); margin-right: 4px; }
.ddd-progression span { width: 40px; height: 40px; border-radius: 999px; border: 2px solid var(--d-filet); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.ddd-progression .est-active, .ddd-progression .est-faite { color: inherit; font-weight: 600; }
.ddd-progression .est-active span, .ddd-progression .est-faite span { background: var(--d-bordeaux); border-color: var(--d-bordeaux); color: #fff; }
.ddd-progression .est-faite + li::before, .ddd-progression .est-active + li::before { background: linear-gradient(90deg, var(--d-bordeaux), var(--d-filet)); }
.ddd:not(.ddd--js) .ddd-progression { display: none; }
/* Glissement latéral entre les étapes, et ligne de progression qui se remplit */
.ddd-entre-avant { animation: ddd-avant .55s cubic-bezier(.22, 1, .36, 1); }
.ddd-entre-arriere { animation: ddd-arriere .55s cubic-bezier(.22, 1, .36, 1); }
@keyframes ddd-avant { from { opacity: 0; transform: translateX(48px); } to { opacity: 1; transform: none; } }
@keyframes ddd-arriere { from { opacity: 0; transform: translateX(-48px); } to { opacity: 1; transform: none; } }
.ddd-progression .est-active + li::before, .ddd-progression .est-faite + li::before { animation: ddd-ligne .7s ease-out; background-size: 100% 100%; background-repeat: no-repeat; }
@keyframes ddd-ligne { from { background-size: 0 100%; } to { background-size: 100% 100%; } }
@media (prefers-reduced-motion: reduce) { .ddd-entre-avant, .ddd-entre-arriere, .ddd-progression li::before { animation: none !important; } }
@media (max-width: 640px) {
	.ddd-progression { flex-wrap: nowrap; gap: 8px; font-size: 13px; margin-bottom: 32px; }
	.ddd-progression li { flex-direction: column; gap: 6px; text-align: center; flex: 1 1 0; }
	.ddd-progression li + li::before { display: none; }
	.ddd-progression span { width: 32px; height: 32px; }
}

/* Grille formulaire + estimation */
.ddd-grille { display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; }
.ddd-form { flex: 3 1 560px; min-width: 0; }
.ddd-etape { display: flex; flex-direction: column; gap: 32px; }
.ddd:not(.ddd--js) .ddd-etape + .ddd-etape { margin-top: 56px; padding-top: 56px; border-top: 1px solid var(--d-filet); }
.ddd-etape[hidden] { display: none; }
.ddd-bloc { border: 0; margin: 0; padding: 0; min-width: 0; }
.ddd-legende { font-family: var(--d-titre); font-size: 30px; font-weight: 600; line-height: 1.2; margin-bottom: 20px; padding: 0; }
.ddd-legende:focus { outline: none; }
.ddd-bloc--petit legend { font-weight: 600; font-size: 15px; margin-bottom: 10px; padding: 0; }
.ddd-aide { margin-top: 8px !important; font-size: 14px; color: var(--d-prune); }
.ddd-bloc > .ddd-aide:first-of-type { margin: 0 0 16px !important; font-size: 15px; }

/* Cartes de formule */
.ddd-cartes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ddd-carte { position: relative; display: block; padding: 18px 18px 18px 46px; border: 1px solid var(--d-filet); background: #fff; cursor: pointer; transition: border-color .2s, box-shadow .2s, background-color .2s; }
.ddd-carte input { position: absolute; left: 18px; top: 21px; accent-color: var(--d-bordeaux); }
.ddd-carte__nom { display: block; font-weight: 600; }
.ddd-carte__prix { display: block; font-size: 14px; color: var(--d-prune); }
.ddd-carte:hover { border-color: var(--d-bordeaux); }
.ddd-carte.est-choisie { border: 2px solid var(--d-bordeaux); padding: 17px 17px 17px 45px; background: var(--d-voile); box-shadow: 0 16px 40px rgba(142, 22, 56, .15); }
.ddd-carte.est-choisie input { left: 17px; top: 20px; }
.ddd-carte.est-choisie .ddd-carte__prix { color: var(--d-bordeaux); }
@media (max-width: 640px) { .ddd-cartes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Options */
.ddd-options { border: 1px solid var(--d-bordeaux); background: #fff; box-shadow: 0 20px 50px rgba(61, 2, 19, .10); }
.ddd-option { display: flex; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid #F3E8EB; cursor: pointer; }
.ddd-option:last-child { border-bottom: 0; }
.ddd-option[hidden] { display: none; }
.ddd-option input { accent-color: var(--d-bordeaux); margin-right: 6px; }
.ddd-option.est-choisie { background: var(--d-voile); }
.ddd-option__prix { white-space: nowrap; font-weight: 600; }

/* Champs */
.ddd-champ { display: flex; flex-direction: column; gap: 8px; }
.ddd-champ label { font-weight: 600; font-size: 15px; }
.ddd input[type="text"], .ddd input[type="email"], .ddd input[type="tel"], .ddd textarea, .ddd select {
	font: inherit; font-weight: 400; width: 100%; padding: 14px; border: 1px solid var(--d-filet); border-radius: 4px; background: #fff; color: inherit;
}
.ddd input:focus-visible, .ddd textarea:focus-visible, .ddd select:focus-visible { outline: 2px solid var(--d-bordeaux); outline-offset: 1px; }
.ddd [aria-invalid="true"] { border-color: #B00020; background: #FFF5F6; }
.ddd-bloc--petit .ddd-champ { margin-top: 10px !important; }
.ddd-deux { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 640px) { .ddd-deux { grid-template-columns: 1fr; } }
.ddd-pilules { display: flex; flex-wrap: wrap; gap: 8px; }
.ddd-pilules label { padding: 10px 18px; border: 1px solid var(--d-filet); border-radius: 999px; cursor: pointer; }
.ddd-pilules label:has(input:checked) { border: 2px solid var(--d-bordeaux); padding: 9px 17px; background: var(--d-voile); }
.ddd-pilules input, .ddd-choix input { accent-color: var(--d-bordeaux); }
.ddd-choix { display: block; padding: 16px 18px; border: 1px solid var(--d-filet); margin-bottom: 8px; cursor: pointer; }
.ddd-choix:has(input:checked) { border: 2px solid var(--d-bordeaux); padding: 15px 17px; background: var(--d-voile); }
.ddd-choix .ddd-aide { display: block; }
.ddd-reco { font-size: 13px; color: var(--d-bordeaux); font-weight: 600; }
.ddd-recap { padding: 20px; background: var(--d-voile); font-size: 15px; line-height: 24px; }

/* Boutons */
.ddd-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; flex-wrap: wrap; }
.ddd-actions .ddd-retour { margin-right: auto; }
.ddd-bouton { font: inherit; font-weight: 600; font-size: 16px; padding: 16px 32px; min-height: 44px; border: 0; border-radius: 999px; background: var(--d-bordeaux); color: #fff; cursor: pointer; transition: transform .3s, background-color .3s; }
.ddd-bouton:hover { transform: translateY(-2px); background: var(--d-nuit); }
.ddd-retour { font: inherit; background: none; border: 0; padding: 10px 0; color: var(--d-prune); text-decoration: underline; cursor: pointer; }
.ddd:not(.ddd--js) [data-suivant], .ddd:not(.ddd--js) [data-precedent] { display: none; }

/* Estimation */
.ddd-estimation {
	flex: 2 1 340px; min-width: 0; padding: 36px; color: #fff; position: sticky; top: 24px;
	background: radial-gradient(60% 70% at 20% 0%, rgba(242, 122, 152, .45) 0%, rgba(142, 22, 56, 0) 65%), linear-gradient(165deg, var(--d-nuit) 0%, var(--d-nuit-3) 100%);
	box-shadow: 0 40px 80px rgba(61, 2, 19, .35);
}
.ddd-estimation__titre { font-family: var(--d-titre); font-style: italic; font-size: 24px; color: var(--d-poudre); }
.ddd-estimation__lignes { list-style: none; margin: 24px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: 15px; }
.ddd-estimation__lignes li { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid #3E1520; }
.ddd-estimation__lignes li span:last-child { white-space: nowrap; }
.ddd-estimation__label { margin-top: 28px !important; font-size: 14px; color: #FFC2D0; }
.ddd-estimation__total { font-family: var(--d-titre); font-size: 64px; font-weight: 600; line-height: 1; white-space: nowrap; }
.ddd-estimation__htva { margin-top: 6px !important; font-size: 14px; color: var(--d-clair); }
.ddd-estimation__note { margin-top: 24px !important; font-size: 14px; line-height: 22px; color: var(--d-clair); }
@media (max-width: 900px) { .ddd-estimation { position: static; } .ddd-estimation__total { font-size: 48px; } }

/* Messages */
.ddd-alerte { margin-bottom: 32px !important; padding: 16px 20px; border-left: 4px solid #B00020; background: #FFF5F6; }
.ddd-merci { padding: 48px; background: var(--wp--preset--color--rose-voile, #FBF1F3); text-align: center; }
.ddd-merci__titre { font-family: var(--wp--preset--font-family--titre, Georgia, serif); font-size: 36px; margin-bottom: 12px !important; }
.ddd-piege { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
