/* PTL Booking 1.2.0 - widget de reservation. Neutre, pilote par les variables --bk-*.
   Le site peut surcharger : --bk-accent (couleur), --bk-accent-ink (texte sur l'accent),
   --bk-cta (fond du bouton principal, un degrade est accepte), --bk-radius, --bk-font-title. */
.ptl-booking {
	--bk-accent: #12b39c; --bk-accent-ink: #ffffff; --bk-cta: var(--bk-accent);
	--bk-ink: #1c1e26; --bk-muted: #6a6f80; --bk-line: rgba(20, 22, 40, 0.12); --bk-soft: #f4f5f9; --bk-bg: #ffffff;
	--bk-radius: 16px; --bk-font-title: inherit;
	--bk-tint: color-mix(in srgb, var(--bk-accent) 10%, transparent);
	--bk-tint-2: color-mix(in srgb, var(--bk-accent) 18%, transparent);
	container-type: inline-size;
	max-width: 760px; margin: 0 auto; padding: 24px; background: var(--bk-bg); color: var(--bk-ink);
	border: 1px solid var(--bk-line); border-radius: calc(var(--bk-radius) + 6px); font-size: 15.5px; line-height: 1.5;
}
.ptl-booking * { box-sizing: border-box; }
.ptl-booking button { font: inherit; color: inherit; }
.ptl-booking :focus-visible { outline: 2px solid var(--bk-accent); outline-offset: 2px; }
.ptl-booking .bk-ico { width: 18px; height: 18px; flex: none; }
.ptl-booking .bk-title { margin: 0 0 4px; font-family: var(--bk-font-title); font-size: 21px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.2; }
.ptl-booking .bk-err { padding: 26px 0; text-align: center; color: #b3261e; }

/* Squelettes de chargement */
.ptl-booking .bk-skel { display: block; border-radius: 10px; background: linear-gradient(90deg, var(--bk-soft) 25%, color-mix(in srgb, var(--bk-soft) 40%, #fff) 50%, var(--bk-soft) 75%); background-size: 200% 100%; animation: bk-shimmer 1.3s infinite linear; }
.ptl-booking .bk-skel--full { height: 360px; border-radius: var(--bk-radius); }
.ptl-booking .bk-skel--day { aspect-ratio: 1; border-radius: 50%; max-width: 42px; margin: 0 auto; width: 100%; }
.ptl-booking .bk-skel--slot { height: 44px; }
@keyframes bk-shimmer { to { background-position: -200% 0; } }

/* Étapes */
.ptl-booking .bk-steps { display: flex; gap: 6px; list-style: none; margin: 0 0 20px; padding: 0; counter-reset: none; }
.ptl-booking .bk-steps li { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--bk-muted); padding-bottom: 10px; border-bottom: 3px solid var(--bk-line); transition: color 0.3s, border-color 0.3s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ptl-booking .bk-steps li span { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 12px; background: var(--bk-soft); color: var(--bk-muted); }
.ptl-booking .bk-steps li span .bk-ico { width: 14px; height: 14px; }
.ptl-booking .bk-steps li em { font-style: normal; overflow: hidden; text-overflow: ellipsis; }
@container (max-width: 440px) { .ptl-booking .bk-steps li:not(.is-on) { flex: 0 0 auto; } .ptl-booking .bk-steps li:not(.is-on) em { display: none; } .ptl-booking .bk-steps li.is-on { flex: 1; } }
.ptl-booking .bk-steps li.is-on { color: var(--bk-ink); border-color: var(--bk-accent); }
.ptl-booking .bk-steps li.is-on span { background: var(--bk-accent); color: var(--bk-accent-ink); }
.ptl-booking .bk-steps li.is-done { border-color: var(--bk-tint-2); }
.ptl-booking .bk-steps li.is-done span { background: var(--bk-tint-2); color: var(--bk-accent); }

/* En-tête de l'étape créneau */
.ptl-booking .bk-intro { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; margin-bottom: 14px; }
.ptl-booking .bk-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.ptl-booking .bk-chips span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--bk-soft); font-size: 13px; font-weight: 600; color: var(--bk-ink); }
.ptl-booking .bk-chips .bk-ico { width: 15px; height: 15px; color: var(--bk-accent); }
.ptl-booking .bk-desc { margin: -4px 0 16px; color: var(--bk-muted); font-size: 14.5px; }

/* Choix du type : boutons segmentés */
.ptl-booking .bk-seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; margin: 0 0 16px; }
.ptl-booking .bk-seg__btn { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; border: 1.5px solid var(--bk-line); border-radius: var(--bk-radius); background: var(--bk-bg); cursor: pointer; transition: border-color 0.2s, background 0.2s, box-shadow 0.2s; }
.ptl-booking .bk-seg__btn .bk-ico { width: 38px; height: 38px; padding: 9px; border-radius: 12px; background: var(--bk-soft); color: var(--bk-muted); transition: background 0.2s, color 0.2s; }
.ptl-booking .bk-seg__btn span { display: grid; gap: 1px; min-width: 0; }
.ptl-booking .bk-seg__btn strong { font-size: 14.5px; line-height: 1.25; }
.ptl-booking .bk-seg__btn em { font-style: normal; font-size: 12.5px; color: var(--bk-muted); }
.ptl-booking .bk-seg__btn:hover { border-color: color-mix(in srgb, var(--bk-accent) 50%, var(--bk-line)); }
.ptl-booking .bk-seg__btn.is-on { border-color: var(--bk-accent); background: var(--bk-tint); box-shadow: 0 0 0 3px var(--bk-tint); }
.ptl-booking .bk-seg__btn.is-on .bk-ico { background: var(--bk-accent); color: var(--bk-accent-ink); }

/* Calendrier + horaires : côte à côte dès que le widget a la place, empilés sinon */
.ptl-booking .bk-pick { display: grid; gap: 18px; }
@container (min-width: 540px) { .ptl-booking .bk-pick { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 0; } .ptl-booking .bk-times { border-left: 1px solid var(--bk-line); padding-left: 22px; margin-left: 22px; } }
.ptl-booking .bk-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ptl-booking .bk-mois { font-size: 16px; font-weight: 700; text-transform: capitalize; }
.ptl-booking .bk-navbtn { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--bk-line); background: var(--bk-bg); border-radius: 50%; cursor: pointer; transition: background 0.2s, border-color 0.2s; }
.ptl-booking .bk-navbtn:hover:not(:disabled) { background: var(--bk-tint); border-color: var(--bk-accent); color: var(--bk-accent); }
.ptl-booking .bk-navbtn:disabled { opacity: 0.35; cursor: default; }
.ptl-booking .bk-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px 2px; text-align: center; }
.ptl-booking .bk-dow { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--bk-muted); padding: 6px 0; }
.ptl-booking .bk-day { position: relative; width: 100%; max-width: 44px; aspect-ratio: 1; margin: 0 auto; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; font-size: 14.5px; font-variant-numeric: tabular-nums; color: color-mix(in srgb, var(--bk-muted) 55%, transparent); cursor: default; transition: background 0.18s, color 0.18s, transform 0.18s; }
.ptl-booking .bk-day.is-libre { cursor: pointer; color: var(--bk-ink); font-weight: 700; background: var(--bk-tint); }
.ptl-booking .bk-day.is-libre::after { content: ""; position: absolute; bottom: 6px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--bk-accent); }
.ptl-booking .bk-day.is-libre:hover { background: var(--bk-tint-2); transform: scale(1.06); }
.ptl-booking .bk-day.is-auj { box-shadow: inset 0 0 0 1.5px var(--bk-muted); }
.ptl-booking .bk-day.is-sel { background: var(--bk-accent); color: var(--bk-accent-ink); box-shadow: 0 6px 16px -6px var(--bk-accent); }
.ptl-booking .bk-day.is-sel::after { background: var(--bk-accent-ink); }

