/* ============================================================
   MSD Devis Form — styles
   Couleur principale modifiable ci-dessous (--msd-coral)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600&display=swap');

.msd-form {
	--msd-coral: #E20814;       /* rouge MSD — numéros, accents, "Cliquez" */
	--msd-coral-dark: #c2060f;
	--msd-coral-50: rgba(226, 8, 20, .5);   /* version 50% pour survols/fonds légers */
	--msd-coral-soft: rgba(226, 8, 20, .04);
	--msd-ink: #1a1a1a;         /* titres */
	--msd-label: #9a9a9a;       /* labels gris en majuscules */
	--msd-text: #555;
	--msd-line: #e2e2e2;        /* lignes sous les inputs */
	--msd-line-soft: #ededed;
	--msd-placeholder: #b5b5b5;
	--msd-btn-disabled: #ededed;
	--msd-btn-disabled-text: #b0b0b0;
	--msd-radius: 6px;

	max-width: 1024px;
	margin: 0 auto;
	color: var(--msd-text);
	font-family: inherit;
	-webkit-font-smoothing: antialiased;
}

/* ---------- Stepper nommé ---------- */
.msd-stepper {
	display: flex;
	align-items: center;
	gap: 0;
	margin-bottom: 30px;
	padding-bottom: 28px;
	border-bottom: 1px solid var(--msd-line-soft);
	flex-wrap: nowrap;
}
.msd-step {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 0 0 auto;
}
.msd-step-num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border: 1.5px solid #d0d0d0;
	border-radius: 5px;
	font-size: 14px;
	font-weight: 700;
	color: #b5b5b5;
	background: #fff;
	transition: all .25s ease;
}
.msd-step-name {
	font-size: 15px;
	font-weight: 600;
	color: #b5b5b5;
	white-space: nowrap;
	transition: color .25s ease;
}
/* Ligne de liaison entre étapes */
.msd-step-line {
	flex: 1 1 auto;
	height: 1px;
	background: var(--msd-line);
	margin: 0 18px;
	min-width: 20px;
}
/* Étape active */
.msd-step.is-active .msd-step-num {
	border-color: var(--msd-coral);
	color: var(--msd-coral);
}
.msd-step.is-active .msd-step-name {
	color: var(--msd-ink);
	font-weight: 700;
}
/* Étape déjà complétée */
.msd-step.is-done .msd-step-num {
	border-color: var(--msd-coral);
	background: var(--msd-coral);
	color: #fff;
}
.msd-step.is-done .msd-step-name {
	color: var(--msd-text);
}

/* ---------- Cartes (étapes) ---------- */
.msd-card { display: none; animation: msd-fade .35s ease; }
.msd-card.is-active { display: block; }
@keyframes msd-fade {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* ---------- En-tête de carte : numéro + titre ---------- */
.msd-card-head {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 6px;
}
.msd-num {
	font-size: 52px;
	font-weight: 800;
	line-height: 1;
	color: var(--msd-coral);
	letter-spacing: -1px;
	font-family: inherit;
}
.msd-title {
	font-size: 26px;
	font-weight: 800;
	color: var(--msd-ink);
	letter-spacing: .5px;
	margin: 0;
	line-height: 1;
}
.msd-sub {
	color: #aaa;
	font-size: 15px;
	margin: 14px 0 26px;
}

/* ---------- Grille des champs (étape 1) ---------- */
.msd-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 26px 48px;
	margin-top: 34px;
}
.msd-field-full { grid-column: 1 / -1; }

