/* Le HUB - Réservations : module public. Charte : noir #121212, orange #FF3300, gris #F2F3F4, angles 5 px. */

.lehub-resa {
	--lh-ink: #121212;
	--lh-accent: var(--wp--preset--color--accent-1, #ff3300);
	--lh-soft: #f2f3f4;
	--lh-muted: #666;
	--lh-line: rgba(18, 18, 18, 0.16);
	--lh-radius: 5px;
	--lh-title: var(--wp--preset--font-family--monument, inherit);

	container-type: inline-size;
	box-sizing: border-box;
	width: 100%;
	margin-inline: auto;
	padding: clamp(18px, 4vw, 32px);
	background: #fff;
	color: var(--lh-ink);
	border: 1px solid var(--lh-line);
	border-radius: var(--lh-radius);
	font-size: 1rem;
	line-height: 1.5;
	text-align: left;
}

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

.lehub-resa [hidden] {
	display: none !important;
}

.lehub-resa button {
	font: inherit;
	color: inherit;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.lehub-resa button:disabled {
	cursor: default;
}

.lehub-resa :focus-visible {
	outline: 2px solid var(--lh-accent);
	outline-offset: 2px;
}

/* ---------- Étapes ---------- */

.lehub-resa__step + .lehub-resa__step {
	margin-top: 28px;
	padding-top: 28px;
	border-top: 1px solid var(--lh-line);
}

.lehub-resa__title {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0 0 16px;
	font-family: var(--lh-title);
	font-size: clamp(1rem, 0.9rem + 0.6cqi, 1.2rem);
	font-weight: 700;
	line-height: 1.25;
	text-wrap: balance;
}

.lehub-resa__num {
	flex: none;
	display: grid;
	place-items: center;
	width: 1.75rem;
	height: 1.75rem;
	background: var(--lh-accent);
	color: var(--lh-ink);
	border-radius: var(--lh-radius);
	font-family: inherit;
	font-size: 0.8125rem;
	font-variant-numeric: tabular-nums;
}

.lehub-resa__hint,
.lehub-resa__note,
.lehub-resa__legal {
	margin: 0;
	color: var(--lh-muted);
	font-size: 0.9375rem;
}

.lehub-resa__note {
	margin: 0 0 16px;
	padding: 10px 14px;
	background: var(--lh-soft);
	border-radius: var(--lh-radius);
	color: var(--lh-ink);
}

.lehub-resa__error {
	margin: 0 0 14px;
	padding: 10px 14px;
	border-left: 3px solid var(--lh-accent);
	background: #fff3ef;
	border-radius: 0 var(--lh-radius) var(--lh-radius) 0;
	font-size: 0.9375rem;
}

/* ---------- Choix : espaces, durées, heures ---------- */

.lehub-resa__cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	gap: 10px;
}

.lehub-resa__pills {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
	gap: 10px;
}

.lehub-resa__card,
.lehub-resa__pill,
.lehub-resa__time {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin: 0;
	padding: 12px 14px;
	background: #fff;
	border: 1px solid var(--lh-line);
	border-radius: var(--lh-radius);
	text-align: left;
	transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}

.lehub-resa__card:hover,
.lehub-resa__pill:hover,
.lehub-resa__time:hover {
	border-color: var(--lh-ink);
}

.lehub-resa__card.is-on,
.lehub-resa__pill.is-on,
.lehub-resa__time.is-on {
	background: var(--lh-ink);
	border-color: var(--lh-ink);
	color: #fff;
}

.lehub-resa__card.is-on::after,
.lehub-resa__pill.is-on::after {
	content: "";
	position: absolute;
	top: 10px;
	right: 10px;
	width: 8px;
	height: 8px;
	background: var(--lh-accent);
}

.lehub-resa__card-name,
.lehub-resa__pill-name {
	padding-right: 16px;
	font-weight: 700;
}

.lehub-resa__pill-name {
	white-space: nowrap;
}

.lehub-resa__card-sub,
.lehub-resa__pill-sub {
	font-size: 0.875rem;
	color: var(--lh-muted);
}

.is-on > .lehub-resa__card-sub,
.is-on > .lehub-resa__pill-sub {
	color: rgba(255, 255, 255, 0.78);
}

/* ---------- Calendrier ---------- */

.lehub-resa__when {
	display: grid;
	gap: 24px;
}

.lehub-resa__cal {
	max-width: 380px;
}

@container (min-width: 520px) {
	.lehub-resa__when {
		grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
		gap: 28px;
	}
}

.lehub-resa__calnav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 10px;
}

.lehub-resa__month {
	margin: 0;
	font-weight: 700;
}

.lehub-resa__arrow {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0 0 3px;
	background: #fff;
	border: 1px solid var(--lh-line);
	border-radius: var(--lh-radius);
	font-size: 1.5rem;
	line-height: 1;
}

.lehub-resa__arrow:hover:not(:disabled) {
	border-color: var(--lh-ink);
}

.lehub-resa__arrow:disabled {
	opacity: 0.3;
}

.lehub-resa__grid {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 4px;
	transition: opacity 0.15s;
}

