/*
 * modale.css — modale « Ajouter un poste » (dépôt d'offre) : overlay + panneau centré,
 * fidèle à la maquette "STB - Relation Popup" (fond gris clair semi-arrondi, champs empilés).
 */

.modal {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: clamp( 1rem, 4vw, 4rem ) 1rem;
	overflow-y: auto;
}

.modal[hidden] {
	display: none;
}

.modal__overlay {
	position: fixed;
	inset: 0;
	background: rgba( var( --stb-navy-rgb ), 0.55 );
}

.modal__panel {
	position: relative;
	z-index: 1;
	background: var( --stb-white );
	border-radius: var( --stb-radius-carte );
	box-shadow: 0 20px 60px rgba( var( --stb-navy-rgb ), 0.35 );
	width: 100%;
	max-width: 30rem;
	padding: clamp( 1.5rem, 4vw, 2.5rem );
}

.modal__fermer {
	position: absolute;
	top: 1rem;
	right: 1rem;
	background: none;
	border: none;
	color: var( --stb-navy );
	cursor: pointer;
	padding: 0.4rem;
	line-height: 0;
	border-radius: 50%;
}

.modal__fermer:hover {
	background: var( --stb-grey-light );
}

.modal__titre {
	color: var( --stb-navy );
	margin: 0 0 1.25rem;
	font-size: 1.5rem;
	font-weight: 700;
}

.modal__form {
	display: flex;
	flex-direction: column;
	gap: 0.9rem;
}

.modal__champ-honeypot {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.modal__form input[type='text'],
.modal__form input[type='email'],
.modal__form input[type='date'] {
	width: 100%;
	/* Maquette : champs en pilule complète, fond gris clair, léger contour bleu marine. */
	border: 1.5px solid rgba( var( --stb-navy-rgb ), 0.4 );
	background: var( --stb-grey-light );
	border-radius: var( --stb-radius-pill );
	padding: 0.85em 1.3em;
	font-family: var( --stb-font );
	font-size: 1rem;
	color: var( --stb-navy-text );
}

.modal__form input::placeholder {
	color: var( --stb-navy-text );
	opacity: 0.6;
}

.modal__form input:focus-visible {
	outline: none;
	box-shadow: var( --stb-focus-ring );
	border-color: var( --stb-navy );
}

.modal__champ-fichier,
.modal__champ-email,
.modal__champ-code {
	display: flex;
	align-items: center;
	gap: 0.6rem;
}

.modal__champ-fichier input[type='text'],
.modal__champ-email input,
.modal__champ-code input {
	flex: 1;
}

.modal__nom-fichier {
	flex: 1;
	border: 1.5px solid rgba( var( --stb-navy-rgb ), 0.4 );
	background: var( --stb-grey-light );
	border-radius: var( --stb-radius-pill );
	padding: 0.85em 1.3em;
	color: var( --stb-navy-text );
	opacity: 0.6;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.modal__champ-fichier .btn,
.modal__champ-email .btn,
.modal__champ-code .btn {
	flex: none;
	padding: 0.85em 1.4em;
	font-size: 0.9rem;
}

.modal__aide {
	font-size: 0.8rem;
	color: var( --stb-navy-text );
	opacity: 0.75;
	margin: -0.4rem 0 0;
}

.modal__message {
	min-height: 1.2em;
	font-size: 0.9rem;
	margin: 0;
}

.modal__message.is-erreur {
	color: var( --stb-mail-red );
}

.modal__message.is-succes {
	color: var( --stb-navy );
}

.modal__pied {
	display: flex;
	justify-content: flex-end;
	margin-top: 0.5rem;
}

@media ( max-width: 600px ) {
	.modal__champ-fichier,
	.modal__champ-email,
	.modal__champ-code {
		flex-direction: column;
		align-items: stretch;
	}
}
