/*
 * WYBE - Module Rendez-vous : styles du module public.
 *
 * Tout est sous .wdgrv pour ne rien toucher au reste du site. Les couleurs
 * reprennent les couleurs globales Elementor du site quand elles existent.
 *
 * Source : assets/src/front.css — copie dans assets/dist/ par `npm run build`.
 */

/* Le module s'adapte a la largeur de son conteneur (colonne Elementor,
   contenu du theme), pas seulement a celle de l'ecran. */
.wdgrv-wrap {
	/* width explicite : avec la container query, le bloc n'a plus de largeur
	   intrinseque et s'effondre a 0 dans un conteneur flex (widget Elementor). */
	width: 100%;
	container-type: inline-size;
}

.wdgrv {
	--wdgrv-primary: var(--e-global-color-primary, #003e52);
	--wdgrv-accent: var(--e-global-color-accent, #ff595a);
	--wdgrv-light: #edf1f3;
	--wdgrv-border: #c9d4da;
	--wdgrv-muted: #6b7f89;
	--wdgrv-danger: #c62f30;
	--wdgrv-radius: 10px;

	display: grid;
	grid-template-columns: minmax(220px, 300px) 1fr;
	max-width: 1000px;
	min-height: 560px;
	margin: 0 auto;
	overflow: hidden;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 10px 40px rgba(0, 62, 82, 0.12);
	color: var(--wdgrv-primary);
	font-family: inherit;
	font-size: 16px;
	line-height: 1.5;
	text-align: left;
}

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

.wdgrv [hidden] {
	display: none !important;
}

/* Colonne des etapes ------------------------------------------------------ */

.wdgrv__aside {
	display: flex;
	flex-direction: column;
	gap: 24px;
	padding: 28px 24px;
	background: var(--wdgrv-primary);
	color: #fff;
}

.wdgrv__steps {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Annulation : les etapes de reservation n'ont pas de sens. */
.wdgrv.is-cancel .wdgrv__steps {
	display: none;
}

.wdgrv__step {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	margin: 0;
	padding: 14px;
	border-radius: var(--wdgrv-radius);
	background: rgba(255, 255, 255, 0.06);
	opacity: 0.7;
}

.wdgrv__step.is-current,
.wdgrv__step.is-done {
	opacity: 1;
}

.wdgrv__step.is-current {
	background: rgba(255, 255, 255, 0.14);
}

.wdgrv__step-num {
	display: inline-flex;
	flex: 0 0 28px;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border: 2px solid rgba(255, 255, 255, 0.5);
	border-radius: 50%;
	font-size: 14px;
	font-weight: 700;
}

.wdgrv__step.is-done .wdgrv__step-num {
	border-color: var(--wdgrv-accent);
	background: var(--wdgrv-accent);
	color: transparent;
	position: relative;
}

.wdgrv__step.is-done .wdgrv__step-num::after {
	content: "";
	position: absolute;
	top: 5px;
	left: 8px;
	width: 7px;
	height: 12px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.wdgrv__step-text {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.wdgrv__step-title {
	font-weight: 600;
}

.wdgrv__step-value {
	font-size: 14px;
	opacity: 0.85;
	overflow-wrap: anywhere;
}

.wdgrv__step-value:empty {
	display: none;
}

.wdgrv__contact {
	margin: auto 0 0;
	padding-top: 20px;
	border-top: 1px solid rgba(255, 255, 255, 0.2);
	font-size: 14px;
	text-align: center;
	opacity: 0.85;
}

.wdgrv__contact a {
	display: block;
	color: #fff;
	font-size: 16px;
	font-weight: 600;
	text-decoration: none;
}

/* Panneau principal ------------------------------------------------------- */

.wdgrv__main {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.wdgrv__panel,
.wdgrv__form {
	display: flex;
	flex: 1;
	flex-direction: column;
}

.wdgrv__header {
	display: flex;
	gap: 16px;
	align-items: center;
	padding: 24px 32px;
	border-bottom: 1px solid var(--wdgrv-light);
}

.wdgrv .wdgrv__title {
	margin: 0;
	color: var(--wdgrv-primary);
	font-size: 24px;
	font-weight: 600;
	line-height: 1.3;
}

.wdgrv__title:focus {
	outline: none;
}

.wdgrv__body {
	flex: 1;
	padding: 28px 32px;
}

.wdgrv__footer {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	justify-content: flex-end;
	padding: 20px 32px;
	border-top: 1px solid var(--wdgrv-light);
}

.wdgrv__alert {
	margin: 20px 32px 0;
	padding: 12px 16px;
	border-left: 4px solid var(--wdgrv-accent);
	border-radius: 6px;
	background: #fff1f1;
	color: #8a1f20;
	font-size: 15px;
}

/* Boutons (proteges des styles du theme) ---------------------------------- */

.wdgrv button {
	margin: 0;
	font-family: inherit;
	letter-spacing: normal;
	text-transform: none;
	box-shadow: none;
	cursor: pointer;
}

.wdgrv button:disabled {
	cursor: not-allowed;
}

.wdgrv button:focus-visible,
.wdgrv a:focus-visible,
.wdgrv .wdgrv__checkbox:focus-visible {
	outline: 3px solid var(--wdgrv-accent);
	outline-offset: 2px;
}

/* Champs et liste deroulante : les navigateurs appliquent :focus-visible des
   qu'ils ont le focus (y compris au clic ou en programmation) ; on garde un
   repere discret dans la couleur principale plutot que le cadre accent. */
.wdgrv .wdgrv__input:focus,
.wdgrv .wdgrv__select:focus {
	outline: none;
	border-color: var(--wdgrv-primary);
	box-shadow: 0 0 0 3px rgba(0, 62, 82, 0.15);
}

.wdgrv .wdgrv__btn {
	padding: 14px 28px;
	border: 2px solid var(--wdgrv-primary);
	border-radius: var(--wdgrv-radius);
	background: var(--wdgrv-primary);
	color: #fff;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
}

.wdgrv .wdgrv__btn:hover:not(:disabled) {
	border-color: #00546f;
	background: #00546f;
}

.wdgrv .wdgrv__btn:disabled {
	opacity: 0.6;
}

.wdgrv .wdgrv__btn--ghost {
	background: #fff;
	color: var(--wdgrv-primary);
}

.wdgrv .wdgrv__btn--ghost:hover:not(:disabled) {
	background: var(--wdgrv-light);
	color: var(--wdgrv-primary);
}

.wdgrv .wdgrv__btn--danger {
	border-color: var(--wdgrv-danger);
	background: var(--wdgrv-danger);
}

.wdgrv .wdgrv__btn--danger:hover:not(:disabled) {
	border-color: #a32223;
	background: #a32223;
}

.wdgrv .wdgrv__back {
	display: inline-flex;
	flex: 0 0 40px;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid var(--wdgrv-border);
	border-radius: 8px;
	background: #fff;
	color: var(--wdgrv-primary);
	font-size: 24px;
	line-height: 1;
}

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

.wdgrv__field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.wdgrv__label {
	font-weight: 600;
}

.wdgrv__req {
	color: var(--wdgrv-accent);
}

.wdgrv .wdgrv__select,
.wdgrv .wdgrv__input {
	width: 100%;
	min-height: 52px;
	padding: 12px 16px;
	border: 1px solid var(--wdgrv-border);
	border-radius: var(--wdgrv-radius);
	background-color: #fff;
	color: var(--wdgrv-primary);
	font-family: inherit;
	font-size: 16px;
	box-shadow: none;
}

.wdgrv textarea.wdgrv__input {
	min-height: 96px;
	resize: vertical;
}

.wdgrv .wdgrv__input[aria-invalid="true"] {
	border-color: var(--wdgrv-danger);
}

.wdgrv__desc,
.wdgrv__note {
	margin: 0;
	color: var(--wdgrv-primary);
}

.wdgrv__desc {
	color: var(--wdgrv-muted);
	font-size: 15px;
}

.wdgrv__error {
	margin: 0;
	color: var(--wdgrv-danger);
	font-size: 14px;
}

.wdgrv__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px 24px;
}

.wdgrv__field--wide {
	grid-column: 1 / -1;
}

.wdgrv__field--check {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 6px 12px;
	align-items: start;
	font-size: 15px;
}

.wdgrv__field--check .wdgrv__privacy,
.wdgrv__field--check .wdgrv__error {
	grid-column: 2;
}

.wdgrv .wdgrv__checkbox {
	width: 20px;
	height: 20px;
	margin: 2px 0 0;
	accent-color: var(--wdgrv-primary);
}

.wdgrv__privacy {
	color: var(--wdgrv-primary);
	font-size: 14px;
}

.wdgrv__hp {
	position: absolute;
	left: -10000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

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

.wdgrv__cal {
	max-width: 520px;
}

.wdgrv__cal-nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}

.wdgrv__cal-month {
	font-size: 18px;
	font-weight: 600;
}

.wdgrv .wdgrv__cal-btn {
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid var(--wdgrv-border);
	border-radius: 8px;
	background: #fff;
	color: var(--wdgrv-primary);
	font-size: 22px;
	line-height: 1;
}

.wdgrv .wdgrv__cal-btn:disabled {
	opacity: 0.35;
}

.wdgrv__cal-head,
.wdgrv__cal-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 6px;
}

.wdgrv__cal-head {
	margin-bottom: 6px;
	color: var(--wdgrv-muted);
	font-size: 13px;
	text-align: center;
	text-transform: capitalize;
}

.wdgrv .wdgrv__day {
	aspect-ratio: 1 / 1;
	min-height: 40px;
	padding: 0;
	border: 1px solid var(--wdgrv-border);
	border-radius: 8px;
	background: #fff;
	color: var(--wdgrv-primary);
	font-size: 16px;
	font-weight: 600;
}

.wdgrv .wdgrv__day:hover:not(:disabled):not([aria-pressed="true"]) {
	border-color: var(--wdgrv-accent);
	background: var(--wdgrv-light);
	color: var(--wdgrv-primary);
}

.wdgrv .wdgrv__day:disabled {
	border-color: transparent;
	background: transparent;
	color: #b7c3c9;
	font-weight: 400;
}

.wdgrv .wdgrv__day[aria-pressed="true"],
.wdgrv .wdgrv__slot[aria-pressed="true"] {
	border-color: var(--wdgrv-primary);
	background: var(--wdgrv-primary);
	color: #fff;
}

.wdgrv__hint {
	margin: 16px 0 0;
	color: var(--wdgrv-muted);
}

.wdgrv__hint:empty {
	display: none;
}

.wdgrv.is-loading .wdgrv__cal-grid {
	opacity: 0.4;
}

.wdgrv__slots {
	margin-top: 24px;
}

.wdgrv__slots-title {
	margin: 0 0 12px;
	font-weight: 600;
}

.wdgrv__slots-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 10px;
}

.wdgrv .wdgrv__slot {
	min-height: 48px;
	padding: 10px;
	border: 1px solid var(--wdgrv-border);
	border-radius: var(--wdgrv-radius);
	background: var(--wdgrv-light);
	color: var(--wdgrv-primary);
	font-size: 16px;
	font-weight: 600;
}

/* Survol : couleur accent du site (sinon le kit Elementor impose son propre
   fond de bouton au survol). */
.wdgrv .wdgrv__slot:hover:not([aria-pressed="true"]) {
	border-color: var(--wdgrv-accent);
	background: var(--wdgrv-accent);
	color: #fff;
}

/* Jours et creneaux : pas de cadre au focus, un repere discret a l'interieur. */
.wdgrv .wdgrv__slot:focus-visible,
.wdgrv .wdgrv__day:focus-visible {
	outline: none;
	box-shadow: inset 0 0 0 2px var(--wdgrv-accent);
}

/* Recapitulatif ----------------------------------------------------------- */

.wdgrv__recap {
	display: grid;
	gap: 0;
	margin: 0 0 20px;
	border: 1px solid var(--wdgrv-light);
	border-radius: var(--wdgrv-radius);
}

.wdgrv__recap > div {
	display: grid;
	grid-template-columns: minmax(90px, 140px) 1fr;
	gap: 12px;
	padding: 12px 16px;
}

.wdgrv__recap > div + div {
	border-top: 1px solid var(--wdgrv-light);
}

.wdgrv__recap dt {
	color: var(--wdgrv-muted);
}

.wdgrv__recap dd {
	margin: 0;
	font-weight: 600;
}

.wdgrv__noscript,
.wdgrv-unavailable {
	padding: 16px;
	color: var(--wdgrv-primary, #003e52);
}

/* Conteneur etroit ------------------------------------------------------- */

@container (max-width: 760px) {
	.wdgrv.is-cancel .wdgrv__aside {
		display: none;
	}

	.wdgrv {
		grid-template-columns: 1fr;
		min-height: 0;
		border-radius: 12px;
	}

	.wdgrv__aside {
		gap: 0;
		padding: 16px;
	}

	.wdgrv__steps {
		flex-direction: row;
		gap: 8px;
	}

	.wdgrv__step {
		flex: 1;
		flex-direction: column;
		gap: 6px;
		align-items: center;
		padding: 10px 6px;
		font-size: 13px;
		text-align: center;
	}

	.wdgrv__step-value,
	.wdgrv__contact {
		display: none;
	}

	.wdgrv__header,
	.wdgrv__body,
	.wdgrv__footer {
		padding-right: 16px;
		padding-left: 16px;
	}

	.wdgrv__alert {
		margin: 16px 16px 0;
	}

	.wdgrv .wdgrv__title {
		font-size: 20px;
	}

	.wdgrv__grid {
		grid-template-columns: 1fr;
	}

	.wdgrv__footer .wdgrv__btn {
		flex: 1;
	}

	.wdgrv__recap > div {
		grid-template-columns: 1fr;
		gap: 2px;
	}

	.wdgrv .wdgrv__day {
		min-height: 36px;
		font-size: 15px;
	}
}