.lehub-resa__grid.is-loading {
	opacity: 0.45;
}

.lehub-resa__dow {
	padding-bottom: 4px;
	color: var(--lh-muted);
	font-size: 0.75rem;
	text-align: center;
}

.lehub-resa__day {
	position: relative;
	display: grid;
	place-items: center;
	aspect-ratio: 1;
	min-height: 44px;
	padding: 0;
	background: transparent;
	border: 1px solid transparent;
	border-radius: var(--lh-radius);
	font-variant-numeric: tabular-nums;
}

.lehub-resa__day:disabled {
	color: #b4b6b9;
}

.lehub-resa__day.is-free {
	background: var(--lh-soft);
	font-weight: 700;
}

.lehub-resa__day.is-free:hover {
	border-color: var(--lh-ink);
}

.lehub-resa__day.is-on {
	background: var(--lh-ink);
	border-color: var(--lh-ink);
	color: #fff;
}

.lehub-resa__day.is-today::after {
	content: "";
	position: absolute;
	bottom: 5px;
	left: 50%;
	width: 5px;
	height: 5px;
	margin-left: -2.5px;
	background: var(--lh-accent);
}

/* ---------- Heures ---------- */

.lehub-resa__slots-title {
	margin: 0 0 12px;
	font-weight: 700;
}

.lehub-resa__times {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
	gap: 8px;
	margin-bottom: 12px;
}

.lehub-resa__time {
	align-items: center;
	min-height: 44px;
	padding: 10px 8px;
	font-variant-numeric: tabular-nums;
	font-weight: 700;
	white-space: nowrap;
}

/* ---------- Formulaire ---------- */

.lehub-resa__recap {
	margin: 0 0 18px;
	padding: 12px 14px;
	background: var(--lh-soft);
	border-radius: var(--lh-radius);
}

.lehub-resa__fields {
	display: grid;
	gap: 14px;
}

@container (min-width: 560px) {
	.lehub-resa__fields {
		grid-template-columns: 1fr 1fr;
	}

	.lehub-resa__field--message {
		grid-column: 1 / -1;
	}
}

.lehub-resa__fields--wide {
	display: block;
	margin-top: 14px;
}

.lehub-resa__services {
	min-width: 0;
	margin: 16px 0 0;
	padding: 12px 14px 14px;
	border: 1px solid var(--lh-line);
	border-radius: var(--lh-radius);
}

.lehub-resa__services legend {
	padding: 0 6px;
	margin: 0 0 0 -6px;
}

.lehub-resa__checks {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 28px;
}

.lehub-resa__check {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	cursor: pointer;
}

.lehub-resa__check input {
	width: 20px;
	height: 20px;
	margin: 0;
	accent-color: var(--lh-ink);
}

.lehub-resa__check input:disabled + span {
	color: #8a8c8f;
}

.lehub-resa__services .lehub-resa__field {
	max-width: 260px;
	margin-top: 8px;
}

.lehub-resa__services .lehub-resa__hint {
	margin-top: 4px;
}

.lehub-resa__label {
	display: block;
	margin-bottom: 5px;
	font-size: 0.9375rem;
	font-weight: 700;
}

.lehub-resa__optional {
	color: var(--lh-muted);
	font-weight: 400;
}

.lehub-resa__input {
	display: block;
	width: 100%;
	min-height: 46px;
	margin: 0;
	padding: 10px 12px;
	background: #fff;
	border: 1px solid rgba(18, 18, 18, 0.32);
	border-radius: var(--lh-radius);
	color: var(--lh-ink);
	font: inherit;
	font-size: 1rem;
}

textarea.lehub-resa__input {
	resize: vertical;
}

.lehub-resa__input:hover {
	border-color: var(--lh-ink);
}

.lehub-resa__input[aria-invalid="true"] {
	border-color: var(--lh-accent);
	box-shadow: inset 0 0 0 1px var(--lh-accent);
}

.lehub-resa__fielderr {
	margin: 5px 0 0;
	color: #c22600;
	font-size: 0.875rem;
}

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

.lehub-resa__turnstile {
	margin-top: 16px;
}

.lehub-resa__form .lehub-resa__error {
	margin: 16px 0 0;
}

.lehub-resa__submit {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px 20px;
	margin-top: 20px;
}

.lehub-resa__legal {
	flex: 1 1 240px;
	font-size: 0.8125rem;
}

.lehub-resa__legal a {
	color: inherit;
}

/* ---------- Grand écran : étapes côte à côte, module moins haut ---------- */

.lehub-resa__step--when.is-idle {
	display: none;
}

