/**
 * Styles pour les formulaires Makèt Lakay
 *
 * @package MaketLakayInternational
 * @since 3.1.0
 */

/* Formulaires multi-étapes */
.ml-form-wrapper {
	max-width: 1000px;
	margin: 0 auto;
	padding: 20px;
	box-sizing: border-box;
}

.ml-form-step {
	display: none;
}

.ml-form-step.active {
	display: block;
}

/* Champs de formulaire */
.ml-form-group {
	margin-bottom: 20px;
}

.ml-form-label {
	display: block;
	margin-bottom: 8px;
	font-weight: 600;
	color: #333;
	font-size: 16px;
}

.ml-form-label .required {
	color: var(--ml-danger-color);
	margin-left: 3px;
}

.ml-form-input,
.ml-form-select,
.ml-form-textarea {
	width: 100%;
	padding: 12px;
	border: 2px solid #ddd;
	border-radius: 6px;
	font-size: 16px;
	box-sizing: border-box;
	transition: border-color 0.3s;
	font-family: inherit;
}

.ml-form-input:focus,
.ml-form-select:focus,
.ml-form-textarea:focus {
	outline: none;
	border-color: var(--ml-primary-color);
	box-shadow: 0 0 0 3px rgba(255, 179, 71, 0.1);
}

.ml-form-input:disabled,
.ml-form-select:disabled,
.ml-form-textarea:disabled {
	background-color: #f8f9fa;
	cursor: not-allowed;
	opacity: 0.6;
}

.ml-form-input.error,
.ml-form-select.error,
.ml-form-textarea.error {
	border-color: var(--ml-danger-color);
}

.ml-form-textarea {
	resize: vertical;
	min-height: 100px;
}

.ml-form-help {
	display: block;
	margin-top: 5px;
	color: #666;
	font-size: 14px;
}

.ml-form-error {
	display: block;
	margin-top: 5px;
	color: var(--ml-danger-color);
	font-size: 14px;
}

/* Grille de champs */
.ml-form-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 15px;
}

/* Calculatrice */
.ml-calculator {
	background: #f8f9fa;
	padding: 25px;
	border-radius: 8px;
	border-left: 4px solid var(--ml-primary-color);
	margin-bottom: 25px;
}

.ml-calculator h4 {
	margin-top: 0;
	color: #333;
	font-size: 20px;
	margin-bottom: 20px;
}

.ml-calculator-row {
	display: flex;
	justify-content: space-between;
	padding: 10px 0;
	border-bottom: 1px solid #dee2e6;
}

.ml-calculator-row:last-child {
	border-bottom: none;
}

.ml-calculator-row.total {
	padding: 15px 0;
	border-top: 2px solid #333;
	font-size: 20px;
	font-weight: 700;
}

.ml-calculator-label {
	color: #666;
}

.ml-calculator-value {
	font-weight: 600;
	color: #333;
}

.ml-calculator-value.total {
	color: var(--ml-primary-color);
	font-size: 24px;
}

/* Navigation des formulaires */
.ml-form-navigation {
	display: flex;
	gap: 10px;
	margin-top: 25px;
	flex-wrap: wrap;
}

.ml-form-navigation button {
	flex: 1;
	min-width: 150px;
	padding: 15px 20px;
	border-radius: 6px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	border: none;
	transition: all 0.3s;
}

.ml-form-nav-prev {
	background: #6c757d;
	color: white;
}

.ml-form-nav-prev:hover {
	background: #5a6268;
}

.ml-form-nav-next {
	background: var(--ml-primary-color);
	color: white;
}

.ml-form-nav-next:hover {
	background: #FFA726;
}

.ml-form-nav-submit {
	background: var(--ml-success-color);
	color: white;
}

.ml-form-nav-submit:hover {
	background: #218838;
}

.ml-form-nav-submit:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.ml-form-nav-prev:disabled,
.ml-form-nav-next:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.ml-form-nav-prev:disabled:hover,
.ml-form-nav-next:disabled:hover {
	background: #6c757d;
}

