/* ==========================================================================
   50 ans Filière Laquage : plateforme d'inscription
   Charte ArcelorMittal (mars 2022) : dégradé + orange chaud, bleu ciel, gris acier
   ========================================================================== */

:root {
	--am-orange: #ff3700;          /* Hot orange de la charte : accents, bordures, puces */
	--am-orange-ink: #d62e00;      /* Fond des boutons : blanc dessus = 4,9:1 (le #ff3700 ne fait que 3,6:1) */
	--am-orange-ink-hover: #b82700;/* 6,3:1 */
	--am-orange-dark: #b82700;     /* Texte orange sur fond clair */
	--am-blue: #0072ce;
	--am-steel: #414141;
	--am-white: #ffffff;

	--am-bg: #f6f5f3;
	--am-line: #e3e1dd;
	--am-muted: #6b6b6b;
	--am-success: #1d7a46;
	--am-error: #c4231a;

	/* Dégradé officiel (Master_Gradient_RGB) : violet dans un coin, orange dominant. */
	--am-gradient: radial-gradient(120% 140% at 0% 100%, #000015 0%, #2b026c 14%, #a41d89 30%, #f9374d 50%, #ff8f60 72%, #ffee77 100%);
	/* Variante en-tête : sans le jaune, avec un voile de 16 % pour que le texte blanc
	   atteigne 4,5:1 partout (mesuré de 360 à 1280 px : 4,8:1 minimum). */
	--am-gradient-hero: linear-gradient(rgba(26, 0, 51, .16), rgba(26, 0, 51, .16)), radial-gradient(150% 190% at 0% 100%, #2b026c 0%, #a41d89 30%, #f9374d 65%, #ff4d3a 100%);

	--am-font: "Gilroy", "Manrope", Arial, sans-serif;
	--am-radius: 14px;
	--am-radius-sm: 10px;
	--am-shadow: 0 1px 2px rgba(0, 0, 21, .05), 0 8px 24px rgba(0, 0, 21, .06);
}

*, *::before, *::after { box-sizing: border-box; }

body.am50 {
	margin: 0;
	touch-action: manipulation;
	-webkit-tap-highlight-color: rgba(255, 55, 0, .15);
	background: var(--am-bg);
	color: var(--am-steel);
	font-family: var(--am-font);
	font-size: 16px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}

.am50 a { color: var(--am-blue); }
.am50 img { max-width: 100%; height: auto; }

.am50-sr, .am50-hp {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ---------- En-tête : forme courbe en dégradé, logo blanc en haut à droite ---------- */

.am50-hero {
	position: relative;
	background: var(--am-gradient-hero);
	color: var(--am-white);
	padding: 24px 16px 72px;
	clip-path: ellipse(160% 100% at 30% 0%);
}

.am50-hero__inner {
	max-width: 720px;
	margin: 0 auto;
	display: grid;
	gap: 6px;
}

.am50-hero__logo {
	justify-self: end;
	width: 120px;
	margin-bottom: 28px;
}

.am50-hero__eyebrow {
	margin: 0;
	font-size: .8125rem;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	opacity: .9;
}

.am50-hero__title {
	margin: 0;
	font-size: clamp(1.75rem, 6vw, 2.75rem);
	line-height: 1.1;
	font-weight: 700;
	letter-spacing: -.01em;
	text-wrap: balance;
}

.am50-hero__day {
	margin: 10px 0 0;
	display: grid;
	gap: 2px;
	font-size: 1rem;
}

/* ---------- Contenu ---------- */

.am50-main { padding: 0 16px 48px; margin-top: -32px; position: relative; }

.am50-container {
	max-width: 720px;
	margin: 0 auto;
	display: grid;
	gap: 16px;
}

.am50-intro {
	background: var(--am-white);
	border-radius: var(--am-radius);
	box-shadow: var(--am-shadow);
	padding: 20px;
}

.am50-intro p { margin: 0 0 .6em; }
.am50-intro p:last-child { margin-bottom: 0; }
.am50-intro__hello { font-weight: 600; }

.am50-card {
	background: var(--am-white);
	border-radius: var(--am-radius);
	box-shadow: var(--am-shadow);
	padding: 20px;
}

.am50-card__title {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 16px;
	font-size: 1.125rem;
	font-weight: 700;
	color: var(--am-blue);
	text-wrap: balance;
}

.am50-step {
	display: inline-grid;
	place-items: center;
	width: 28px; height: 28px;
	border-radius: 50%;
	background: var(--am-orange-ink);
	color: var(--am-white);
	font-size: .875rem;
	flex: none;
}

.am50-help { margin: -6px 0 14px; color: var(--am-muted); font-size: .9375rem; }
.am50-help--center { text-align: center; margin: 0; }

/* ---------- Champs ---------- */

.am50-form { display: grid; gap: 16px; }

.am50-grid { display: grid; gap: 14px; }

.am50-field { display: grid; gap: 6px; min-width: 0; }

.am50-field label, .am50-label {
	font-size: .875rem;
	font-weight: 600;
}

.am50-field input:not([type="checkbox"]):not([type="radio"]) {
	width: 100%;
	min-height: 48px;
	padding: 10px 14px;
	border: 1.5px solid var(--am-line);
	border-radius: var(--am-radius-sm);
	background: var(--am-white);
	color: var(--am-steel);
	font: inherit;
	transition: border-color .15s, box-shadow .15s;
}

.am50-field input:not([type="checkbox"]):not([type="radio"]):focus {
	outline: none;
	border-color: var(--am-blue);
	box-shadow: 0 0 0 3px rgba(0, 114, 206, .18);
}

.am50-static {
	margin: 0;
	min-height: 48px;
	display: flex;
	align-items: center;
	padding: 0 14px;
	border-radius: var(--am-radius-sm);
	background: var(--am-bg);
	color: var(--am-muted);
	overflow-wrap: anywhere;
}

/* ---------- Choix du nombre d'accompagnants ---------- */

.am50-choices { border: 0; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 8px; }

.am50-pill { position: relative; cursor: pointer; }
.am50-pill input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.am50-pill span {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 18px;
	border: 1.5px solid var(--am-line);
	border-radius: 999px;
	font-weight: 600;
	transition: border-color .15s, background-color .15s, color .15s;
}
.am50-pill input:checked + span { border-color: var(--am-orange); background: #fff1ec; color: var(--am-orange-dark); }
.am50-pill input:focus-visible + span { box-shadow: 0 0 0 3px rgba(0, 114, 206, .25); }

.am50-companions { display: grid; gap: 12px; }

.am50-companion {
	border: 1.5px solid var(--am-line);
	border-radius: var(--am-radius-sm);
	padding: 12px 14px 14px;
	margin: 0;
}

.am50-companion legend { padding: 0 6px; font-weight: 700; font-size: .875rem; }
.am50-companion[hidden] { display: none; }

/* ---------- Créneaux ---------- */

.am50-slots {
	border: 0; padding: 0; margin: 0;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}

.am50-slot {
	position: relative;
	display: grid;
	gap: 2px;
	padding: 14px;
	border: 1.5px solid var(--am-line);
	border-radius: var(--am-radius-sm);
	cursor: pointer;
	transition: border-color .15s, background .15s;
}

.am50-slot input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.am50-slot__time { font-size: 1.25rem; font-weight: 700; color: var(--am-steel); }
.am50-slot__tag { font-size: .75rem; font-weight: 600; color: var(--am-blue); text-transform: uppercase; letter-spacing: .04em; }
.am50-slot__left { font-size: .8125rem; color: var(--am-muted); }

.am50-slot:has(input:checked) { border-color: var(--am-orange); background: #fff1ec; }
.am50-slot:has(input:checked) .am50-slot__time { color: var(--am-orange-dark); }
.am50-slot:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(0, 114, 206, .25); }

.am50-slot.is-full,
.am50-slot.is-too-small { cursor: not-allowed; background: var(--am-bg); }
.am50-slot.is-full .am50-slot__time,
.am50-slot.is-too-small .am50-slot__time { color: #a3a3a3; text-decoration: line-through; }
.am50-slot.is-full input, .am50-slot.is-too-small input { cursor: not-allowed; }

.am50-slots__hint { margin: 12px 0 0; font-size: .875rem; color: var(--am-muted); }

/* ---------- Conditions ---------- */

.am50-card--rules { border-left: 4px solid var(--am-orange); }

.am50-rules ul { margin: 0 0 16px; padding: 0; list-style: none; display: grid; gap: 8px; }
.am50-rules li { position: relative; padding-left: 26px; }
.am50-rules li::before {
	content: "";
	position: absolute; left: 0; top: .45em;
	width: 14px; height: 14px;
	border-radius: 50%;
	background: var(--am-gradient);
}

.am50-check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-weight: 600; }
.am50-check input { width: 22px; height: 22px; margin: -1px 0 0; padding: 0; accent-color: var(--am-orange-ink); flex: none; cursor: pointer; }

/* ---------- Boutons ---------- */

.am50-actions { display: grid; gap: 10px; }

.am50-btn {
	display: inline-flex;
	justify-content: center;
	align-items: center;
	width: 100%;
	min-height: 52px;
	padding: 0 24px;
	border: 1.5px solid transparent;
	border-radius: 999px;
	font: inherit;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .15s, border-color .15s, transform .1s;
}

.am50-btn:active { transform: translateY(1px); }
.am50-btn--primary { background: var(--am-orange-ink); color: var(--am-white) !important; }
.am50-btn--primary:hover { background: var(--am-orange-ink-hover); }
.am50-btn--ghost { background: transparent; border-color: var(--am-line); color: var(--am-steel) !important; }
.am50-btn--ghost:hover { border-color: var(--am-steel); }
.am50-btn--danger { color: var(--am-error) !important; }
.am50-btn--danger:hover { border-color: var(--am-error); background: #fdecea; }
.am50-btn:focus-visible { outline: 3px solid rgba(0, 114, 206, .4); outline-offset: 2px; }
.am50-btn[disabled] { opacity: .6; cursor: progress; }
.am50-cancel { margin: 0; }

/* ---------- Messages ---------- */

.am50-notice { border-radius: var(--am-radius-sm); padding: 14px 16px; font-size: .9375rem; }
.am50-notice p { margin: 0; }
.am50-notice ul { margin: 6px 0 0; padding-left: 20px; }
.am50-notice--success { background: #e8f5ee; color: var(--am-success); border: 1px solid #b9e0c9; }
.am50-notice--error { background: #fdecea; color: var(--am-error); border: 1px solid #f5c2bd; }
.am50-notice--info { background: #e8f2fb; color: #0a4f8a; border: 1px solid #bcd9f2; }
.am50-notice:focus { outline: none; }

/* ---------- Récapitulatif ---------- */

.am50-recap__list { margin: 0 0 16px; display: grid; gap: 0; }
.am50-recap__list > div { display: grid; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--am-line); }
.am50-recap__list > div:first-child { padding-top: 0; }
.am50-recap__list dt { font-size: .8125rem; color: var(--am-muted); }
.am50-recap__list dd { margin: 0; font-weight: 600; }
.am50-recap__slot { font-size: 1.5rem; color: var(--am-orange-dark); }
.am50-recap__person { display: block; }

.am50-message p:last-child { margin-bottom: 0; }

/* ---------- Pied de page ---------- */

.am50-footer { padding: 24px 16px 40px; font-size: .8125rem; color: var(--am-muted); }
.am50-footer__inner { max-width: 720px; margin: 0 auto; }
.am50-footer p { margin: 0 0 .5em; }

/* ---------- Tablette et plus ---------- */

@media (min-width: 640px) {
	.am50-hero { padding: 32px 24px 96px; }
	.am50-hero__logo { width: 150px; }
	.am50-hero__day { display: flex; gap: 12px; }
	.am50-hero__day span::before { content: "·"; margin-right: 12px; }
	.am50-main { margin-top: -48px; }
	.am50-card, .am50-intro { padding: 28px; }
	.am50-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.am50-grid--3 { grid-template-columns: 1fr 1fr 110px; }
	.am50-field--full { grid-column: 1 / -1; }
	.am50-slots { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
	.am50-actions { grid-template-columns: auto auto; justify-content: start; }
	.am50-btn { width: auto; }
}

@media (prefers-reduced-motion: reduce) {
	.am50 * { transition: none !important; }
}

/* ==========================================================================
   Erreurs de formulaire : sous chaque champ + récapitulatif focusable en haut
   ========================================================================== */

.am50-required-note { margin: 0; font-size: .875rem; color: var(--am-muted); }

.am50-field__help { margin: -2px 0 2px; font-size: .8125rem; color: var(--am-muted); }

.am50-field,
.am50-slots,
.am50-summary { scroll-margin-top: 24px; }

.am50-error {
	display: flex;
	gap: 6px;
	align-items: flex-start;
	margin: 2px 0 0;
	font-size: .875rem;
	font-weight: 600;
	line-height: 1.4;
	color: var(--am-error);
}

/* Pictogramme en plus de la couleur : l'erreur ne repose pas sur le rouge seul. */
.am50-error::before {
	content: "!";
	flex: none;
	display: inline-grid;
	place-items: center;
	width: 18px; height: 18px;
	margin-top: 1px;
	border-radius: 50%;
	background: var(--am-error);
	color: var(--am-white);
	font-size: .75rem;
	font-weight: 700;
}

.am50-field.is-invalid input:not([type="checkbox"]) {
	border-color: var(--am-error);
	background: #fffafa;
}
.am50-field.is-invalid input:focus { box-shadow: 0 0 0 3px rgba(196, 35, 26, .18); }
.am50-field.is-invalid .am50-check input { outline: 2px solid var(--am-error); outline-offset: 2px; }

.am50-slots.is-invalid { box-shadow: inset 3px 0 0 var(--am-error); padding-left: 12px; border-radius: 2px; }
.am50-error--group { margin: -4px 0 12px; }
.am50-slots:focus { outline: none; }
.am50-slots:focus-visible { outline: 3px solid rgba(0, 114, 206, .4); outline-offset: 4px; border-radius: var(--am-radius-sm); }

.am50-summary {
	background: var(--am-white);
	border: 2px solid var(--am-error);
	border-radius: var(--am-radius);
	padding: 16px 20px;
	box-shadow: var(--am-shadow);
}
.am50-summary:focus { outline: 3px solid rgba(196, 35, 26, .3); outline-offset: 2px; }
.am50-summary__title { margin: 0 0 8px; font-size: 1.0625rem; color: var(--am-error); }
.am50-summary p { margin: 0 0 8px; }
.am50-summary ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.am50-summary a { color: var(--am-error); font-weight: 600; text-underline-offset: 3px; }
.am50-summary a:hover { text-decoration-thickness: 2px; }

/* Lien d'évitement */
.am50-skip {
	position: absolute; left: 16px; top: -60px; z-index: 100;
	padding: 10px 16px; border-radius: 999px;
	background: var(--am-white); color: var(--am-steel) !important; font-weight: 700;
	transition: top .15s;
}
.am50-skip:focus { top: 12px; }

.am50 a:focus-visible,
.am50-pill input:focus-visible + span { outline: 3px solid rgba(0, 114, 206, .45); outline-offset: 2px; }

.am50-main:focus { outline: none; }
