/* -----------------------------------------------------------------------
 * Média MEET® — page publique de réservation et carte d'accueil
 *
 * Feuille autonome : la page de réservation n'emprunte pas la mise en page du
 * thème (barre latérale, en-tête, pied de page), pour que le patient n'ait
 * qu'une chose à faire. Les variables sont donc locales.
   ----------------------------------------------------------------------- */

.fab-meet-page,
.fab-meet-section {
	--fm-bg: #ffffff;
	--fm-surface: #ffffff;
	--fm-soft: #f6f7f9;
	--fm-line: #e4e7ec;
	--fm-text: #101828;
	--fm-muted: #667085;
	--fm-primary: #0b6bcb;
	--fm-primary-text: #ffffff;
	--fm-radius: 12px;
	--fm-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 8px 24px rgba(16, 24, 40, 0.04);
}

/* Le parcours est unique : aucune déclinaison sombre. La page publique est un
   écran autonome, pas un thème — et un patient qui arrive d'un lien ne doit pas
   découvrir un fond noir selon le réglage de son système. */

.fab-meet-page {
	margin: 0;
	background: var(--fm-bg);
	color: var(--fm-text);
	font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

/* ⚠️ Sans cette règle, `hidden` ne masque rien : les blocs de mise en page
   (`display: flex/grid`) l'emportent sur l'attribut. Le formulaire s'affichait
   donc avant qu'une date soit choisie. */
.fab-meet-page [hidden],
.fab-meet-section [hidden] {
	display: none !important;
}

.fab-meet-page *,
.fab-meet-page *::before,
.fab-meet-page *::after,
.fab-meet-section *,
.fab-meet-section *::before,
.fab-meet-section *::after {
	box-sizing: border-box;
}

.fm-shell {
	max-width: 62rem;
	margin: 0 auto;
	padding: 2rem 1.25rem 3rem;
}

/* ── En-tête ────────────────────────────────────────────────────────────── */

.fm-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
	padding-bottom: 1.25rem;
	border-bottom: 1px solid var(--fm-line);
}

.fm-head__brand {
	display: inline-flex;
	align-items: center;
	gap: 0.75rem;
	text-decoration: none;
	color: inherit;
}

.fm-head__logo {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 999px;
	background: var(--fm-soft);
	font-weight: 600;
	font-size: 0.9rem;
}

.fm-head__name {
	font-size: 1.1rem;
	font-weight: 600;
}

.fm-head__meta {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	font-size: 0.85rem;
	color: var(--fm-muted);
}

.fm-dot {
	width: 3px;
	height: 3px;
	border-radius: 999px;
	background: currentColor;
	opacity: 0.6;
}

/* ── Onglets ────────────────────────────────────────────────────────────── */

.fm-tabs {
	display: flex;
	gap: 0.25rem;
	margin: 1.25rem 0 1.5rem;
	border-bottom: 1px solid var(--fm-line);
}

.fm-tab {
	padding: 0.6rem 0.9rem;
	border: 0;
	background: transparent;
	color: var(--fm-muted);
	font: inherit;
	font-size: 0.9rem;
	cursor: pointer;
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
}

.fm-tab:hover {
	color: var(--fm-text);
}

.fm-tab.is-active {
	color: var(--fm-text);
	border-bottom-color: var(--fm-primary);
	font-weight: 600;
}

/* ── Panneaux ───────────────────────────────────────────────────────────── */

.fm-panel {
	display: none;
}

.fm-panel.is-active {
	display: block;
}

/* ── Cartes de service ──────────────────────────────────────────────────── */

.fm-services {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
	gap: 0.75rem;
	margin-bottom: 1.75rem;
}

.fm-service {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	padding: 1rem 1.1rem;
	border: 1px solid var(--fm-line);
	border-radius: var(--fm-radius);
	background: var(--fm-surface);
	box-shadow: var(--fm-shadow);
	text-decoration: none;
	color: inherit;
	transition: border-color 0.15s ease, transform 0.15s ease;
}

.fm-service:hover {
	border-color: var(--fm-primary);
	transform: translateY(-1px);
}