.ml-form-nav-submit:disabled:hover {
	background: var(--ml-success-color);
}

/* États de focus pour accessibilité */
.ml-form-nav-prev:focus-visible,
.ml-form-nav-next:focus-visible,
.ml-form-nav-submit:focus-visible {
	outline: 2px solid var(--ml-primary-color);
	outline-offset: 2px;
}

/* Barre de progression */
.ml-progress-bar {
	background: #e9ecef;
	height: 12px;
	border-radius: 6px;
	overflow: hidden;
	margin-bottom: 25px;
}

.ml-progress-fill {
	background: linear-gradient(90deg, var(--ml-primary-color) 0%, #FFCC33 100%);
	height: 100%;
	border-radius: 6px;
	transition: width 0.5s;
}

/* Responsive */
@media (max-width: 768px) {
	.ml-form-wrapper {
		padding: 15px;
	}

	.ml-form-grid {
		grid-template-columns: 1fr;
		gap: 15px;
	}

	.ml-form-group {
		margin-bottom: 18px;
	}

	.ml-form-label {
		font-size: 15px;
	}

	.ml-form-input,
	.ml-form-select,
	.ml-form-textarea {
		padding: 11px;
		font-size: 15px;
	}

	.ml-form-navigation {
		flex-direction: column;
		gap: 10px;
	}

	.ml-form-navigation button {
		width: 100%;
		min-width: auto;
		padding: 14px 20px;
		font-size: 15px;
	}

	.ml-calculator {
		padding: 20px;
	}

	.ml-calculator h4 {
		font-size: 18px;
	}

	.ml-calculator-row {
		flex-direction: column;
		gap: 5px;
		padding: 8px 0;
	}

	.ml-calculator-value {
		text-align: right;
	}

	.ml-calculator-row.total {
		font-size: 18px;
		padding: 12px 0;
	}

	.ml-calculator-value.total {
		font-size: 20px;
	}

	/* Styles pour formulaires inline */
	.ml-form-step > div {
		padding: 20px !important;
	}

	input[type="text"],
	input[type="number"],
	input[type="url"],
	input[type="email"],
	input[type="tel"],
	select,
	textarea {
		font-size: 15px !important;
		padding: 11px !important;
	}

	/* Grilles inline */
	div[style*="grid-template-columns"] {
		grid-template-columns: 1fr !important;
		gap: 15px !important;
	}

	/* Headers inline */
	h1 {
		font-size: 24px !important;
	}

	h2 {
		font-size: 20px !important;
	}

	h3 {
		font-size: 18px !important;
	}
}

@media (max-width: 480px) {
	.ml-form-wrapper {
		padding: 10px;
	}

	.ml-form-group {
		margin-bottom: 15px;
	}

	.ml-form-label {
		font-size: 14px;
	}

	.ml-form-input,
	.ml-form-select,
	.ml-form-textarea {
		padding: 10px;
		font-size: 14px;
	}

	.ml-form-navigation button {
		padding: 12px 18px;
		font-size: 14px;
	}

	.ml-calculator {
		padding: 15px;
	}

	.ml-calculator h4 {
		font-size: 16px;
		margin-bottom: 15px;
	}

	.ml-calculator-row {
		padding: 6px 0;
		font-size: 14px;
	}

	.ml-calculator-row.total {
		font-size: 16px;
		padding: 10px 0;
	}

	.ml-calculator-value.total {
		font-size: 18px;
	}

	/* Styles pour formulaires inline */
	.ml-form-step > div {
		padding: 15px !important;
	}

	input[type="text"],
	input[type="number"],
	input[type="url"],
	input[type="email"],
	input[type="tel"],
	select,
	textarea {
		font-size: 14px !important;
		padding: 10px !important;
	}

	/* Headers inline */
	h1 {
		font-size: 20px !important;
	}

	h2 {
		font-size: 18px !important;
	}

	h3 {
		font-size: 16px !important;
	}

	/* Boutons inline */
	button,
	a[style*="padding"] {
		padding: 12px 16px !important;
		font-size: 14px !important;
	}

	/* Grilles inline spécifiques */
	div[style*="grid-template-columns: 1fr 1fr 1fr"] {
		grid-template-columns: 1fr !important;
		gap: 15px !important;
	}
}

/* Styles pour les champs file upload */
.ml-form-file-input {
	position: relative;
	display: inline-block;
	cursor: pointer;
	width: 100%;
}

.ml-form-file-input input[type="file"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
	overflow: hidden;
}

.ml-form-file-label {
	display: inline-block;
	padding: 12px 20px;
	background: var(--ml-bg-light);
	border: 2px dashed #ddd;
	border-radius: 6px;
	color: var(--ml-text-color);
	cursor: pointer;
	transition: all 0.3s;
	width: 100%;
	text-align: center;
}

.ml-form-file-label:hover {
	border-color: var(--ml-primary-color);
	background: rgba(255, 179, 71, 0.05);
}

.ml-form-file-preview {
	margin-top: 10px;
	padding: 10px;
	background: var(--ml-bg-light);
	border-radius: 6px;
}

.ml-form-file-preview img {
	max-width: 100%;
	max-height: 200px;
	border-radius: 6px;
	margin-bottom: 10px;
}

.ml-form-file-preview .file-name {
	font-size: 14px;
	color: var(--ml-text-light);
}

/* Styles pour les checkboxes et radio buttons */
.ml-form-checkbox,
.ml-form-radio {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 10px;
}

.ml-form-checkbox input[type="checkbox"],
.ml-form-radio input[type="radio"] {
	width: auto;
	margin: 0;
	cursor: pointer;
}

.ml-form-checkbox label,
.ml-form-radio label {
	margin: 0;
	cursor: pointer;
	font-weight: normal;
}

/* Styles pour les messages de validation en temps réel */
.ml-form-field-wrapper {
	position: relative;
}

.ml-form-field-wrapper .ml-form-error {
	position: absolute;
	bottom: -20px;
	left: 0;
	font-size: 12px;
}

.ml-form-field-wrapper.has-error .ml-form-input,
.ml-form-field-wrapper.has-error .ml-form-select,
.ml-form-field-wrapper.has-error .ml-form-textarea {
	border-color: var(--ml-danger-color);
}

.ml-form-field-wrapper.has-success .ml-form-input,
.ml-form-field-wrapper.has-success .ml-form-select,
.ml-form-field-wrapper.has-success .ml-form-textarea {
	border-color: var(--ml-success-color);
}

/* Animations pour les transitions d'étapes */
.ml-form-step {
	animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Styles pour les étiquettes avec icônes */
.ml-form-label-with-icon {
	display: flex;
	align-items: center;
	gap: 8px;
}

/* Styles pour les groupes de champs groupés */
.ml-form-group-row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 15px;
}

/* Styles pour les champs avec unités monétaires */
.ml-form-input-with-unit {
	position: relative;
}

.ml-form-input-with-unit input {
	padding-right: 40px;
}

.ml-form-input-unit {
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--ml-text-light);
	font-weight: 600;
	pointer-events: none;
}

/* Styles pour la barre de progression textuelle */
.ml-progress-text {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 15px;
}

.ml-progress-text .step {
	flex: 1;
	text-align: center;
	position: relative;
	padding-top: 35px;
}

.ml-progress-text .step::before {
	content: '';
	position: absolute;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: #e9ecef;
	border: 2px solid #dee2e6;
}

.ml-progress-text .step.active::before {
	background: var(--ml-primary-color);
	border-color: var(--ml-primary-color);
	color: white;
}

.ml-progress-text .step.completed::before {
	background: var(--ml-success-color);
	border-color: var(--ml-success-color);
	color: white;
	content: '✓';
}

.ml-progress-text .step-label {
	font-size: 12px;
	color: var(--ml-text-light);
	font-weight: 600;
}

.ml-progress-text .step.active .step-label {
	color: var(--ml-primary-color);
}
