/* =============================================================================
   Formulaire de contact — Bouton @ header + Modal
   @doc docs/contact-form.md
   ============================================================================= */

/* --- Bouton @ dans le header --- */
.drz-contact-header {
	display: flex;
	align-items: center;
}

.drz-contact-trigger {
	display: flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	color: inherit;
	font-size: 1.1rem;
	line-height: 1;
	transition: color 0.2s ease;
}

.drz-contact-trigger:hover,
.drz-contact-trigger:focus-visible {
	color: #e63946; /* rose Droitzen */
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* --- Overlay et modal --- */
.drz-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
}

.drz-modal[hidden] {
	display: none;
}

.drz-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	cursor: pointer;
}

.drz-modal__dialog {
	position: relative;
	background: #fff;
	border-radius: 6px;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.22);
	width: 100%;
	max-width: 540px;
	max-height: 92vh;
	overflow-y: auto;
	margin: 1rem;
	animation: drzModalIn 0.22s ease;
}

@keyframes drzModalIn {
	from {
		opacity: 0;
		transform: translateY(-16px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* --- Header du modal --- */
.drz-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1.25rem 1.5rem;
	border-bottom: 1px solid #eee;
}

.drz-modal__title {
	font-size: 1.2rem;
	font-weight: 700;
	margin: 0;
	color: #1a1a1a;
}

.drz-modal__close {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 1rem;
	color: #777;
	padding: 0.25rem;
	line-height: 1;
	transition: color 0.2s;
}

.drz-modal__close:hover,
.drz-modal__close:focus-visible {
	color: #e63946;
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* --- Corps du modal --- */
.drz-modal__body {
	padding: 1.5rem;
}

/* --- Message de statut (succès / erreur) --- */
#drz-contact-status {
	padding: 0.85rem 1rem;
	border-radius: 4px;
	margin-bottom: 1.25rem;
	font-size: 0.9rem;
}

#drz-contact-status.is-success {
	background: #e6f4ea;
	color: #2d6a3e;
	border: 1px solid #b6dfbd;
}

#drz-contact-status.is-error {
	background: #fdecea;
	color: #922b21;
	border: 1px solid #f5b7b1;
}

/* --- Champs du formulaire --- */
.drz-contact-form__field {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	margin-bottom: 1rem;
}

.drz-contact-form__field label {
	font-size: 0.88rem;
	font-weight: 600;
	color: #333;
}

.drz-contact-form__field label .required {
	color: #e63946;
	margin-left: 2px;
}

.drz-contact-form__field input,
.drz-contact-form__field textarea {
	padding: 0.6rem 0.75rem;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 0.9rem;
	font-family: inherit;
	color: #222;
	background: #fafafa;
	transition: border-color 0.2s, box-shadow 0.2s;
	-webkit-appearance: none;
}

.drz-contact-form__field input:focus,
.drz-contact-form__field textarea:focus {
	border-color: #e63946;
	box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.12);
	outline: none;
	background: #fff;
}

.drz-contact-form__field input.is-invalid,
.drz-contact-form__field textarea.is-invalid {
	border-color: #e63946;
}

.drz-contact-form__field textarea {
	resize: vertical;
	min-height: 110px;
}

/* --- Honeypot (invisible pour les humains, piège pour les bots) --- */
.drz-contact-form__honeypot {
	position: absolute;
	left: -9999px;
	top: -9999px;
	opacity: 0;
	pointer-events: none;
}

/* --- Bouton submit --- */
.drz-contact-form__submit {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.7rem 1.75rem;
	background: #e63946;
	color: #fff;
	border: none;
	border-radius: 4px;
	font-size: 0.95rem;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.2s, transform 0.15s;
	width: 100%;
	justify-content: center;
	margin-top: 0.5rem;
}

.drz-contact-form__submit:hover,
.drz-contact-form__submit:focus-visible {
	background: #c62f3b;
	outline: 2px solid #c62f3b;
	outline-offset: 2px;
}

.drz-contact-form__submit:active {
	transform: scale(0.98);
}

.drz-contact-form__submit:disabled {
	opacity: 0.7;
	cursor: wait;
}

/* --- Responsive mobile --- */
@media (max-width: 480px) {
	.drz-modal__dialog {
		margin: 0;
		max-height: 100dvh;
		border-radius: 0;
	}

	.drz-modal__header {
		padding: 1rem;
	}

	.drz-modal__body {
		padding: 1rem;
	}
}
