/* ==========================================================================
   ASLC Web & Digital — Formulaires Intelligents
   Scopé sous .af-form pour ne jamais interférer avec le CSS de Divi 5.
   ========================================================================== */

:root {
	--af-dark: #000000;
	--af-gray: #2B2B2B;
	--af-accent: #F4B2B0;
	--af-text: #ffffff;
}

.af-form {
	--af-muted: rgba(255, 255, 255, 0.65);
	--af-border: rgba(255, 255, 255, 0.22);
	--af-track: rgba(255, 255, 255, 0.22); /* piste de progression : neutre, jamais la couleur accent (sinon "fait"/"à faire" se confondent) */

	box-sizing: border-box;
	width: min(920px, 95vw);
	margin: 0 auto;
	padding: clamp(24px, 4vw, 40px);
	margin-top:-20px;

	/* Effet verre façon iOS : fond sombre semi-transparent + flou du
	   contenu derrière, fonctionne aussi bien posé sur une image que sur
	   un fond de couleur dans le module Divi. */
	background: color-mix(in srgb, var(--af-dark) 55%, transparent);
	-webkit-backdrop-filter: blur(24px) saturate(160%);
	backdrop-filter: blur(24px) saturate(160%);
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 28px;
	box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.5);

	color: var(--af-text);
	font-family: "Montserrat", "Segoe UI", system-ui, sans-serif;
	font-size: 16px;
	line-height: 1.5;
}
.af-form *, .af-form *::before, .af-form *::after { box-sizing: inherit; }

.af-form .af-title {
	font-family: "Montserrat", sans-serif;
	font-weight: 700;
	font-size: clamp(20px, 2.6vw, 26px);
	line-height: 1.25;
	margin: 0 0 22px;
	color: var(--af-text);
}

/* --------------------------------------------------------------------
   Onglets — 3 colonnes desktop/tablette, empilés en mobile. Un seul
   formulaire visible à la fois (basculement au clic).
   -------------------------------------------------------------------- */
.af-form .af-tabs {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
	padding: 6px;
	margin-bottom: 28px;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid var(--af-border);
	border-radius: 999px;
}
@media (max-width: 640px) {
	.af-form .af-tabs { grid-template-columns: 1fr; border-radius: 20px; }
}
.af-form .af-tab {
	appearance: none;
	border: none;
	cursor: pointer;
	background: transparent;
	color: var(--af-muted);
	font: inherit;
	font-weight: 600;
	font-size: 14px;
	padding: 12px 14px;
	border-radius: 999px;
	transition: background 0.2s ease, color 0.2s ease;
}
@media (max-width: 640px) {
	.af-form .af-tab { border-radius: 14px; margin-top: -20px;}
}
.af-form .af-tab:hover { color: var(--af-text); }
.af-form .af-tab.is-active {
	background: var(--af-accent);
	color: #000;
}
.af-form .af-tab:focus-visible { outline: 2px solid var(--af-accent); outline-offset: 2px; }

/* --------------------------------------------------------------------
   Étapes
   -------------------------------------------------------------------- */
