/* Gabarit Paiement en ligne (étape 1/3) — nodes Figma (référence 1728).
   Titre 157→391, carte 513→982 (1145 de large, centrée), pied 1120.
   Seule l'étape 1 est dessinée dans la maquette. */

.paiement > section {
	position: relative;
}

.pay-hero {
	padding-top: clamp(2.25rem, 3.99306vw, 4.3125rem); /* 69 : 157 − 88 */
	padding-left: 2.83565%;  /* 49 */
	padding-right: 2.89352%;
}

.pay-hero__title {
	max-width: 30.57705%; /* 498 sur les 1629 utiles */
	font-family: var(--ff-display);
	font-size: var(--fs-h1);
	line-height: var(--lh-h1);
	color: var(--c-ink);
}

.pay-hero__intro {
	margin-top: clamp(0.5rem, 0.92593vw, 1rem); /* 16 : 174 − 158 */
	max-width: 25.29159%;                       /* 412 sur 1629 */
}

/* ─────────────── Carte de l'étape — y 470 → 982 ──────────────────────────── */

.pay-step {
	margin-top: clamp(1.25rem, 2.25694vw, 2.4375rem);   /* 39 : 430 − 391 */
	margin-bottom: clamp(4rem, 7.98611vw, 8.625rem);    /* 138 : 1120 − 982 */
	padding-inline: 16.84028%;                          /* 291 → carte de 1146 */
}

/* Le cachet démarre 40 px au-dessus du fil d'étapes (nodes y 430 et 470). */
.pay-step__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: clamp(1rem, 2vw, 2rem);
}

/* Fil d'étapes : l'étape courante en DIN Pro Bold (node 375:6558). */
.pay-step__steps {
	margin-top: clamp(1.25rem, 2.31481vw, 2.5rem); /* 40 */
	font-size: var(--fs-body);
	line-height: 1.25; /* node h = 25 */
	color: var(--c-ink);
}

.pay-step__steps b {
	font-weight: 700;
}

.pay-step__steps span {
	padding-inline: 0.75em;
}

.pay-step__mark {
	flex: none;
	display: block;
	width: 8.63874%; /* 99 sur 1146 */
	aspect-ratio: 99 / 56;
}

.pay-step__card {
	position: relative;
	margin-top: clamp(0.75rem, 1.04167vw, 1.125rem); /* 18 : 513 − 495 */
	background: var(--c-field);
	border: var(--rule) solid var(--c-card-line);
	padding-inline: 6.98690%; /* 80 de côté */
	padding-bottom: clamp(3rem, 4.91898vw, 5.3125rem); /* 85 */
}

/* Jauge d'avancement collée en haut de la carte, 11 de haut. */
.pay-step__progress {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 11px;
	background: rgba(46, 78, 115, 0.3);
}

.pay-step__progress span {
	display: block;
	height: 100%;
	background: var(--c-ink);
}

.pay-form {
	display: grid;
	/* Base : le contenu de la carte (1146 − 2 × 80 = 986), pas sa largeur. */
	grid-template-columns: repeat(2, 44.92900%); /* 443 sur 986 */
	column-gap: 9.93915%;                        /* 98 sur 986 */
	padding-top: clamp(2.5rem, 3.70370vw, 4rem); /* 64 : 577 − 513 */
	row-gap: clamp(0.5rem, 0.81019vw, 0.875rem); /* 14 : 671 − 657 */
}

.pay-form__row--wide {
	grid-column: 1;
}

.pay-form__label {
	display: block;
	height: 30px;         /* boîte du node */
	font-size: 0.9375rem; /* 15 */
	line-height: 28px;
	color: var(--c-ink);
}

.pay-form__control {
	position: relative;
}

