/* MD Forms — styles front. Personnalisables via les variables CSS. */
.mdf-container {
	--mdf-accent: #2271b1;
	--mdf-text: #1f2937;
	--mdf-muted: #6b7280;
	--mdf-border: #d1d5db;
	--mdf-bg: #ffffff;
	--mdf-error: #b42318;
	--mdf-error-bg: #fef3f2;
	--mdf-success: #067647;
	--mdf-success-bg: #ecfdf3;
	--mdf-radius: 6px;
	--mdf-gap: 20px;
	color: var(--mdf-text);
	font-size: 16px;
	line-height: 1.5;
	max-width: 100%;
	margin: 0 0 1.5em;
}
.mdf-container *,
.mdf-container *::before,
.mdf-container *::after { box-sizing: border-box; }

.mdf-head { margin-bottom: 20px; }
.mdf-title { margin: 0 0 6px; font-size: 1.5em; line-height: 1.25; }
.mdf-form-desc { color: var(--mdf-muted); }
.mdf-form-desc p:last-child { margin-bottom: 0; }

.mdf-fields {
	display: flex;
	flex-wrap: wrap;
	gap: var(--mdf-gap) 16px;
}
.mdf-field { flex: 0 0 100%; min-width: 0; margin: 0; padding: 0; }
.mdf-size-medium { flex-basis: calc(50% - 8px); }
.mdf-size-small { flex-basis: calc(33.333% - 11px); }
@media (max-width: 600px) {
	.mdf-size-medium,
	.mdf-size-small { flex-basis: 100%; }
}
.mdf-field[hidden],
.mdf-field-is-hidden { display: none !important; }

.mdf-label,
.mdf-fieldset > legend {
	display: block;
	font-weight: 600;
	font-size: .95em;
	margin: 0 0 6px;
	padding: 0;
	color: var(--mdf-text);
}
.mdf-required { color: var(--mdf-error); font-weight: 700; }
.mdf-sublabel { display: block; font-size: .8em; color: var(--mdf-muted); margin-top: 4px; }
.mdf-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }

.mdf-container .mdf-input {
	display: block;
	width: 100%;
	max-width: 100%;
	min-height: 44px;
	padding: 10px 12px;
	font: inherit;
	font-size: 16px;
	color: var(--mdf-text);
	background: var(--mdf-bg);
	border: 1px solid var(--mdf-border);
	border-radius: var(--mdf-radius);
	box-shadow: none;
	transition: border-color .15s, box-shadow .15s;
	margin: 0;
}
.mdf-container textarea.mdf-input { min-height: 110px; resize: vertical; }
.mdf-container select.mdf-input {
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%236b7280' stroke-width='1.5' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	padding-right: 36px;
}
.mdf-container .mdf-input:focus {
	outline: none;
	border-color: var(--mdf-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--mdf-accent) 22%, transparent);
}
.mdf-container .mdf-input.mdf-file { padding: 8px; min-height: 0; }
.mdf-file-hint,
.mdf-description { font-size: .85em; color: var(--mdf-muted); margin-top: 6px; }

.mdf-row { display: flex; gap: 12px; }
.mdf-col { flex: 1 1 0; min-width: 0; }
@media (max-width: 480px) { .mdf-row { flex-direction: column; gap: 10px; } }

.mdf-choices { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px 16px; }
.mdf-layout-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mdf-layout-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mdf-layout-inline { display: flex; flex-wrap: wrap; gap: 8px 20px; }
@media (max-width: 480px) {
	.mdf-layout-two,
	.mdf-layout-three { grid-template-columns: 1fr; }
}
.mdf-choices li { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 0; }
.mdf-choices li::before { content: none; }
.mdf-choices input,
.mdf-gdpr input { width: 18px; height: 18px; margin: 3px 0 0; flex: 0 0 auto; accent-color: var(--mdf-accent); }
.mdf-choices label,
.mdf-gdpr label { font-weight: 400; cursor: pointer; margin: 0; }
.mdf-gdpr { display: flex; align-items: flex-start; gap: 8px; }
.mdf-gdpr label { font-size: .95em; }