.af-form .af-step { display: none; }
.af-form .af-step.is-active {
	display: block;
	animation: af-step-in 0.32s ease both;
}
@keyframes af-step-in {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------
   Barre de progression
   -------------------------------------------------------------------- */
.af-form .af-progress {
	display: flex;
	align-items: center;
	gap: 4px;
	margin-bottom: 24px;
}
.af-form .af-progress[hidden] { display: none; }
.af-form .af-frame {
	flex: 1 1 0;
	height: 6px;
	border-radius: 3px;
	background: var(--af-track);
}
.af-form .af-frame.is-done,
.af-form .af-frame.is-current { background: var(--af-accent); }
.af-form .af-progress-label {
	font-size: 13px;
	color: var(--af-muted);
	margin: 0 0 18px;
}

/* --------------------------------------------------------------------
   Champs
   -------------------------------------------------------------------- */
.af-form .af-fields { display: flex; flex-direction: column; gap: 20px; }
.af-form .af-field label,
.af-form .af-field legend {
	display: block;
	font-weight: 600;
	font-size: 14px;
	margin-bottom: 8px;
	color: var(--af-text);
}
.af-form .af-field legend { padding: 0; }
.af-form .af-required { color: var(--af-accent); }
.af-form .af-help { font-size: 12px; color: var(--af-muted); margin: 6px 0 0; }

/* --------------------------------------------------------------------
   Champs en grandes cards (services / budget / délai)
   -------------------------------------------------------------------- */
.af-form .af-field-title {
	display: block !important;
	font-weight: 700;
	font-size: 16px;
	margin-bottom: 4px !important;
	color: var(--af-text);
}
.af-form .af-field-subtitle {
	display: block !important;
	font-size: 13px;
	color: var(--af-muted);
	margin: 0 0 16px !important;
}
.af-form .af-cards-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
}
@media (max-width: 720px) {
	.af-form .af-cards-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
	.af-form .af-cards-grid { grid-template-columns: 1fr; }
}
.af-form .af-card-option {
	position: relative;
	display: flex !important;
	flex-direction: column !important;
	align-items: flex-start;
	gap: 6px;
	padding: 18px 16px;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid var(--af-border);
	border-radius: 18px;
	cursor: pointer;
	transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.af-form .af-card-option:hover { transform: translateY(-2px); border-color: var(--af-accent); }
.af-form .af-card-option input {
	position: absolute;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0,0,0,0);
	white-space: nowrap;
	border: 0;
}
.af-form .af-card-option:has(input:checked) {
	background: color-mix(in srgb, var(--af-accent) 18%, transparent);
	border-color: var(--af-accent);
}
.af-form .af-card-option:has(input:focus-visible) { outline: 2px solid var(--af-accent); outline-offset: 2px; }
.af-form .af-card-icon {
	display: block !important;
	width: 100%;
	font-size: 26px;
	line-height: 1;
}
.af-form .af-card-title {
	display: block !important;
	width: 100%;
	font-weight: 600;
	font-size: 14px;
	line-height: 1.35;
	color: var(--af-text);
}
.af-form .af-card-desc {
	display: block !important;
	width: 100%;
	font-size: 12px;
	line-height: 1.4;
	color: var(--af-muted);
	margin-top: 2px;
}

/* --------------------------------------------------------------------
   Badges de confiance (après le bouton d'envoi)
   -------------------------------------------------------------------- */
.af-form .af-trust-badges {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 16px;
	margin-top: 18px;
	font-size: 12px;
	color: var(--af-muted);
}
.af-form .af-trust-badge { display: inline-flex; align-items: center; gap: 6px; }

.af-form input[type="text"],
.af-form input[type="tel"],
.af-form input[type="email"],
.af-form input[type="date"],
.af-form select,
.af-form textarea {
	width: 100%;
	padding: 12px 14px;
	font: inherit;
	color: var(--af-text);
	caret-color: var(--af-text);
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid var(--af-border);
	border-radius: 14px;
	outline: none;
	box-shadow: none;
	transition: border-color 0.18s ease;
}
.af-form textarea { min-height: 100px; resize: vertical; }

/* Un seul état de focus/survol possible : bord accent 1px, jamais de
   double contour natif du navigateur (leçon du projet précédent). */
.af-form input:hover,
.af-form select:hover,
.af-form textarea:hover,
.af-form input:focus,
.af-form select:focus,
.af-form textarea:focus,
.af-form input:focus-visible,
.af-form select:focus-visible,
.af-form textarea:focus-visible {
	outline: none !important;
	box-shadow: none !important;
	border: 1px solid var(--af-accent) !important;
	color: var(--af-text) !important;
	caret-color: var(--af-text) !important;
	-webkit-text-fill-color: var(--af-text) !important;
}

.af-form input:-webkit-autofill,
.af-form input:-webkit-autofill:hover,
.af-form input:-webkit-autofill:focus,
.af-form textarea:-webkit-autofill {
	-webkit-text-fill-color: var(--af-text);
	transition: background-color 5000s ease-in-out 0s;
}