.fm-service.is-current {
	border-color: var(--fm-primary);
	box-shadow: 0 0 0 1px var(--fm-primary);
}

.fm-service__name {
	font-weight: 600;
	font-size: 0.98rem;
}

.fm-service__meta {
	display: flex;
	gap: 0.6rem;
	font-size: 0.82rem;
	color: var(--fm-muted);
}

/* ── Réservation ────────────────────────────────────────────────────────── */

.fm-booker {
	display: grid;
	gap: 1.25rem;
	padding: 1.25rem;
	border: 1px solid var(--fm-line);
	border-radius: var(--fm-radius);
	background: var(--fm-surface);
	box-shadow: var(--fm-shadow);
}

.fm-booker__head h1 {
	margin: 0 0 0.25rem;
	font-size: 1.2rem;
	font-weight: 600;
}

.fm-booker__head p {
	margin: 0;
	font-size: 0.88rem;
	color: var(--fm-muted);
}

.fm-booker__desc {
	margin-top: 0.4rem !important;
}

.fm-staff-pick {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	font-size: 0.88rem;
}

.fm-staff-pick select {
	padding: 0.45rem 0.6rem;
	border: 1px solid var(--fm-line);
	border-radius: 8px;
	background: var(--fm-bg);
	color: var(--fm-text);
	font: inherit;
}

/* ── Calendrier ─────────────────────────────────────────────────────────── */

.fm-calendar__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 0.75rem;
}

.fm-calendar__label {
	font-weight: 600;
	text-transform: capitalize;
}

.fm-nav {
	width: 2rem;
	height: 2rem;
	border: 1px solid var(--fm-line);
	border-radius: 8px;
	background: var(--fm-bg);
	color: var(--fm-text);
	font-size: 1rem;
	line-height: 1;
	cursor: pointer;
}

.fm-nav:disabled {
	opacity: 0.4;
	cursor: default;
}

.fm-calendar__weekdays,
.fm-calendar__grid {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 0.25rem;
}

.fm-calendar__weekdays {
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--fm-muted);
	text-align: center;
	margin-bottom: 0.35rem;
}

.fm-day {
	aspect-ratio: 1 / 1;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid transparent;
	border-radius: 8px;
	background: transparent;
	color: var(--fm-text);
	font: inherit;
	font-size: 0.85rem;
	cursor: pointer;
}

.fm-day:hover:not(:disabled) {
	background: var(--fm-soft);
}

.fm-day.is-empty {
	visibility: hidden;
}

.fm-day:disabled {
	color: var(--fm-muted);
	opacity: 0.4;
	cursor: default;
}

.fm-day.is-selected {
	background: var(--fm-primary);
	color: var(--fm-primary-text);
	font-weight: 600;
}

.fm-day.is-today {
	border-color: var(--fm-primary);
}

/* ── Créneaux ───────────────────────────────────────────────────────────── */

.fm-slots {
	border-top: 1px solid var(--fm-line);
	padding-top: 1rem;
}

.fm-slots__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.75rem;
	flex-wrap: wrap;
	margin-bottom: 0.75rem;
}

.fm-slots__head span {
	font-size: 0.78rem;
	color: var(--fm-muted);
}

.fm-slots__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(4.5rem, 1fr));
	gap: 0.4rem;
}

.fm-slot {
	padding: 0.5rem 0.25rem;
	border: 1px solid var(--fm-line);
	border-radius: 8px;
	background: var(--fm-bg);
	color: var(--fm-text);
	font: inherit;
	font-size: 0.85rem;
	cursor: pointer;
}

.fm-slot:hover {
	border-color: var(--fm-primary);
}

.fm-slot.is-selected {
	background: var(--fm-primary);
	border-color: var(--fm-primary);
	color: var(--fm-primary-text);
	font-weight: 600;
}

.fm-slots__empty {
	margin: 0;
	padding: 0.9rem;
	border: 1px dashed var(--fm-line);
	border-radius: 8px;
	font-size: 0.85rem;
	color: var(--fm-muted);
}

/* ── Formulaire ─────────────────────────────────────────────────────────── */

