/* ==========================================================================
   Formulaires Contact Form 7 – Salon des Arts et du Feu
   (reprend le style des anciens formulaires Gravity Forms : libellés Oswald bleu nuit,
   champs OceanWP, bouton bleu nuit)
   ========================================================================== */

.sdaf-form {
	--sdaf-navy: #211D45;
	--sdaf-blue: #009FE3;
	--sdaf-border: #dddddd;
	--sdaf-error: #d63638;
	--sdaf-success: #1f8a4c;
	font-family: "Lato", sans-serif;
	font-size: 14px;
	color: #333;
}
.sdaf-form p { margin: 0; }

/* Titres de sections */
.sdaf-form .sdaf-section {
	margin: 40px 0 20px;
	padding-bottom: 10px;
	font-family: "Oswald", sans-serif;
	font-size: 22px;
	font-weight: 400;
	line-height: 1.3;
	text-transform: uppercase;
	color: var(--sdaf-navy);
	border-bottom: 2px solid var(--sdaf-navy);
}
.sdaf-form .sdaf-section:first-child { margin-top: 0; }

/* Grille */
.sdaf-grid {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	column-gap: 20px;
	row-gap: 22px;
}
.sdaf-field { grid-column: span 6; min-width: 0; }
.sdaf-half { grid-column: span 3; }
.sdaf-third { grid-column: span 2; }
@media (max-width: 767px) {
	.sdaf-half, .sdaf-third { grid-column: span 6; }
}

/* Libellés */
.sdaf-field > label,
.sdaf-field .sdaf-label,
.sdaf-field [data-class="wpcf7cf_group"] > label {
	display: block;
	margin: 0 0 8px;
	font-family: "Oswald", sans-serif;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.4;
	color: var(--sdaf-navy);
}
.sdaf-req { color: var(--sdaf-error); }
.sdaf-help {
	display: block;
	margin-top: 8px;
	font-size: 13px;
	line-height: 1.5;
	color: #6b6b6b;
}
.sdaf-help--top { margin: -4px 0 10px; }

/* Champs (base OceanWP : 40px, bordure #ddd, arrondi 3px) */
.sdaf-form .wpcf7-form-control-wrap { display: block; position: relative; }
.sdaf-form input[type="text"],
.sdaf-form input[type="email"],
.sdaf-form input[type="tel"],
.sdaf-form input[type="url"],
.sdaf-form select,
.sdaf-form textarea {
	display: block;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	min-height: 40px;
	padding: 6px 12px;
	font-family: inherit;
	font-size: 14px;
	color: #333;
	background-color: #fff;
	border: 1px solid var(--sdaf-border);
	border-radius: 3px;
	box-shadow: none;
	transition: border-color .2s ease, box-shadow .2s ease;
}
.sdaf-form textarea { height: 180px; resize: vertical; line-height: 1.6; }
.sdaf-form input:focus,
.sdaf-form select:focus,
.sdaf-form textarea:focus {
	border-color: var(--sdaf-navy);
	box-shadow: 0 0 0 3px rgba(33, 29, 69, .1);
	outline: none;
}