.ptl-booking .bk-times { display: flex; flex-direction: column; min-height: 0; }
.ptl-booking .bk-times__titre { margin: 6px 0 14px; font-size: 15.5px; color: var(--bk-muted); }
.ptl-booking .bk-times__titre strong { color: var(--bk-ink); text-transform: capitalize; }
.ptl-booking .bk-times__list { display: grid; gap: 14px; max-height: 330px; overflow-y: auto; padding-right: 4px; scrollbar-width: thin; }
.ptl-booking .bk-groupe__nom { margin: 0 0 7px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--bk-muted); }
.ptl-booking .bk-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.ptl-booking .bk-slot { min-height: 44px; padding: 8px 6px; border: 1.5px solid var(--bk-line); border-radius: 12px; background: var(--bk-bg); cursor: pointer; font-weight: 700; font-size: 14.5px; font-variant-numeric: tabular-nums; transition: border-color 0.18s, background 0.18s, color 0.18s, transform 0.18s; }
.ptl-booking .bk-slot:hover { border-color: var(--bk-accent); color: var(--bk-accent); transform: translateY(-1px); }
.ptl-booking .bk-slot.is-sel { background: var(--bk-accent); border-color: var(--bk-accent); color: var(--bk-accent-ink); box-shadow: 0 8px 18px -8px var(--bk-accent); }
.ptl-booking .bk-vide-msg { margin: 0; padding: 18px; border-radius: 12px; background: var(--bk-soft); color: var(--bk-muted); font-size: 14px; text-align: center; }
.ptl-booking .bk-tz { margin: 12px 0 0; font-size: 12px; color: var(--bk-muted); }

