/* IWA Prise de rendez-vous — v2.0.0 */
.iwa-rdv {
	--iwa-primary: #6600FF;
	--iwa-primary-dark: #5200CC;
	--iwa-accent: #C851D1;
	--iwa-tint: #F4EEFF;
	--iwa-tint-strong: #E5D9FF;
	--iwa-ink: #171827;
	--iwa-muted: #5B5E72;
	--iwa-faint: #A9AABA;
	--iwa-line: #E7E3F5;
	--iwa-field: #D9D4EA;
	--iwa-surface: #FFFFFF;
	--iwa-bg: #FAF9FE;
	--iwa-ok: #0F7B4F;
	--iwa-err: #B42318;
	--iwa-r: 18px;
	--iwa-r-sm: 10px;

	max-width: 1120px;
	margin: 48px auto;
	padding: 0 20px;
	color: var(--iwa-ink);
	font-family: inherit;
	line-height: 1.5;
	container: iwardv / inline-size;
}
.iwa-rdv *, .iwa-rdv *::before, .iwa-rdv *::after { box-sizing: border-box; }
.iwa-rdv [hidden] { display: none !important; }

/* Neutralise les styles de boutons/champs imposés par les thèmes */
.iwa-rdv button, .iwa-rdv input, .iwa-rdv select, .iwa-rdv textarea {
	font: inherit; letter-spacing: normal; text-transform: none; margin: 0; box-shadow: none;
}
.iwa-rdv button { line-height: 1.2; min-height: 0; text-shadow: none; }

/* ---------- En-tête ---------- */
.iwa-rdv__head { margin-bottom: 28px; max-width: 780px; }
.iwa-rdv__eyebrow {
	margin: 0 0 10px; font-size: .8rem; font-weight: 700; letter-spacing: .08em;
	text-transform: uppercase; color: var(--iwa-primary);
}
.iwa-rdv .iwa-rdv__title {
	margin: 0 0 12px; font-size: clamp(1.75rem, 3vw, 2.4rem); line-height: 1.15;
	font-weight: 800; color: var(--iwa-ink); letter-spacing: -.01em;
}
.iwa-rdv__lead { margin: 0 0 18px; color: var(--iwa-muted); font-size: 1.05rem; }
.iwa-rdv__facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.iwa-rdv__facts li {
	display: inline-flex; align-items: center; gap: 8px; margin: 0;
	padding: 6px 14px; border-radius: 999px; background: var(--iwa-tint);
	color: var(--iwa-primary-dark); font-size: .9rem; font-weight: 600;
}
.iwa-rdv__facts li::before {
	content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--iwa-accent);
}

/* ---------- Panneau ---------- */
.iwa-rdv__panel {
	display: grid; grid-template-columns: minmax(0, 1fr);
	background: var(--iwa-surface); border: 1px solid var(--iwa-line); border-radius: var(--iwa-r);
	box-shadow: 0 1px 2px rgba(23, 24, 39, .04), 0 16px 40px rgba(102, 0, 255, .07);
	overflow: hidden;
}
.iwa-rdv__col { padding: 28px; min-width: 0; }
.iwa-rdv__col--pick { background: var(--iwa-bg); border-bottom: 1px solid var(--iwa-line); }
.iwa-rdv__col--form { container: iwaform / inline-size; }

.iwa-rdv .iwa-rdv__step {
	display: flex; align-items: center; gap: 10px; margin: 0 0 16px;
	font-size: 1.05rem; font-weight: 700; line-height: 1.3; color: var(--iwa-ink);
}
.iwa-rdv__step span {
	flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
	background: var(--iwa-primary); color: #fff; font-size: .85rem; font-weight: 700;
}
.iwa-rdv .iwa-rdv__step--slots { margin-top: 28px; }

/* ---------- Calendrier ---------- */
.iwa-rdv__cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.iwa-rdv__month { margin: 0; font-weight: 700; font-size: 1rem; }
.iwa-rdv .iwa-rdv__nav {
	display: grid; place-items: center; width: 38px; height: 38px; padding: 0;
	border: 1px solid var(--iwa-line); border-radius: var(--iwa-r-sm);
	background: var(--iwa-surface); color: var(--iwa-ink); cursor: pointer; transition: .15s ease;
}
.iwa-rdv .iwa-rdv__nav:hover:not(:disabled) { border-color: var(--iwa-primary); color: var(--iwa-primary); background: var(--iwa-surface); }
.iwa-rdv .iwa-rdv__nav:disabled { opacity: .35; cursor: default; }