.fm-form {
	display: grid;
	gap: 0.9rem;
	border-top: 1px solid var(--fm-line);
	padding-top: 1rem;
}

.fm-form__recap {
	padding: 0.7rem 0.9rem;
	border-radius: 8px;
	background: var(--fm-soft);
	font-size: 0.88rem;
}

.fm-field {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	font-size: 0.86rem;
}

.fm-field > span {
	font-weight: 500;
}

.fm-field input,
.fm-field textarea,
.fm-field select {
	width: 100%;
	padding: 0.55rem 0.7rem;
	border: 1px solid var(--fm-line);
	border-radius: 8px;
	background: var(--fm-bg);
	color: var(--fm-text);
	font: inherit;
}

.fm-field input:focus-visible,
.fm-field textarea:focus-visible,
.fm-field select:focus-visible {
	outline: 2px solid var(--fm-primary);
	outline-offset: 1px;
}

.fm-form__legal {
	margin: 0;
	font-size: 0.76rem;
	color: var(--fm-muted);
}

.fm-form__actions {
	display: flex;
	justify-content: flex-end;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.fm-form__error {
	margin: 0;
	font-size: 0.82rem;
	color: #b42318;
}

.fm-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.fm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.6rem 1.1rem;
	border: 1px solid var(--fm-primary);
	border-radius: 8px;
	background: var(--fm-primary);
	color: var(--fm-primary-text);
	font: inherit;
	font-size: 0.88rem;
	font-weight: 500;
	cursor: pointer;
	text-decoration: none;
}

.fm-btn:disabled {
	opacity: 0.6;
	cursor: default;
}

.fm-btn--ghost {
	background: transparent;
	border-color: var(--fm-line);
	color: var(--fm-text);
}

.fm-link {
	background: none;
	border: 0;
	padding: 0;
	color: var(--fm-primary);
	font: inherit;
	font-size: 0.85rem;
	text-decoration: underline;
	cursor: pointer;
}

/* ── Confirmation ───────────────────────────────────────────────────────── */

.fm-success {
	display: grid;
	justify-items: center;
	gap: 0.6rem;
	text-align: center;
	padding: 2rem 1rem;
	border-top: 1px solid var(--fm-line);
}

.fm-success__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	border-radius: 999px;
	background: var(--fm-soft);
	color: #16a34a;
	font-size: 1.4rem;
}

.fm-success h2 {
	margin: 0;
	font-size: 1.15rem;
}

.fm-success p {
	margin: 0;
	color: var(--fm-muted);
	font-size: 0.9rem;
}

/* ── Infos pratiques ────────────────────────────────────────────────────── */

.fm-text {
	font-size: 0.92rem;
}

.fm-infos {
	margin: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
	gap: 1rem;
}

.fm-infos dt {
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--fm-muted);
}

.fm-infos dd {
	margin: 0.2rem 0 0;
	font-size: 0.92rem;
}

.fm-infos a {
	color: var(--fm-primary);
}

.fm-empty {
	margin: 0;
	padding: 1rem;
	border: 1px dashed var(--fm-line);
	border-radius: 8px;
	color: var(--fm-muted);
	font-size: 0.88rem;
}

/* ── Pied ───────────────────────────────────────────────────────────────── */

.fm-foot {
	margin-top: 2rem;
	padding-top: 1rem;
	border-top: 1px solid var(--fm-line);
	font-size: 0.8rem;
	color: var(--fm-muted);
}

/* ── Page fermée ────────────────────────────────────────────────────────── */

.fm-closed {
	max-width: 32rem;
	margin: 4rem auto;
	padding: 2rem;
	border: 1px solid var(--fm-line);
	border-radius: var(--fm-radius);
	background: var(--fm-surface);
	text-align: center;
}

.fm-closed h1 {
	margin: 0 0 0.75rem;
	font-size: 1.2rem;
}

.fm-closed p {
	margin: 0;
	color: var(--fm-muted);
	font-size: 0.9rem;
}

.fm-closed__note {
	margin-top: 0.75rem !important;
	font-weight: 500;
	color: var(--fm-text) !important;
}

/* ── Section de l'accueil ───────────────────────────────────────────────── */