.pay-form__field {
	display: block;
	width: 100%;
	min-height: 50px;
	padding: 0 16px;
	background: var(--c-field);
	border: var(--rule) solid var(--c-ink);
	border-radius: 0;
	color: var(--c-ink);
	font-family: var(--ff-body);
	font-size: var(--fs-body);
	line-height: var(--lh-body);
	transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.pay-form__field:focus {
	outline: none;
	border-color: var(--c-accent);
	box-shadow: 0 0 0 1px var(--c-accent);
}

/* Bulle d'aide dans le champ de référence, à 18 de son bord droit. */
.pay-form__help {
	position: absolute;
	top: 50%;
	right: 18px;
	transform: translateY(-50%);
	display: grid;
	place-items: center;
	width: 25px;
	height: 24px;
	background: var(--c-ink);
	border: 0;
	border-radius: 50%;
	color: var(--c-light);
	font-family: var(--ff-body);
	font-weight: 500;
	font-size: 1.0625rem; /* 17 */
	line-height: 1;
	cursor: help;
}

.pay-step__rule {
	margin-top: clamp(2.5rem, 3.52975vw, 3.8125rem); /* 61 : 813 − 752 */
	border-top: var(--rule) solid var(--c-card-line);
}

.pay-step__submit {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	min-height: 33px;
	margin-top: clamp(2rem, 2.89352vw, 3.125rem); /* 50 : 864 − 814 */
	padding: 10px;
	background: var(--c-ink);
	border: var(--rule) solid var(--c-ink);
	color: var(--c-light);
	font-family: var(--ff-display);
	font-weight: 500;
	font-size: var(--fs-eyebrow);
	line-height: 1.1;
	letter-spacing: var(--ls-eyebrow);
	cursor: pointer;
	transition: background-color var(--t-fast), border-color var(--t-fast);
}

.pay-step__submit:hover,
.pay-step__submit:focus-visible {
	background: var(--c-accent);
	border-color: var(--c-accent);
}

.pay-step__submit svg {
	flex: none;
	width: 10px;
	height: 10px;
}

.pay-note {
	margin-top: clamp(2rem, 3.24074vw, 3.5rem); /* 56 */
	padding-inline: 16.84028%;
}

@media (max-width: 1199px) {
	.pay-hero {
		padding-inline: var(--gutter-text);
	}

	.pay-hero__title,
	.pay-hero__intro {
		max-width: 36ch;
	}

	.pay-step,
	.pay-note {
		padding-inline: var(--gutter-text);
	}

	.pay-step__card {
		padding-inline: clamp(1.25rem, 4vw, 3rem);
	}

	.pay-form {
		grid-template-columns: 1fr;
		column-gap: 0;
		row-gap: clamp(1rem, 2vw, 1.5rem);
	}

	.pay-form__row--wide {
		grid-column: 1;
	}
}

@media (max-width: 767px) {
	.pay-step__head {
		flex-direction: column;
		align-items: flex-start;
	}

	.pay-step__mark {
		width: 99px;
	}
}

/* ── Parcours en trois étapes ───────────────────────────────────────────────
   Le fil d'étapes devient cliquable vers l'arrière : une étape franchie est un
   lien (ou un bouton, quand il faut rejouer les données de l'étape 1), l'étape
   courante est marquée, celles à venir restent inertes. */

.pay-step__steps {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
}

.pay-step__label {
	padding-inline: 0;
	color: inherit;
}

.pay-step__label.is-todo {
	opacity: var(--o-text);
}

.pay-step__label--back {
	background: none;
	border: 0;
	padding: 0;
	font: inherit;
	color: var(--c-accent);
	cursor: pointer;
	text-decoration: underline;
	text-decoration-thickness: var(--rule);
	text-underline-offset: 3px;
}

.pay-step__label--back:hover,
.pay-step__label--back:focus-visible {
	text-decoration-color: transparent;
}

.pay-step__sep {
	padding-inline: 0.75em;
}

.pay-step__back-form {
	display: contents;
}

/* Le formulaire est une grille de deux colonnes : le filet et la rangée
   d'actions doivent la traverser, sinon ils n'occupent qu'une colonne. */
.pay-form > .pay-step__rule,
.pay-form > .pay-step__actions {
	grid-column: 1 / -1;
}

/* Rangée d'actions : le retour à gauche, l'action principale à droite. */
.pay-step__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: clamp(1rem, 1.85185vw, 2rem);
	margin-top: clamp(2rem, 2.89352vw, 3.125rem); /* même pas que le bouton seul */
}

/* Le pot de miel est en position absolue : il ne doit pas occuper de cellule. */
.pay-form > .pay-form__hp {
	position: absolute;
}

.pay-step__actions .pay-step__submit {
	margin-top: 0;
}

.pay-step__back {
	background: none;
	border: 0;
	padding: 0;
	font-family: var(--ff-body);
	font-size: var(--fs-body);
	line-height: var(--lh-body);
	color: var(--c-accent);
	cursor: pointer;
}

.pay-step__back:hover,
.pay-step__back:focus-visible {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.pay-step__notice {
	margin-top: clamp(1.25rem, 2.31481vw, 2.5rem);
	padding: 12px 16px;
	border: var(--rule) solid var(--c-accent);
	color: var(--c-ink);
	font-size: var(--fs-body);
	line-height: var(--lh-body);
}

/* ── Étape de règlement : champ embarqué SystemPay ─────────────────────────
   L'habillage du champ carte appartient à l'extension Krypton : on ne règle
   ici que son inscription dans la carte du thème. */

.pay-form--reglement .kr-embedded {
	width: 100%;
	margin-top: clamp(1.5rem, 2.31481vw, 2.5rem);
}

/* Doublon du bouton « Payer » du thème, qui le déclenche : masqué sans
   display:none, que le client Krypton pourrait prendre pour un champ absent. */
.pay-form--reglement .kr-payment-button {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.pay-form__secure {
	margin-top: clamp(1rem, 1.5vw, 1.5rem);
	font-size: var(--fs-micro);
	line-height: var(--lh-micro);
	letter-spacing: var(--ls-micro);
	color: var(--c-ink);
	opacity: var(--o-text);
}

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