/* Barre récapitulative + Continuer */
.ptl-booking .bk-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; padding: 12px 12px 12px 16px; border-radius: var(--bk-radius); background: var(--bk-soft); }
.ptl-booking .bk-bar__txt { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 14px; color: var(--bk-muted); min-width: 0; }
.ptl-booking .bk-bar__txt .bk-ico { color: var(--bk-accent); }
.ptl-booking .bk-bar__txt span { display: grid; min-width: 0; }
.ptl-booking .bk-bar__txt strong { color: var(--bk-ink); font-size: 14.5px; }
.ptl-booking .bk-bar__txt em { font-style: normal; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ptl-booking.bk-has-sel .bk-bar { background: var(--bk-tint); }
@container (max-width: 420px) { .ptl-booking .bk-bar { flex-direction: column; align-items: stretch; } .ptl-booking .bk-bar .bk-cta { width: 100%; } }

/* Boutons */
.ptl-booking .bk-cta { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 24px; border: 0; border-radius: 999px; background: var(--bk-cta); color: var(--bk-accent-ink); font-weight: 700; font-size: 15.5px; text-decoration: none; cursor: pointer; transition: filter 0.2s, transform 0.2s, opacity 0.2s, box-shadow 0.2s; box-shadow: 0 10px 22px -12px var(--bk-accent); }
.ptl-booking .bk-cta:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.ptl-booking .bk-cta:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.ptl-booking .bk-cta.is-busy { opacity: 0.85; cursor: wait; color: transparent; }
.ptl-booking .bk-cta.is-busy::after { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--bk-accent-ink); border-right-color: transparent; animation: bk-spin 0.7s linear infinite; }
@keyframes bk-spin { to { transform: rotate(360deg); } }
.ptl-booking .bk-cta--plein { width: 100%; }
.ptl-booking .bk-ghost { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 22px; border: 1.5px solid var(--bk-line); border-radius: 999px; background: var(--bk-bg); color: var(--bk-ink); font-weight: 600; text-decoration: none; cursor: pointer; transition: border-color 0.2s, color 0.2s; }
.ptl-booking .bk-ghost:hover { border-color: var(--bk-accent); color: var(--bk-accent); }
.ptl-booking .bk-actions { display: grid; gap: 10px; margin-top: 16px; }

/* Récapitulatif */
.ptl-booking .bk-recap { display: flex; align-items: flex-start; gap: 14px; margin: 12px 0 18px; padding: 14px 16px; border-radius: var(--bk-radius); background: var(--bk-tint); }
.ptl-booking .bk-recap__ico { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--bk-accent); color: var(--bk-accent-ink); }
.ptl-booking .bk-recap__ico .bk-ico { width: 22px; height: 22px; }
.ptl-booking .bk-recap > div { flex: 1; min-width: 0; }
.ptl-booking .bk-recap strong { display: block; margin-bottom: 4px; font-size: 15.5px; }
.ptl-booking .bk-recap p { display: flex; align-items: center; gap: 7px; margin: 2px 0 0; font-size: 14px; color: var(--bk-ink); }
.ptl-booking .bk-recap p:first-letter { text-transform: uppercase; }
.ptl-booking .bk-recap p .bk-ico { width: 15px; height: 15px; color: var(--bk-accent); }
@container (max-width: 440px) { .ptl-booking .bk-recap { flex-wrap: wrap; } .ptl-booking .bk-recap > div { flex-basis: calc(100% - 58px); } .ptl-booking .bk-modif { margin-left: 58px; } }
.ptl-booking .bk-modif { flex: none; padding: 6px 12px; border: 0; border-radius: 999px; background: var(--bk-bg); font-size: 13px; font-weight: 700; color: var(--bk-accent); cursor: pointer; }
.ptl-booking .bk-modif:hover { text-decoration: underline; }