/* Note en étoiles (rangée inversée pour le survol CSS). */
.mdf-rating { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.mdf-rating input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.mdf-rating label {
	width: 32px; height: 32px; cursor: pointer;
	background: no-repeat center / 28px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23d1d5db' d='M12 2l3.1 6.3 6.9 1-5 4.9 1.2 6.8L12 17.8 5.8 21l1.2-6.8-5-4.9 6.9-1z'/%3E%3C/svg%3E");
	transition: transform .1s;
}
.mdf-rating label:hover,
.mdf-rating label:hover ~ label,
.mdf-rating input:checked ~ label {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23f5a524' d='M12 2l3.1 6.3 6.9 1-5 4.9 1.2 6.8L12 17.8 5.8 21l1.2-6.8-5-4.9 6.9-1z'/%3E%3C/svg%3E");
}
.mdf-rating input:focus-visible + label { outline: 2px solid var(--mdf-accent); outline-offset: 2px; border-radius: 4px; }
.mdf-rating label:active { transform: scale(.9); }

.mdf-section-title { margin: 12px 0 4px; padding-bottom: 8px; border-bottom: 1px solid var(--mdf-border); font-size: 1.15em; }
.mdf-section-desc { color: var(--mdf-muted); font-size: .9em; }

/* Libellés à gauche. */
@media (min-width: 640px) {
	.mdf-labels-left .mdf-field:not(.mdf-field-section):not(.mdf-field-html):not(.mdf-field-gdpr) {
		display: grid; grid-template-columns: 200px minmax(0, 1fr); column-gap: 16px; align-items: start;
	}
	.mdf-labels-left .mdf-field > .mdf-label { padding-top: 10px; }
	.mdf-labels-left .mdf-field > :not(.mdf-label) { grid-column: 2; }
	.mdf-labels-left .mdf-fieldset { display: contents; }
	.mdf-labels-left .mdf-fieldset > legend { float: left; width: 200px; }
}
.mdf-labels-hidden .mdf-field .mdf-label:not(.mdf-section-title),
.mdf-labels-hidden .mdf-fieldset > legend { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Erreurs. */
.mdf-error { color: var(--mdf-error); font-size: .85em; margin-top: 6px; }
.mdf-error:empty { display: none; }
.mdf-has-error .mdf-input { border-color: var(--mdf-error); }
.mdf-has-error .mdf-input:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--mdf-error) 20%, transparent); }
.mdf-general-error {
	background: var(--mdf-error-bg); color: var(--mdf-error);
	border: 1px solid color-mix(in srgb, var(--mdf-error) 30%, transparent);
	border-radius: var(--mdf-radius); padding: 12px 16px; margin-bottom: 20px; font-size: .95em;
}
.mdf-general-error[hidden] { display: none; }

.mdf-confirmation {
	background: var(--mdf-success-bg); color: var(--mdf-success);
	border: 1px solid color-mix(in srgb, var(--mdf-success) 30%, transparent);
	border-radius: var(--mdf-radius); padding: 16px 20px; margin-bottom: 20px;
}
.mdf-confirmation:focus { outline: none; }
.mdf-confirmation p:last-child { margin-bottom: 0; }

/* Bouton. */
.mdf-submit-wrap { margin-top: 24px; }
.mdf-container .mdf-submit {
	display: inline-flex; align-items: center; justify-content: center; gap: 10px;
	min-height: 46px; padding: 10px 26px;
	font: inherit; font-weight: 600; font-size: 16px; line-height: 1.2;
	color: #fff; background: var(--mdf-accent);
	border: 0; border-radius: var(--mdf-radius); cursor: pointer;
	transition: filter .15s, transform .05s;
}
.mdf-container .mdf-submit:hover { filter: brightness(1.08); }
.mdf-container .mdf-submit:active { transform: translateY(1px); }
.mdf-container .mdf-submit:focus-visible { outline: 3px solid color-mix(in srgb, var(--mdf-accent) 40%, transparent); outline-offset: 2px; }
.mdf-container .mdf-submit:disabled { opacity: .75; cursor: progress; }
.mdf-spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: mdf-spin .7s linear infinite; }
.mdf-busy .mdf-spinner { display: inline-block; }
@keyframes mdf-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .mdf-spinner { animation-duration: 2s; } }

/* Pot de miel. */
.mdf-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.mdf-container .screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px; }
.mdf-notice { padding: 12px; border: 1px dashed #d63638; color: #d63638; }