/* Menus déroulants : fond sombre, texte clair. */
.af-form select { background-color: var(--af-gray); color: var(--af-text); appearance: none; -webkit-appearance: none; }
.af-form select option { background-color: var(--af-gray); color: var(--af-text); }
.af-form select option:hover,
.af-form select option:checked { background-color: var(--af-accent) !important; color: #000; }

/* Champ date : impossible de recolorer l'icône native calendrier en CSS
   pur dans tous les navigateurs — l'icône Chrome/Edge peut rester sombre
   sur fond sombre. Le JS force l'ouverture du calendrier au clic/focus
   (voir aslc-form.js), donc l'icône n'a pas besoin d'être cliquée
   précisément ; si le contraste de l'icône reste un souci visuel,
   dites-le, on la masque et on la remplace par une icône SVG maison. */
.af-form input[type="date"]::-webkit-calendar-picker-indicator {
	filter: invert(1);
	cursor: pointer;
}

.af-form .af-field.has-error input,
.af-form .af-field.has-error select,
.af-form .af-field.has-error textarea { border-color: #E05B5B !important; }
.af-form .af-error-msg { color: #E05B5B; font-size: 13px; margin-top: 6px; }

/* Chips radio/checkbox */
.af-form .af-options { display: flex; flex-wrap: wrap; gap: 10px; }
.af-form .af-option {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	background: rgba(255, 255, 255, 0.08);
	color: var(--af-text);
	border: 1px solid var(--af-border);
	border-radius: 999px;
	cursor: pointer;
	font-size: 14px;
	transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.af-form .af-option input {
	position: absolute;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0,0,0,0);
	white-space: nowrap;
	border: 0;
}
.af-form .af-option:has(input:checked) {
	background: var(--af-accent);
	border-color: var(--af-accent);
	color: #000;
}
.af-form .af-option:has(input:focus-visible) { outline: 2px solid var(--af-accent); outline-offset: 2px; }

/* --------------------------------------------------------------------
   Fichiers joints
   -------------------------------------------------------------------- */
.af-form input[type="file"] {
	width: 100%;
	padding: 12px 14px;
	color: var(--af-text);
	background: rgba(255, 255, 255, 0.08);
	border: 1px dashed var(--af-border);
	border-radius: 14px;
	font: inherit;
	font-size: 13px;
}
.af-form input[type="file"]::file-selector-button {
	appearance: none;
	border: none;
	background: var(--af-accent);
	color: #000;
	font-weight: 600;
	padding: 8px 14px;
	border-radius: 999px;
	margin-right: 10px;
	cursor: pointer;
}
.af-form .af-file-list {
	list-style: none;
	margin: 10px 0 0;
	padding: 0;
	font-size: 13px;
	color: var(--af-muted);
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.af-form .af-file-list li.is-rejected { color: #E05B5B; }

/* --------------------------------------------------------------------
   Récapitulatif & consentement
   -------------------------------------------------------------------- */
.af-form .af-recap {
	margin: 4px 0 20px;
	padding: 16px 18px;
	background: rgba(255, 255, 255, 0.06);
	border-radius: 16px;
	font-size: 14px;
}
.af-form .af-recap:empty { display: none; }
.af-form .af-recap dt { font-weight: 600; color: var(--af-text); }
.af-form .af-recap dd { margin: 0 0 8px; color: var(--af-muted); }

.af-form .af-field-consent { font-size: 13px; color: var(--af-muted); }
.af-form .af-field-consent label { display: flex; gap: 8px; font-weight: 400; }
.af-form .af-field-consent a { color: var(--af-accent); }

/* --------------------------------------------------------------------
   Navigation / boutons
   -------------------------------------------------------------------- */
.af-form .af-nav {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 30px;
	gap: 12px;
}
.af-form .af-btn {
	appearance: none;
	border: none;
	cursor: pointer;
	font: inherit;
	font-weight: 600;
	padding: 13px 26px;
	border-radius: 999px;
	transition: transform 0.15s ease, opacity 0.15s ease;
}
.af-form .af-btn-primary {
	background: var(--af-accent) !important;
	color: #000 !important;
	margin-left: auto;
}
.af-form .af-btn-primary:hover { transform: translateY(-2px); }
.af-form .af-btn-primary[disabled] { opacity: 0.6; cursor: not-allowed; transform: none; }
.af-form .af-btn-back {
	background: transparent;
	color: var(--af-muted);
	padding-left: 8px;
	padding-right: 8px;
}
.af-form .af-btn-back:hover { color: var(--af-text); }
.af-form .af-success { text-align: center; padding: 20px 0; }

.af-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(0,0,0,0);
	white-space: nowrap;
}

@media (max-width: 480px) {
	.af-form .af-nav { flex-direction: column-reverse; align-items: stretch; }
	.af-form .af-btn-primary { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.af-form .af-step.is-active { animation: none; }
	.af-form .af-btn-primary:hover { transform: none; }
}