/* Cases à cocher et boutons radio */
.sdaf-form .wpcf7-checkbox,
.sdaf-form .wpcf7-radio { display: flex; flex-direction: column; gap: 8px; }
.sdaf-form .wpcf7-radio { flex-direction: row; flex-wrap: wrap; gap: 8px 28px; }
.sdaf-form .sdaf-cols-4 .wpcf7-checkbox { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 16px; }
.sdaf-form .sdaf-cols-3 .wpcf7-checkbox { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 16px; }
@media (max-width: 767px) {
	.sdaf-form .sdaf-cols-4 .wpcf7-checkbox { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.sdaf-form .sdaf-cols-3 .wpcf7-checkbox { grid-template-columns: 1fr; }
}
.sdaf-form .wpcf7-list-item { margin: 0; display: block; }
.sdaf-form .wpcf7-list-item label {
	display: inline-flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0;
	font-size: 15px;
	line-height: 20px;
	cursor: pointer;
}
.sdaf-form input[type="checkbox"],
.sdaf-form input[type="radio"] {
	flex: 0 0 18px;
	width: 18px;
	height: 18px;
	margin: 1px 0 0;
	accent-color: var(--sdaf-navy);
	cursor: pointer;
}

/* Consentement RGPD */
.sdaf-consent .wpcf7-list-item label { font-weight: 700; color: var(--sdaf-navy); }

/* Téléversement (Drag and Drop Multiple File Upload) */
.sdaf-form .codedropz-upload-handler {
	margin: 0;
	border: 2px dashed #c9c7d6;
	border-radius: 3px;
	background: #fafafc;
	transition: border-color .2s ease, background-color .2s ease;
}
.sdaf-form .codedropz-upload-handler:hover,
.sdaf-form .codedropz-dragover .codedropz-upload-handler { border-color: var(--sdaf-navy); background: #f3f2f8; }
.sdaf-form .codedropz-upload-inner h3 {
	margin: 0 0 4px;
	font-family: "Oswald", sans-serif;
	font-size: 18px;
	font-weight: 400;
	color: var(--sdaf-navy);
}
.sdaf-form .codedropz-upload-inner span { font-size: 13px; color: #6b6b6b; }
.sdaf-form .cd-upload-btn { color: var(--sdaf-blue) !important; font-weight: 700; text-decoration: underline; }
.sdaf-form .dnd-upload-status .dnd-upload-details .name { color: var(--sdaf-navy); }

/* Turnstile (si activé) */
.sdaf-turnstile { margin-top: 26px; min-height: 65px; }
.sdaf-turnstile + .sdaf-submit { margin-top: 16px; }

/* Bouton d'envoi */
.sdaf-submit { margin-top: 30px; display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.sdaf-form input[type="submit"] {
	min-height: 50px;
	padding: 14px 28px;
	font-family: "Oswald", sans-serif;
	font-size: 18px;
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: .5px;
	text-transform: uppercase;
	color: #fff;
	background-color: var(--sdaf-navy);
	border: 1px solid var(--sdaf-navy);
	border-radius: 0;
	cursor: pointer;
	transition: background-color .3s ease, color .3s ease;
}
.sdaf-form input[type="submit"]:hover,
.sdaf-form input[type="submit"]:focus { background-color: transparent; color: var(--sdaf-navy); }
.sdaf-form input[type="submit"]:disabled { opacity: .6; cursor: not-allowed; }
.sdaf-form .wpcf7-spinner { margin: 0; background-color: var(--sdaf-navy); }

/* Erreurs par champ */
.sdaf-form .wpcf7-not-valid:not(.wpcf7-checkbox):not(.wpcf7-radio):not(.wpcf7-acceptance) { border-color: var(--sdaf-error) !important; }
.sdaf-form .wpcf7-not-valid .codedropz-upload-handler { border-color: var(--sdaf-error); }
.sdaf-form .wpcf7-not-valid-tip {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 6px;
	font-size: 13px;
	line-height: 1.4;
	color: var(--sdaf-error);
	animation: sdafFadeDown .25s ease both;
}
.sdaf-form .wpcf7-not-valid-tip::before {
	content: "!";
	flex: 0 0 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--sdaf-error);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 16px;
	text-align: center;
}

/* Message global (préfixe .wpcf7 form.wpcf7-form : la CSS de CF7 est chargée avant mais reste spécifique) */
.wpcf7 form.wpcf7-form .wpcf7-response-output {
	position: relative;
	margin: 24px 0 0;
	padding: 16px 20px 16px 62px;
	font-size: 15px;
	line-height: 1.5;
	color: #211D45;
	background: #fff;
	border: 0;
	border-left: 4px solid #211D45;
	box-shadow: 0 8px 24px rgba(33, 29, 69, .1);
	animation: sdafFadeDown .35s ease both;
}
.wpcf7 form.wpcf7-form .wpcf7-response-output::before {
	content: "i";
	position: absolute;
	left: 18px;
	top: 50%;
	transform: translateY(-50%);
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: #211D45;
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	line-height: 28px;
	text-align: center;
}
.wpcf7 form.wpcf7-form.invalid .wpcf7-response-output,
.wpcf7 form.wpcf7-form.unaccepted .wpcf7-response-output { border-left-color: #e0a100; background: #fffaf0; }
.wpcf7 form.wpcf7-form.invalid .wpcf7-response-output::before,
.wpcf7 form.wpcf7-form.unaccepted .wpcf7-response-output::before { content: "!"; background: #e0a100; }
.wpcf7 form.wpcf7-form.failed .wpcf7-response-output,
.wpcf7 form.wpcf7-form.aborted .wpcf7-response-output,
.wpcf7 form.wpcf7-form.spam .wpcf7-response-output { border-left-color: #d63638; background: #fdf3f3; }
.wpcf7 form.wpcf7-form.failed .wpcf7-response-output::before,
.wpcf7 form.wpcf7-form.aborted .wpcf7-response-output::before,
.wpcf7 form.wpcf7-form.spam .wpcf7-response-output::before { content: "×"; background: #d63638; font-size: 20px; }

/* Succès : le message remplace le formulaire */
.wpcf7 form.wpcf7-form.sent .sdaf-form { display: none; }
.wpcf7 form.wpcf7-form.sent .wpcf7-response-output {
	margin-top: 0;
	padding-top: 24px;
	padding-bottom: 24px;
	font-size: 16px;
	font-weight: 700;
	border-left-color: #1f8a4c;
	background: #f1faf4;
}
.wpcf7 form.wpcf7-form.sent .wpcf7-response-output::before { content: "✓"; background: #1f8a4c; }

@keyframes sdafFadeDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
	.sdaf-form .wpcf7-not-valid-tip,
	.wpcf7 form.wpcf7-form .wpcf7-response-output { animation: none; }
}