.fab-meet-section {
	margin: 0 auto;
	width: 100%;
}

.fab-meet-section > .fab-meet-card {
	max-width: 1120px;
	/* `.row` du thème est un conteneur flex : sans largeur explicite, la carte se
	   réduit à son contenu au lieu d'occuper la section. */
	width: 100%;
	margin-inline: auto;
}

/*
 * Une seule colonne : en-tête compact, puis l'assistant qui occupe toute la
 * largeur. L'ancienne grille réservait 20 rem à une accroche, laissant la moitié
 * de la carte vide pendant que le calendrier s'étirait à droite.
 */
.fab-meet-card {
	display: flex;
	flex-direction: column;
	gap: 1.1rem;
	padding: 1.25rem 1.5rem 1.5rem;
	border: 1px solid var(--fm-line);
	border-radius: var(--fm-radius);
	background: var(--fm-surface);
	box-shadow: var(--fm-shadow);
	color: var(--fm-text);
}

.fab-meet-card__head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1rem 1.5rem;
	flex-wrap: wrap;
	padding-bottom: 0.9rem;
	border-bottom: 1px solid var(--fm-line);
}

.fab-meet-card__eyebrow {
	display: block;
	font-size: 0.72rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	color: var(--fm-muted);
}

.fab-meet-card h2 {
	margin: 0.15rem 0 0;
	font-size: 1.2rem;
	line-height: 1.25;
}

.fab-meet-card__org {
	min-width: 15rem;
}

.fab-meet-card [data-fm-booker-slot] {
	min-width: 0;
	width: 100%;
}

@media (max-width: 700px) {
	.fab-meet-card {
		padding: 1rem;
	}

	.fab-meet-card__head {
		align-items: stretch;
	}

	.fab-meet-card__org {
		min-width: 0;
		width: 100%;
	}
}
.fab-meet-card__cta {
	display: inline-flex;
	align-self: flex-start;
	margin-top: 0.5rem;
	padding: 0.6rem 1.1rem;
	border-radius: 8px;
	background: var(--fm-primary);
	color: var(--fm-primary-text);
	font-size: 0.88rem;
	font-weight: 500;
	text-decoration: none;
}

.fab-meet-card__slots {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.fab-meet-card__slots a {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	padding: 0.6rem 0.85rem;
	border: 1px solid var(--fm-line);
	border-radius: 10px;
	text-decoration: none;
	color: inherit;
	font-size: 0.82rem;
}

.fab-meet-card__slots a:hover {
	border-color: var(--fm-primary);
}

.fab-meet-card__day {
	color: var(--fm-muted);
	font-size: 0.75rem;
	text-transform: capitalize;
}

.fab-meet-card__time {
	font-weight: 600;
	font-size: 0.95rem;
}

/* ── Assistant de réservation (3 étapes + confirmation) ──────────────────── */

.fm-steps {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 1.25rem;
	margin: 0 0 1.25rem;
	padding: 0;
	list-style: none;
	font-size: 0.82rem;
	color: var(--fm-muted);
}

.fm-steps li {
	display: flex;
	align-items: center;
	gap: 0.45rem;
}

.fm-steps li span {
	display: grid;
	place-items: center;
	width: 1.5rem;
	height: 1.5rem;
	border: 1px solid var(--fm-line);
	border-radius: 999px;
	background: var(--fm-soft);
	font-size: 0.75rem;
	font-weight: 700;
}

.fm-steps li.is-active {
	color: var(--fm-text);
	font-weight: 600;
}

.fm-steps li.is-active span,
.fm-steps li.is-done span {
	border-color: transparent;
	background: var(--fm-primary);
	color: var(--fm-primary-text);
}

.fm-step {
	display: grid;
	gap: 1rem;
}

.fm-step__actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-top: 0.5rem;
}

.fm-step__hint {
	font-size: 0.8rem;
	color: var(--fm-muted);
}

/* Deux colonnes de champs, comme n'importe quel formulaire de contact : une
   colonne unique sur toute la largeur obligeait à faire défiler pour valider. */
.fm-form__fields {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.75rem 1rem;
}

