/**
 * Formulaire public « Demander un devis ».
 * Styles auto-portés et préfixés .dfx-public pour cohabiter avec n'importe
 * quel thème. Les couleurs s'appuient sur des variables surchargeables.
 */

.dfx-public {
	--dfx-accent: #1a3c5e;
	--dfx-accent-clair: #eaf1f8;
	--dfx-bord: #d9dee3;
	--dfx-texte: #1d2733;
	--dfx-doux: #6b7580;
	max-width: 720px;
	margin: 1.5em auto;
	color: var( --dfx-texte );
	font-size: 16px;
	line-height: 1.5;
}

.dfx-public * { box-sizing: border-box; }

.dfx-public-chargement,
.dfx-public-vide,
.dfx-public-erreur {
	padding: 18px;
	border: 1px solid var( --dfx-bord );
	border-radius: 10px;
	color: var( --dfx-doux );
	text-align: center;
}
.dfx-public-erreur { color: #b32d2e; border-color: #f0c8c8; background: #fcf0f0; }

.dfx-public-form {
	border: 1px solid var( --dfx-bord );
	border-radius: 14px;
	padding: 24px;
	background: #fff;
	box-shadow: 0 2px 14px rgba( 20, 40, 70, .06 );
}

.dfx-public-titre {
	margin: 0 0 16px;
	font-size: 1.4em;
	color: var( --dfx-accent );
}

/* Liste des prestations */
.dfx-p-liste { display: flex; flex-direction: column; gap: 8px; }

.dfx-p-item {
	display: grid;
	grid-template-columns: 1fr auto auto;
	gap: 14px;
	align-items: center;
	padding: 12px 14px;
	border: 1px solid var( --dfx-bord );
	border-radius: 10px;
	transition: border-color .15s, background .15s;
}
.dfx-p-item.is-on {
	border-color: var( --dfx-accent );
	background: var( --dfx-accent-clair );
}
.dfx-p-nom { font-weight: 600; display: block; }
.dfx-p-sous { color: var( --dfx-doux ); font-size: .86em; display: block; margin-top: 2px; }
.dfx-p-prix { white-space: nowrap; color: var( --dfx-accent ); font-weight: 600; }

.dfx-p-qty { display: inline-flex; align-items: center; gap: 4px; }
.dfx-p-qty button {
	width: 32px;
	height: 32px;
	border: 1px solid var( --dfx-bord );
	background: #fff;
	border-radius: 8px;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	color: var( --dfx-accent );
}
.dfx-p-qty button:hover { background: var( --dfx-accent-clair ); }
.dfx-p-nb {
	width: 48px;
	height: 32px;
	text-align: center;
	border: 1px solid var( --dfx-bord );
	border-radius: 8px;
	font-size: 15px;
	-moz-appearance: textfield;
}
.dfx-p-nb::-webkit-outer-spin-button,
.dfx-p-nb::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Champs */
.dfx-p-champ { display: flex; flex-direction: column; gap: 4px; font-size: .82em; font-weight: 600; }
.dfx-p-champ > span { color: var( --dfx-doux ); }
.dfx-p-champ input,
.dfx-p-champ select,
.dfx-p-champ textarea {
	width: 100%;
	padding: 9px 11px;
	border: 1px solid var( --dfx-bord );
	border-radius: 8px;
	font-size: 15px;
	font-weight: 400;
	font-family: inherit;
	color: var( --dfx-texte );
	background: #fff;
}
.dfx-p-champ input:focus,
.dfx-p-champ select:focus,
.dfx-p-champ textarea:focus {
	outline: none;
	border-color: var( --dfx-accent );
	box-shadow: 0 0 0 3px rgba( 26, 60, 94, .12 );
}
.dfx-p-req > span::after { content: " *"; color: #b32d2e; }

.dfx-p-urg { margin: 16px 0; max-width: 320px; }

.dfx-p-coord {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px 14px;
	margin-top: 8px;
}
.dfx-p-large { grid-column: 1 / -1; }

/* Totaux */
.dfx-p-totaux {
	margin: 16px 0;
	border: 1px solid var( --dfx-bord );
	border-radius: 10px;
	overflow: hidden;
}
.dfx-p-totaux > div {
	display: flex;
	justify-content: space-between;
	padding: 8px 14px;
	font-size: .95em;
}
.dfx-p-totaux > div:nth-child( odd ) { background: #f6f8fa; }
.dfx-p-fort {
	background: var( --dfx-accent ) !important;
	color: #fff;
	font-size: 1.05em !important;
	font-weight: 700;
}

/* Envoi */
.dfx-public-msg {
	margin: 12px 0;
	padding: 10px 14px;
	border-radius: 8px;
	background: #eef6ec;
	color: #205c1f;
	font-size: .92em;
}
.dfx-public-msg.est-erreur { background: #fcf0f0; color: #b32d2e; }

.dfx-public-envoyer {
	display: block;
	width: 100%;
	margin-top: 8px;
	padding: 14px 18px;
	border: none;
	border-radius: 10px;
	background: var( --dfx-accent );
	color: #fff;
	font-size: 1.02em;
	font-weight: 700;
	cursor: pointer;
	transition: filter .15s;
}
.dfx-public-envoyer:hover { filter: brightness( 1.08 ); }
.dfx-public-envoyer:disabled { opacity: .6; cursor: default; }

.dfx-public-mention {
	margin: 10px 0 0;
	text-align: center;
	color: var( --dfx-doux );
	font-size: .82em;
}

/* Confirmation */
.dfx-public-ok {
	text-align: center;
	padding: 34px 24px;
	border: 1px solid var( --dfx-bord );
	border-radius: 14px;
	background: #fff;
}
.dfx-public-ok-ico {
	width: 64px;
	height: 64px;
	margin: 0 auto 12px;
	border-radius: 50%;
	background: #eef6ec;
	color: #2e7d32;
	font-size: 34px;
	line-height: 64px;
}
.dfx-public-ok h3 { margin: 0 0 8px; color: var( --dfx-accent ); }
.dfx-public-pdf {
	display: inline-block;
	margin-top: 14px;
	padding: 11px 20px;
	border-radius: 10px;
	background: var( --dfx-accent );
	color: #fff !important;
	text-decoration: none;
	font-weight: 700;
}
.dfx-public-pdf:hover { filter: brightness( 1.08 ); }

@media ( max-width: 540px ) {
	.dfx-p-item { grid-template-columns: 1fr auto; }
	.dfx-p-qty { grid-column: 1 / -1; justify-content: flex-end; }
	.dfx-p-coord { grid-template-columns: 1fr; }
}