.iwa-rdv__weekdays, .iwa-rdv__days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.iwa-rdv__weekdays { margin-bottom: 6px; }
.iwa-rdv__weekdays span {
	text-align: center; font-size: .75rem; font-weight: 700; text-transform: uppercase;
	letter-spacing: .04em; color: var(--iwa-muted);
}
.iwa-rdv .iwa-rdv__day {
	position: relative; height: 42px; padding: 0; border: 1px solid var(--iwa-line);
	border-radius: var(--iwa-r-sm); background: var(--iwa-surface); color: var(--iwa-ink);
	font-size: .95rem; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; transition: .15s ease;
}
.iwa-rdv .iwa-rdv__day:hover:not(:disabled) { border-color: var(--iwa-primary); color: var(--iwa-primary); background: var(--iwa-tint); }
.iwa-rdv .iwa-rdv__day:disabled {
	background: transparent; border-color: transparent; color: var(--iwa-faint);
	font-weight: 400; cursor: default;
}
.iwa-rdv .iwa-rdv__day.is-empty { border: 0; background: none; }
.iwa-rdv .iwa-rdv__day.is-today::after {
	content: ""; position: absolute; left: 50%; bottom: 5px; width: 4px; height: 4px;
	margin-left: -2px; border-radius: 50%; background: var(--iwa-accent);
}
.iwa-rdv .iwa-rdv__day.is-selected,
.iwa-rdv .iwa-rdv__day.is-selected:hover {
	background: var(--iwa-primary); border-color: var(--iwa-primary); color: #fff;
}
.iwa-rdv .iwa-rdv__day.is-selected::after { background: #fff; }

/* ---------- Créneaux ---------- */
.iwa-rdv__group + .iwa-rdv__group { margin-top: 16px; }
.iwa-rdv__group-label {
	margin: 0 0 8px; font-size: .75rem; font-weight: 700; letter-spacing: .06em;
	text-transform: uppercase; color: var(--iwa-muted);
}
.iwa-rdv__slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.iwa-rdv .iwa-rdv__slot {
	height: 42px; padding: 0 6px; border: 1px solid var(--iwa-line); border-radius: var(--iwa-r-sm);
	background: var(--iwa-surface); color: var(--iwa-ink); font-size: .95rem; font-weight: 600;
	font-variant-numeric: tabular-nums; cursor: pointer; transition: .15s ease;
}
.iwa-rdv .iwa-rdv__slot:hover:not(:disabled) { border-color: var(--iwa-primary); color: var(--iwa-primary); background: var(--iwa-tint); }
.iwa-rdv .iwa-rdv__slot.is-selected,
.iwa-rdv .iwa-rdv__slot.is-selected:hover { background: var(--iwa-primary); border-color: var(--iwa-primary); color: #fff; }
.iwa-rdv .iwa-rdv__slot.is-taken {
	background: transparent; border-style: dashed; color: var(--iwa-faint);
	text-decoration: line-through; font-weight: 400; cursor: not-allowed;
}
.iwa-rdv__hint {
	margin: 0; padding: 18px; border: 1px dashed var(--iwa-field); border-radius: var(--iwa-r-sm);
	text-align: center; color: var(--iwa-muted); font-size: .95rem;
}
.iwa-rdv__skeleton { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.iwa-rdv__skeleton span {
	height: 42px; border-radius: var(--iwa-r-sm);
	background: linear-gradient(90deg, var(--iwa-line) 0%, #F3F1FA 50%, var(--iwa-line) 100%);
	background-size: 200% 100%; animation: iwa-rdv-shimmer 1.2s linear infinite;
}
@keyframes iwa-rdv-shimmer { to { background-position: -200% 0; } }

/* ---------- Récapitulatif ---------- */
.iwa-rdv__summary {
	display: flex; align-items: center; gap: 12px; margin-bottom: 20px; padding: 14px 16px;
	border: 1px solid var(--iwa-line); border-radius: 12px; background: var(--iwa-bg);
	color: var(--iwa-muted); font-size: .95rem;
}
.iwa-rdv__summary svg { flex: none; color: var(--iwa-faint); }
.iwa-rdv__summary.is-set { background: var(--iwa-tint); border-color: var(--iwa-tint-strong); color: var(--iwa-primary-dark); font-weight: 700; }
.iwa-rdv__summary.is-set svg { color: var(--iwa-primary); }

/* ---------- Formulaire ---------- */
.iwa-rdv__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; }
.iwa-rdv__field { display: flex; flex-direction: column; margin-bottom: 16px; min-width: 0; }
.iwa-rdv__field label { margin-bottom: 6px; font-size: .9rem; font-weight: 600; color: var(--iwa-ink); }
.iwa-rdv__opt { font-weight: 400; color: var(--iwa-muted); }
.iwa-rdv .iwa-rdv__field input,
.iwa-rdv .iwa-rdv__field select,
.iwa-rdv .iwa-rdv__field textarea {
	width: 100%; max-width: 100%; height: 46px; padding: 0 14px;
	border: 1px solid var(--iwa-field); border-radius: var(--iwa-r-sm);
	background: var(--iwa-surface); color: var(--iwa-ink); font-size: 1rem;
	outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
.iwa-rdv .iwa-rdv__field textarea { height: auto; min-height: 112px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.iwa-rdv .iwa-rdv__field select {
	appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='18' height='18'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%235B5E72' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat; background-position: right 14px center;
}
.iwa-rdv .iwa-rdv__field input:focus,
.iwa-rdv .iwa-rdv__field select:focus,
.iwa-rdv .iwa-rdv__field textarea:focus { border-color: var(--iwa-primary); box-shadow: 0 0 0 4px rgba(102, 0, 255, .12); }
.iwa-rdv [aria-invalid="true"] { border-color: var(--iwa-err) !important; }

.iwa-rdv__consent { display: flex; align-items: flex-start; gap: 10px; font-size: .88rem; color: var(--iwa-muted); }
.iwa-rdv__consent input { flex: none; width: 18px; height: 18px; margin-top: 2px; accent-color: var(--iwa-primary); cursor: pointer; }
.iwa-rdv__consent a { color: var(--iwa-primary); }

.iwa-rdv__err { margin: 6px 0 0; font-size: .85rem; color: var(--iwa-err); }
.iwa-rdv__err:empty { display: none; }

.iwa-rdv__feedback {
	display: none; margin-top: 16px; padding: 12px 14px; border: 1px solid #FECDCA;
	border-radius: var(--iwa-r-sm); background: #FEF3F2; color: var(--iwa-err); font-size: .92rem;
}
.iwa-rdv__feedback.is-visible { display: block; }

.iwa-rdv .iwa-rdv__submit {
	display: inline-flex; align-items: center; justify-content: center; gap: 10px;
	width: 100%; height: 54px; margin-top: 20px; padding: 0 20px; border: 0; border-radius: 12px;
	background: var(--iwa-primary); color: #fff; font-size: 1rem; font-weight: 700;
	cursor: pointer; transition: background .15s ease, transform .15s ease;
}
.iwa-rdv .iwa-rdv__submit:hover:not(:disabled) { background: var(--iwa-primary-dark); color: #fff; transform: translateY(-1px); }
.iwa-rdv .iwa-rdv__submit:disabled { opacity: .75; cursor: progress; }
.iwa-rdv .iwa-rdv__submit.is-busy::before {
	content: ""; width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .45);
	border-top-color: #fff; border-radius: 50%; animation: iwa-rdv-spin .7s linear infinite;
}
@keyframes iwa-rdv-spin { to { transform: rotate(360deg); } }
.iwa-rdv__note { margin: 10px 0 0; text-align: center; font-size: .85rem; color: var(--iwa-muted); }

.iwa-rdv__hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Confirmation ---------- */
.iwa-rdv__success {
	padding: 56px 24px; text-align: center; background: var(--iwa-surface);
	border: 1px solid var(--iwa-line); border-radius: var(--iwa-r);
	box-shadow: 0 16px 40px rgba(102, 0, 255, .07);
}
.iwa-rdv__success-icon {
	display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 18px;
	border-radius: 50%; background: #E7F6EE; color: var(--iwa-ok);
}
.iwa-rdv .iwa-rdv__success-title { margin: 0 0 10px; font-size: 1.5rem; font-weight: 800; color: var(--iwa-ink); outline: none; }
.iwa-rdv__success-text { max-width: 520px; margin: 0 auto 24px; color: var(--iwa-muted); }
.iwa-rdv .iwa-rdv__ghost {
	height: 46px; padding: 0 20px; border: 1px solid var(--iwa-field); border-radius: 12px;
	background: var(--iwa-surface); color: var(--iwa-ink); font-weight: 600; cursor: pointer;
}
.iwa-rdv .iwa-rdv__ghost:hover { border-color: var(--iwa-primary); color: var(--iwa-primary); background: var(--iwa-surface); }

/* ---------- Accessibilité ---------- */
.iwa-rdv button:focus-visible,
.iwa-rdv input[type="checkbox"]:focus-visible { outline: 2px solid var(--iwa-primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
	.iwa-rdv *, .iwa-rdv *::before, .iwa-rdv *::after { animation: none !important; transition: none !important; }
}

/* ---------- Responsive : basé sur la largeur réelle du bloc (container queries) ---------- */
@container iwardv (min-width: 860px) {
	.iwa-rdv__panel { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
	.iwa-rdv__col--pick { border-bottom: 0; border-right: 1px solid var(--iwa-line); }
}
@container iwaform (min-width: 440px) {
	.iwa-rdv__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container iwardv (max-width: 520px) {
	.iwa-rdv__col { padding: 20px 16px; }
	.iwa-rdv__weekdays, .iwa-rdv__days { gap: 4px; }
	.iwa-rdv .iwa-rdv__day { height: 40px; }
}
@media (max-width: 560px) {
	.iwa-rdv { margin: 32px auto; padding: 0 16px; }
}