.fm-form__fields .fm-field--wide {
	grid-column: 1 / -1;
}

@media (max-width: 640px) {
	.fm-form__fields {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Le calendrier garde une taille de guichet : un mois lisible sans occuper
   l'écran, et des jours cliquables de taille confortable. */
.fm-calendar {
	max-width: 19rem;
}

.fm-shell .fm-booker {
	max-width: 46rem;
	margin-inline: auto;
}

/* ── Assistant : grille des étapes ──────────────────────────────────────── */

.fm-steps {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem 1.1rem;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 0.8rem;
	color: var(--fm-muted);
}

.fm-steps li {
	display: flex;
	align-items: center;
	gap: 0.4rem;
}

.fm-steps li span {
	display: grid;
	place-items: center;
	width: 1.35rem;
	height: 1.35rem;
	border: 1px solid var(--fm-line);
	border-radius: 999px;
	background: var(--fm-soft);
	font-size: 0.72rem;
	font-weight: 700;
}

.fm-steps li.is-active {
	color: var(--fm-text);
	font-weight: 600;
}

.fm-steps li.is-active span,
.fm-steps li.is-done span {
	border-color: transparent;
	background: var(--fm-primary);
	color: var(--fm-primary-text);
}

.fm-step {
	display: grid;
	gap: 0.9rem;
	margin-top: 0.9rem;
}

/* Date + créneaux sur une même ligne : la place perdue en hauteur est reprise
   en largeur, et le patient voit le mois et les heures d'un seul regard. */
.fm-step--split {
	grid-template-columns: minmax(0, 19rem) minmax(0, 1fr);
	align-items: start;
	gap: 1.25rem 1.5rem;
}

.fm-step--split .fm-form,
.fm-step--split .fm-waitlist {
	grid-column: 1;
	display: grid;
	gap: 0.6rem;
}

.fm-step--split .fm-recap {
	grid-column: 2;
	grid-row: 1;
}

.fm-step__actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
}

.fm-step--split .fm-step__actions {
	grid-column: 1 / -1;
}

.fm-step__actions--wide {
	grid-column: 1 / -1;
}

.fm-step__hint {
	margin: 0;
	font-size: 0.8rem;
	color: var(--fm-muted);
}

/* Choix du service : des tuiles, pas une liste déroulante — le patient voit
   d'un coup d'œil ce qui est proposé et la durée de chaque acte. */
.fm-choices {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
	gap: 0.5rem;
}

.fm-choice {
	display: grid;
	gap: 0.15rem;
	padding: 0.7rem 0.85rem;
	border: 1px solid var(--fm-line);
	border-radius: 10px;
	background: var(--fm-surface);
	text-align: left;
	cursor: pointer;
	font: inherit;
	color: var(--fm-text);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.fm-choice:hover {
	border-color: var(--fm-primary);
}

.fm-choice.is-current {
	border-color: var(--fm-primary);
	box-shadow: inset 0 0 0 1px var(--fm-primary);
	background: color-mix(in srgb, var(--fm-primary) 6%, var(--fm-surface));
}

.fm-choice__name {
	font-size: 0.92rem;
	font-weight: 600;
}

.fm-choice__meta {
	font-size: 0.78rem;
	color: var(--fm-muted);
}

.fm-recap {
	align-self: start;
	padding: 0.9rem 1rem;
	border: 1px solid var(--fm-line);
	border-radius: 10px;
	background: var(--fm-soft);
	font-size: 0.85rem;
	line-height: 1.5;
}

.fm-recap strong {
	display: block;
	font-size: 0.95rem;
	margin-bottom: 0.2rem;
}

/* Créneaux : des boutons lisibles, alignés en colonnes régulières. */
.fm-slots__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(4.6rem, 1fr));
	gap: 0.4rem;
	max-height: 15rem;
	overflow-y: auto;
	padding-right: 0.15rem;
}

@media (max-width: 820px) {
	.fm-step--split {
		grid-template-columns: minmax(0, 1fr);
	}

	.fm-step--split .fm-recap {
		grid-column: 1;
		grid-row: auto;
	}

	.fm-calendar {
		max-width: none;
	}
}