@container (min-width: 820px) {
	.lehub-resa__steps {
		display: grid;
		grid-template-columns: minmax(0, min(350px, 36%)) minmax(0, 1fr);
		grid-template-rows: auto 1fr;
	}

	.lehub-resa__steps > .lehub-resa__step {
		margin-top: 0;
		padding-top: 0;
		border-top: 0;
	}

	.lehub-resa__steps > .lehub-resa__step--space,
	.lehub-resa__steps > .lehub-resa__step--duration {
		grid-column: 1;
		padding-right: 36px;
	}

	.lehub-resa__steps > .lehub-resa__step--duration {
		grid-row: 2;
		margin-top: 22px;
		padding-top: 22px;
		border-top: 1px solid var(--lh-line);
	}

	.lehub-resa__steps > .lehub-resa__step--duration:first-child {
		grid-row: 1 / span 2;
		margin-top: 0;
		padding-top: 0;
		border-top: 0;
	}

	.lehub-resa__steps > .lehub-resa__step--when {
		display: block;
		grid-column: 2;
		grid-row: 1 / span 2;
		padding-left: 36px;
		border-left: 1px solid var(--lh-line);
	}

	.lehub-resa__steps > .lehub-resa__step--when.is-idle .lehub-resa__cal {
		opacity: 0.55;
	}

	.lehub-resa__steps > .lehub-resa__step--details {
		grid-column: 1 / -1;
		grid-row: 3;
		margin-top: 26px;
		padding-top: 26px;
		border-top: 1px solid var(--lh-line);
	}

	.lehub-resa__cards {
		grid-template-columns: 1fr;
		gap: 8px;
	}

	.lehub-resa__pills {
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
		gap: 8px;
	}

	.lehub-resa__card,
	.lehub-resa__pill {
		padding: 10px 12px;
	}

	.lehub-resa__pill-name {
		padding-right: 12px;
	}

	.lehub-resa__step--when .lehub-resa__note {
		margin: 0 0 16px;
	}

	.lehub-resa__when {
		grid-template-columns: minmax(0, 310px) minmax(0, 1fr);
		gap: 32px;
	}

	.lehub-resa__times {
		grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
	}

	.lehub-resa__time {
		padding: 10px 4px;
	}

	.lehub-resa__fields {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	textarea.lehub-resa__input {
		height: 46px;
	}

	.lehub-resa__services {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 4px 32px;
	}

	.lehub-resa__services .lehub-resa__field {
		display: flex;
		align-items: center;
		gap: 12px;
		max-width: none;
		margin-top: 0;
	}

	.lehub-resa__services .lehub-resa__field .lehub-resa__label {
		margin: 0;
		white-space: nowrap;
	}

	.lehub-resa__services .lehub-resa__field .lehub-resa__input {
		width: 96px;
	}

	.lehub-resa__services .lehub-resa__hint {
		margin-top: 0;
	}
}

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

.lehub-resa__btn {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	min-height: 48px;
	margin: 0;
	padding: 12px 20px;
	background: var(--lh-ink);
	border: 1px solid var(--lh-ink);
	border-radius: var(--lh-radius);
	color: #fff !important;
	font-weight: 700;
	transition: background-color 0.15s;
}

.lehub-resa__btn::after {
	content: "";
	flex: none;
	width: 9px;
	height: 9px;
	background: var(--lh-accent);
	transition: background-color 0.15s;
}

.lehub-resa__btn:hover:not(:disabled) {
	background: var(--lh-accent);
	border-color: var(--lh-accent);
}

.lehub-resa__btn:hover:not(:disabled)::after {
	background: #fff;
}

.lehub-resa__btn:disabled {
	opacity: 0.55;
}

.lehub-resa__btn--ghost {
	background: #fff;
	color: var(--lh-ink) !important;
}

.lehub-resa__btn--ghost:hover:not(:disabled) {
	background: var(--lh-ink);
	border-color: var(--lh-ink);
	color: #fff !important;
}

.lehub-resa__btn--ghost:hover:not(:disabled)::after {
	background: var(--lh-accent);
}

.lehub-resa__link {
	padding: 0;
	background: none;
	border: 0;
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ---------- Accès résidents ---------- */

.lehub-resa__gateform {
	max-width: 380px;
}

.lehub-resa__gateform .lehub-resa__hint {
	margin-bottom: 8px;
}

.lehub-resa__gateform .lehub-resa__input {
	margin-bottom: 14px;
}

/* ---------- Confirmation ---------- */

.lehub-resa__done:focus {
	outline: none;
}

.lehub-resa__done-tag {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 6px;
	color: var(--lh-muted);
	font-size: 0.8125rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.lehub-resa__done-tag::before {
	content: "";
	width: 9px;
	height: 9px;
	background: var(--lh-accent);
}

.lehub-resa__done-title {
	margin: 0 0 10px;
	font-family: var(--lh-title);
	font-size: clamp(1.4rem, 1.1rem + 2cqi, 2rem);
	font-weight: 700;
	line-height: 1.15;
}

.lehub-resa__done-text {
	margin: 0 0 18px;
	max-width: 60ch;
}

.lehub-resa__summary {
	margin: 0 0 22px;
	border-top: 1px solid var(--lh-line);
}

.lehub-resa__summary > div {
	display: flex;
	gap: 12px;
	padding: 9px 0;
	border-bottom: 1px solid var(--lh-line);
}

.lehub-resa__summary dt {
	flex: 0 0 110px;
	color: var(--lh-muted);
}

.lehub-resa__summary dd {
	margin: 0;
	font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
	.lehub-resa *,
	.lehub-resa *::before,
	.lehub-resa *::after {
		transition: none !important;
	}
}