.msd-field label {
	display: block;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: var(--msd-label);
	margin-bottom: 12px;
}
.msd-req { color: var(--msd-coral); margin-left: 2px; }
.msd-opt { color: #c4c4c4; font-weight: 700; }

.msd-field input,
.msd-field textarea {
	width: 100%;
	border: none;
	border-bottom: 1px solid var(--msd-line);
	background: transparent;
	padding: 8px 0;
	font-size: 16px;
	color: var(--msd-ink);
	font-family: 'Montserrat', sans-serif;
	transition: border-color .2s ease;
	box-sizing: border-box;
}
.msd-field input::placeholder,
.msd-field textarea::placeholder { color: var(--msd-placeholder); }
.msd-field input:focus,
.msd-field textarea:focus {
	outline: none;
	border-bottom-color: var(--msd-coral);
}

/* ---------- Textarea (étape 3) ---------- */
.msd-field textarea {
	border: 1px solid var(--msd-line);
	border-radius: var(--msd-radius);
	padding: 18px;
	resize: vertical;
	min-height: 190px;
	line-height: 1.6;
}
.msd-counter {
	font-size: 13px;
	color: #b0b0b0;
	margin-top: 10px;
}

/* ---------- Cases à cocher (étape 2) ---------- */
.msd-checks {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px 20px;
}
.msd-check {
	display: flex;
	align-items: center;
	gap: 14px;
	border: 1px solid var(--msd-line);
	border-radius: var(--msd-radius);
	padding: 18px 20px;
	cursor: pointer;
	transition: border-color .2s ease, box-shadow .2s ease;
	user-select: none;
}
.msd-check:hover { border-color: #cfcfcf; }
.msd-check input { position: absolute; opacity: 0; pointer-events: none; }

.msd-box {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	border: 1.5px solid #cfcfcf;
	border-radius: 4px;
	position: relative;
	transition: all .15s ease;
}
.msd-check input:checked ~ .msd-box,
.msd-rgpd input:checked ~ .msd-box {
	background: var(--msd-coral);
	border-color: var(--msd-coral);
}
.msd-check input:checked ~ .msd-box::after,
.msd-rgpd input:checked ~ .msd-box::after {
	content: "";
	position: absolute;
	left: 5px; top: 1px;
	width: 5px; height: 10px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}
.msd-check input:checked ~ .msd-check-label { color: var(--msd-ink); }
.msd-check:has(input:checked) { border-color: var(--msd-coral); }

.msd-check-label {
	font-size: 16px;
	color: var(--msd-text);
}

/* ---------- Zone d'upload (étape 4) ---------- */
.msd-drop {
	border: 2px dashed #d8d8d8;
	border-radius: 8px;
	padding: 44px 20px;
	text-align: center;
	cursor: pointer;
	transition: border-color .2s ease, background .2s ease;
}
.msd-drop:hover,
.msd-drop.is-drag {
	border-color: var(--msd-coral);
	background: var(--msd-coral-soft);
}
.msd-drop-icon { color: #555; margin-bottom: 8px; }
.msd-drop-text { font-size: 16px; color: var(--msd-text); margin: 6px 0 4px; }
.msd-drop-cta { color: var(--msd-coral); font-weight: 700; }
.msd-drop-types {
	font-size: 13px;
	letter-spacing: 1px;
	color: #bdbdbd;
	margin: 0;
}

/* Liste des fichiers ajoutés */
.msd-file-list { list-style: none; margin: 16px 0 0; padding: 0; }
.msd-file-list li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	background: #f7f7f7;
	border-radius: var(--msd-radius);
	padding: 10px 14px;
	font-size: 14px;
	color: var(--msd-ink);
	margin-bottom: 8px;
}
.msd-file-list .msd-file-remove {
	border: none; background: none; cursor: pointer;
	color: #999; font-size: 18px; line-height: 1; padding: 0 4px;
}
.msd-file-list .msd-file-remove:hover { color: var(--msd-coral); }

/* ---------- RGPD ---------- */
.msd-rgpd {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin-top: 26px;
	cursor: pointer;
	font-size: 14px;
	color: #888;
}
.msd-rgpd input { position: absolute; opacity: 0; pointer-events: none; }
.msd-rgpd .msd-box { margin-top: 1px; }

/* ---------- Actions / boutons ---------- */
.msd-actions { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--msd-line-soft); }
.msd-actions-end { display: flex; justify-content: flex-start; }
.msd-actions-split { display: flex; justify-content: space-between; align-items: center; }

.msd-btn {
	background: var(--msd-btn-disabled);
	color: var(--msd-btn-disabled-text);
	border: none;
	border-radius: var(--msd-radius);
	padding: 16px 30px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 1.5px;
	cursor: pointer;
	transition: background .2s ease, color .2s ease;
	font-family: inherit;
}
/* Bouton actif quand l'étape est valide (classe ajoutée par le JS) */
.msd-btn.is-ready {
	background: var(--msd-coral);
	color: #fff;
}
.msd-btn.is-ready:hover,
.msd-btn.is-ready:focus { background: #c70710 !important; }

.msd-btn-ghost {
	background: none;
	border: 1px solid var(--msd-line);
	border-radius: var(--msd-radius);
	padding: 14px 22px;
	font-size: 14px;
	color: var(--msd-text);
	cursor: pointer;
	transition: border-color .2s ease, color .2s ease;
	font-family: inherit;
}
.msd-btn-ghost:hover,
.msd-btn-ghost:focus {
	border-color: #E20814 !important;
	background: #E20814 !important;
	color: #fff !important;
}

/* ---------- Feedback ---------- */
.msd-feedback {
	margin-top: 22px;
	padding: 0;
	font-size: 15px;
	text-align: center;
}
.msd-feedback.is-error { color: var(--msd-coral-dark); }
.msd-feedback.is-success { color: #2f9e62; }

/* ---------- Honeypot ---------- */
.msd-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
	.msd-grid { grid-template-columns: 1fr; gap: 22px; }
	.msd-checks { grid-template-columns: 1fr; }
	.msd-num { font-size: 42px; }
	.msd-title { font-size: 21px; }
	.msd-actions-split { flex-direction: row; }
	.msd-btn { padding: 14px 20px; }
	/* Stepper compact : on masque les noms sauf l'étape active */
	.msd-stepper { gap: 0; }
	.msd-step-name { display: none; }
	.msd-step.is-active .msd-step-name { display: inline; }
	.msd-step-line { margin: 0 8px; min-width: 10px; }
}