/* Formulaire */
.ptl-booking .bk-form { display: grid; gap: 14px; }
.ptl-booking .bk-row { display: grid; gap: 14px; grid-template-columns: 1fr; }
@container (min-width: 480px) { .ptl-booking .bk-row { grid-template-columns: 1fr 1fr; } }
.ptl-booking .bk-field { display: grid; gap: 6px; font-size: 13.5px; font-weight: 600; }
.ptl-booking .bk-field b { color: var(--bk-accent); font-weight: 700; }
.ptl-booking .bk-field i { font-style: normal; font-weight: 400; color: var(--bk-muted); }
.ptl-booking .bk-field input, .ptl-booking .bk-field textarea { width: 100%; min-height: 48px; padding: 12px 14px; border: 1.5px solid var(--bk-line); border-radius: 12px; font: inherit; font-size: 16px; font-weight: 400; background: var(--bk-bg); color: var(--bk-ink); transition: border-color 0.2s, box-shadow 0.2s; }
.ptl-booking .bk-field textarea { resize: vertical; min-height: 84px; }
.ptl-booking .bk-field input::placeholder, .ptl-booking .bk-field textarea::placeholder { color: color-mix(in srgb, var(--bk-muted) 70%, transparent); }
.ptl-booking .bk-field input:focus, .ptl-booking .bk-field textarea:focus { outline: none; border-color: var(--bk-accent); box-shadow: 0 0 0 4px var(--bk-tint-2); }
.ptl-booking .bk-field.is-err input { border-color: #d64545; box-shadow: 0 0 0 4px rgba(214, 69, 69, 0.12); }
.ptl-booking .bk-hp { position: absolute; left: -9999px; height: 0; width: 0; border: 0; padding: 0; }
.ptl-booking .bk-legal { display: flex; align-items: flex-start; gap: 7px; margin: 0; font-size: 12.5px; color: var(--bk-muted); font-weight: 400; }
.ptl-booking .bk-legal .bk-ico { width: 15px; height: 15px; margin-top: 1px; color: var(--bk-accent); }
.ptl-booking .bk-msg:empty { display: none; }
.ptl-booking .bk-msg { font-size: 14px; padding: 10px 14px; border-radius: 12px; background: var(--bk-soft); }
.ptl-booking .bk-msg--err { color: #a52a24; background: rgba(214, 69, 69, 0.08); }

/* Confirmation */
.ptl-booking .bk-done { text-align: center; padding: 6px 0 4px; }
.ptl-booking .bk-done__ico { display: inline-block; width: 68px; height: 68px; margin-bottom: 12px; }
.ptl-booking .bk-done__ico svg { width: 100%; height: 100%; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ptl-booking .bk-done__ico circle { stroke: var(--bk-accent); stroke-width: 2.5; fill: var(--bk-tint); stroke-dasharray: 151; stroke-dashoffset: 151; animation: bk-trace 0.6s ease-out forwards; }
.ptl-booking .bk-done__ico path { stroke: var(--bk-accent); stroke-width: 4; stroke-dasharray: 36; stroke-dashoffset: 36; animation: bk-trace 0.4s 0.45s ease-out forwards; }
@keyframes bk-trace { to { stroke-dashoffset: 0; } }
.ptl-booking .bk-done__quand { margin: 2px 0 14px; font-size: 16.5px; font-weight: 700; color: var(--bk-ink); }
.ptl-booking .bk-done__quand:first-letter { text-transform: uppercase; }
.ptl-booking .bk-expert { display: inline-flex; align-items: center; gap: 12px; margin: 0 0 18px; padding: 10px 16px 10px 10px; border-radius: 999px; background: var(--bk-soft); text-align: left; font-size: 14px; }
.ptl-booking .bk-expert em { font-style: normal; color: var(--bk-muted); font-size: 12.5px; }
.ptl-booking .bk-avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--bk-accent); color: var(--bk-accent-ink); font-weight: 700; font-size: 17px; }
.ptl-booking .bk-done__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 16px; }
.ptl-booking .bk-done .bk-legal { justify-content: center; text-align: center; }

@media (prefers-reduced-motion: reduce) {
	.ptl-booking *, .ptl-booking *::before, .ptl-booking *::after { animation: none !important; transition: none !important; }
	.ptl-booking .bk-done__ico circle, .ptl-booking .bk-done__ico path { stroke-dashoffset: 0; }
}

/* Page autonome (?ptl_rdv=TOKEN) */
.ptl-booking-page { margin: 0; min-height: 100vh; display: grid; place-items: center; background: #f4f5f9; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; padding: 24px; }
.bk-standalone { width: 100%; max-width: 720px; }
.bk-standalone .bk-brand { text-align: center; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; font-size: 13px; color: #6a6f80; margin: 0 0 14px; }
