/**
 * 3S Motors – Location Courte Durée
 * Styles du formulaire front-end.
 * Toutes les classes sont préfixées .threesm- pour éviter les conflits
 * avec le thème (Blocksy) et Elementor.
 */

.threesm-wrapper {
	--threesm-dark: #111418;
	--threesm-accent: #d32f2f;
	--threesm-accent-hover: #b02525;
	--threesm-border: #d8dbe0;
	--threesm-bg: #ffffff;
	--threesm-radius: 10px;

	max-width: 640px;
	margin: 0 auto;
	font-size: 16px;
	line-height: 1.5;
	color: var(--threesm-dark);
}

/* ---------- Structure ---------- */

.threesm-form {
	background: var(--threesm-bg);
	border: 1px solid var(--threesm-border);
	border-radius: var(--threesm-radius);
	padding: 24px 20px;
	box-shadow: 0 6px 24px rgba(17, 20, 24, 0.06);
}

.threesm-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0 16px;
}

@media (min-width: 560px) {
	.threesm-grid {
		grid-template-columns: 1fr 1fr;
	}

	.threesm-form {
		padding: 32px 28px;
	}
}

/* ---------- Champs ---------- */

.threesm-field {
	margin-bottom: 18px;
}

.threesm-field label {
	display: block;
	font-weight: 600;
	font-size: 0.9rem;
	margin-bottom: 6px;
	color: var(--threesm-dark);
}

.threesm-req {
	color: var(--threesm-accent);
}

.threesm-field input[type="text"],
.threesm-field input[type="tel"],
.threesm-field input[type="email"],
.threesm-field input[type="date"],
.threesm-field select,
.threesm-field textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 12px 14px;
	border: 1.5px solid var(--threesm-border);
	border-radius: 8px;
	background: #fff;
	font-size: 1rem;
	font-family: inherit;
	color: var(--threesm-dark);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	appearance: none;
	-webkit-appearance: none;
}

.threesm-field select {
	background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23111418' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	padding-right: 38px;
}

.threesm-field input:focus,
.threesm-field select:focus,
.threesm-field textarea:focus {
	outline: none;
	border-color: var(--threesm-accent);
	box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.15);
}

.threesm-field input[readonly] {
	background: #f5f6f8;
	font-weight: 600;
	cursor: default;
}

.threesm-field textarea {
	resize: vertical;
	min-height: 96px;
}

/* ---------- Aperçu du véhicule ---------- */

.threesm-preview {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: -6px 0 18px;
	padding: 10px 12px;
	background: #f5f6f8;
	border: 1px solid var(--threesm-border);
	border-radius: 8px;
}

.threesm-preview-img {
	width: 88px;
	height: 62px;
	object-fit: cover;
	border-radius: 6px;
	flex-shrink: 0;
}

.threesm-preview-name {
	font-weight: 600;
	font-size: 0.95rem;
}

/* ---------- Consentement ---------- */

.threesm-consent label {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-weight: 400;
	font-size: 0.88rem;
	cursor: pointer;
}

.threesm-consent input[type="checkbox"] {
	width: 18px;
	height: 18px;
	margin-top: 2px;
	flex-shrink: 0;
	accent-color: var(--threesm-accent);
}

/* ---------- Honeypot (invisible pour les humains) ---------- */

.threesm-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ---------- Bouton d'envoi ---------- */

.threesm-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	padding: 14px 24px;
	background: var(--threesm-accent);
	color: #fff;
	font-size: 1rem;
	font-weight: 700;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.1s ease;
}

.threesm-submit:hover:not(:disabled) {
	background: var(--threesm-accent-hover);
}

.threesm-submit:active:not(:disabled) {
	transform: scale(0.99);
}

.threesm-submit:disabled {
	opacity: 0.75;
	cursor: wait;
}

.threesm-submit:focus-visible {
	outline: 3px solid rgba(211, 47, 47, 0.4);
	outline-offset: 2px;
}

/* Spinner de chargement */
.threesm-spinner {
	width: 18px;
	height: 18px;
	border: 3px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: threesm-spin 0.7s linear infinite;
}

@keyframes threesm-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.threesm-spinner {
		animation-duration: 1.6s;
	}

	.threesm-submit {
		transition: none;
	}
}

/* ---------- Messages de retour ---------- */

.threesm-feedback {
	padding: 12px 16px;
	border-radius: 8px;
	margin-bottom: 18px;
	font-size: 0.95rem;
	font-weight: 500;
}

.threesm-feedback.is-success {
	background: #e6f4ea;
	border: 1px solid #a8d5b3;
	color: #1e5b30;
}

.threesm-feedback.is-error {
	background: #fdecea;
	border: 1px solid #f2b8b5;
	color: #8c1d18;
}

/* Bouton WhatsApp affiché après soumission réussie */
.threesm-wa-btn {
	display: inline-block;
	margin-top: 12px;
	padding: 13px 26px;
	background: #25d366;
	color: #fff !important;
	font-weight: 700;
	font-size: 1rem;
	text-decoration: none !important;
	border-radius: 8px;
	transition: background-color 0.15s ease;
}

.threesm-wa-btn:hover {
	background: #1eb958;
	color: #fff !important;
}

.threesm-empty {
	text-align: center;
	padding: 24px;
	background: #f5f6f8;
	border-radius: var(--threesm-radius);
	font-style: italic;
}
