/* AgendaPro 1.1.0 — calendrier public */

.agendapro {
	--bg: #FBFAFC; --surface: #FFFFFF; --ink: #1D1620; --muted: #5E5563; --line: #E6E0E9;
	--accent: #7E2A90; --accent-ink: #FFFFFF; --accent-soft: #F3E8F6; --accent-text: #7E2A90;
	--off: #F1EEF2; --off-ink: #6E6574; --today-bg: #F8F0FA;
	--serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
	--sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
	min-height: 100vh;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 15px;
	line-height: 1.45;
	text-align: left;
}
.agendapro.ap-dark {
	--bg: #121212; --surface: #1C1C1C; --ink: #EDEDED; --muted: #A8A8A8; --line: #2E2E2E;
	--accent: #7E2A90; --accent-ink: #FFFFFF; --accent-soft: #2A2A2A; --accent-text: #F2F2F2;
	--off: #171717; --off-ink: #8A8A8A; --today-bg: #231B25;
}
.agendapro *, .agendapro *::before, .agendapro *::after { box-sizing: border-box; }
.agendapro h1, .agendapro h2, .agendapro p, .agendapro ul, .agendapro ol { margin: 0; padding: 0; }
.agendapro ol, .agendapro .ap-steps { padding-left: 20px; }
.agendapro button, .agendapro input, .agendapro select, .agendapro textarea {
	font: inherit; color: inherit; letter-spacing: normal; text-transform: none; box-shadow: none; margin: 0;
}
.agendapro button { -webkit-appearance: none; appearance: none; line-height: 1.2; }
.agendapro a { color: var(--accent-text); }
.agendapro button:focus-visible, .agendapro input:focus-visible, .agendapro select:focus-visible,
.agendapro textarea:focus-visible, .agendapro a:focus-visible, .agendapro summary:focus-visible {
	outline: 2px solid var(--accent-text); outline-offset: 2px;
}
.agendapro [hidden] { display: none !important; }
.agendapro .ap-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* En-tête */
.ap-head { border-bottom: 1px solid var(--line); background: var(--surface); }
.ap-head-in, .ap-main { max-width: 1360px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.ap-head-in { padding-top: 14px; padding-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ap-brand { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.ap-title { font-family: var(--serif); font-size: 26px; font-weight: 600; color: var(--accent-text); }
.ap-sub { font-size: 14px; color: var(--muted); }

.ap-main { padding-top: 24px; padding-bottom: 48px; display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.ap-cal { flex: 999 1 640px; min-width: 0; }
.ap-panel { flex: 1 1 360px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px; position: sticky; top: 24px; }

/* Boutons */
.ap-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; flex: none; color: var(--ink); }
.ap-icon:hover { border-color: var(--accent-text); color: var(--accent-text); }
.ap-icon svg { width: 20px; height: 20px; }
.ap-icon.ap-sm svg { width: 16px; height: 16px; }
.ap-btn { min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.ap-btn:hover { border-color: var(--accent-text); }
.ap-btn.ap-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.ap-btn.ap-block { width: 100%; }
.ap-btn[disabled] { opacity: .6; cursor: progress; }

/* Barre d'outils */
.ap-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.ap-toolbar-g { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ap-month { min-width: 210px; text-align: center; font-family: var(--serif); font-size: 30px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.ap-seg { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.ap-seg button { min-height: 40px; padding: 0 18px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; color: var(--muted); }
.ap-seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }

.ap-legend { display: flex; gap: 8px 22px; flex-wrap: wrap; align-items: center; font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.ap-legend span { display: inline-flex; align-items: center; gap: 8px; }
.ap-sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.ap-sw-free { background: var(--accent-soft); border: 1px solid var(--accent-text); }
.ap-sw-sel { background: var(--accent); border: 1px solid var(--accent); }
.ap-sw-off { background: var(--off); border: 1px solid var(--line); }
.ap-hint { font-size: 13px; line-height: 1.45; color: var(--muted); }
.ap-cal > .ap-hint { margin-bottom: 16px; }

/* Grille du mois */
.ap-grid-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.ap-grid { min-width: 760px; }
.ap-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.ap-row:last-child { border-bottom: 0; }
.ap-dow { padding: 12px 14px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.ap-day { padding: 10px; min-height: 168px; border-right: 1px solid var(--line); }
.ap-day:last-child { border-right: 0; }
.ap-day.ap-out { background: var(--bg); }
.ap-num { font-family: var(--serif); font-size: 18px; font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.ap-day.ap-out .ap-num { color: var(--off-ink); }
.ap-day.ap-today { background: var(--today-bg); box-shadow: inset 0 0 0 2px var(--accent); }
.ap-n { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; }
.ap-day.ap-today .ap-n { padding: 0 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }
.ap-day.ap-today .ap-today-tag { color: var(--accent-text); }
.ap-today-tag { font-family: var(--sans); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.ap-slots { display: flex; flex-direction: column; gap: 6px; }
.ap-slot { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; min-height: 44px; padding: 6px 10px; border-radius: 10px; border: 1px solid transparent; text-align: left; cursor: pointer; }
.ap-slot .ap-sl { font-size: 13px; font-weight: 600; }
.ap-slot .ap-st { font-size: 12px; }
.ap-slot.ap-free { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent-soft); }
.ap-slot.ap-free:hover { border-color: var(--accent-text); }
.ap-slot.ap-sel { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.ap-slot.ap-off { background: var(--off); color: var(--off-ink); cursor: default; opacity: .5; }
.ap-slot.ap-off .ap-sl { text-decoration: line-through; }
.ap-loading .ap-grid-wrap, .ap-loading .ap-list { opacity: .55; }

/* Liste */
.ap-list { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.ap-list-head { padding: 14px 20px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.ap-li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; width: 100%; padding: 14px 20px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; min-height: 56px; color: var(--ink); }
.ap-li:last-child { border-bottom: 0; }
.ap-li:hover { background: var(--accent-soft); }
.ap-li[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.ap-li .ap-ld { font-weight: 600; min-width: 220px; }
.ap-li .ap-lt { color: var(--muted); }
.ap-li[aria-pressed="true"] .ap-lt, .ap-li[aria-pressed="true"] .ap-cta { color: var(--accent-ink); }
.ap-cta { margin-left: auto; font-weight: 600; color: var(--accent-text); }
.ap-empty { padding: 20px; color: var(--muted); }

/* Panneau */
.ap-panel-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.ap-h2 { font-family: var(--serif); font-size: 24px; font-weight: 600; color: var(--ink); }
.ap-chosen { padding: 14px 16px; border-radius: 10px; border: 1px solid var(--accent-text); margin-bottom: 18px; }
.ap-chosen-t { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent-text); margin-bottom: 8px; }
.ap-sel-list { list-style: none; display: flex; flex-direction: column; gap: 6px; padding: 0; }
.ap-sel-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: 600; }
.ap-note { font-size: 13px; line-height: 1.45; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--ink); }
.ap-error { font-size: 14px; line-height: 1.45; padding: 12px 14px; border-radius: 10px; border: 1.5px solid var(--ink); background: var(--surface); color: var(--ink); }
.ap-banner { margin-bottom: 16px; font-size: 15px; line-height: 1.5; padding: 16px 18px; border-radius: 10px; display: flex; align-items: center; gap: 14px; }
.ap-banner-soft { background: var(--accent-soft); color: var(--ink); font-size: 14px; }
/* Bandeau inversé : foncé en mode clair, clair en mode sombre. */
.ap-banner-inv { background: var(--ink); color: var(--bg); box-shadow: 0 6px 24px rgba(0, 0, 0, .18); }
.ap-banner-icon { flex: none; width: 36px; height: 36px; border-radius: 999px; background: var(--accent); color: #FFFFFF; display: inline-flex; align-items: center; justify-content: center; }
.ap-banner-icon svg { width: 20px; height: 20px; }
.ap-banner-txt { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; }
.ap-banner-txt strong { font-family: var(--serif); font-size: 19px; font-weight: 600; }
.ap-banner-x { flex: none; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 999px; background: transparent; color: inherit; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; opacity: .8; }
.ap-banner-x:hover { opacity: 1; }
.ap-banner-x svg { width: 18px; height: 18px; }
.ap-banner-inv .ap-banner-x:focus-visible { outline-color: var(--bg); }
.ap-form { display: flex; flex-direction: column; gap: 16px; }
.ap-pair { display: flex; flex-wrap: wrap; gap: 14px; }
.ap-field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; flex: 1 1 200px; min-width: 0; }
.ap-field input, .ap-field select, .ap-field textarea { font-size: 16px; font-weight: 400; min-height: 44px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); width: 100%; }
.ap-field textarea { min-height: 96px; resize: vertical; }
.ap-opt { font-weight: 400; color: var(--muted); }
.agendapro fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.agendapro legend { font-size: 14px; font-weight: 500; padding: 0; margin-bottom: 8px; color: var(--ink); }
.ap-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.ap-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; cursor: pointer; }
.ap-pill input { accent-color: var(--accent); margin: 0; width: 18px; height: 18px; }
.ap-pill.ap-disabled { background: var(--off); color: var(--off-ink); border-style: dashed; cursor: not-allowed; }
.ap-pill.ap-disabled input { cursor: not-allowed; }
.ap-legal { font-size: 13px; line-height: 1.5; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 10px; }
.ap-legal summary { cursor: pointer; font-weight: 600; min-height: 28px; display: list-item; }
.ap-legal ul { margin: 8px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; color: var(--muted); }
.ap-check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.45; cursor: pointer; }
.ap-check input { width: 20px; height: 20px; accent-color: var(--accent); margin: 1px 0 0; flex: none; }
.ap-ts { min-height: 65px; }
.ap-ts-msg:empty { display: none; }
.ap-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.ap-steps { display: flex; flex-direction: column; gap: 10px; font-size: 14px; line-height: 1.5; }
.ap-done { display: flex; flex-direction: column; gap: 16px; }
.ap-done-icon { width: 52px; height: 52px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); display: flex; align-items: center; justify-content: center; }
.ap-manage-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.ap-manage-row:last-child { border-bottom: 0; }
.ap-status { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }

/* Étapes du formulaire et détails facultatifs */
.ap-panel-h .ap-panel-tt { flex: 1 1 auto; min-width: 0; }
.ap-stepbox { display: flex; flex-direction: column; gap: 16px; }
.ap-form-foot { display: flex; flex-direction: column; gap: 12px; }
.ap-more { border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; }
.ap-more summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; list-style: none; }
.ap-more summary::-webkit-details-marker { display: none; }
.ap-more summary::before { content: '+'; font-weight: 600; width: 16px; }
.ap-more[open] summary::before { content: '−'; }
.ap-more-in { display: flex; flex-direction: column; gap: 14px; padding: 4px 0 14px; }
.ap-chip { min-height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 600; cursor: pointer; }
.ap-head-act { display: flex; align-items: center; gap: 8px; }
.ap-only-m { display: none !important; }
.ap-mbar { display: none; }

/* ---------- Téléphone ---------- */
@media (max-width: 699px) {
	.ap-only-m { display: inline-flex !important; }
	.ap-panel-h .ap-only-m.ap-step-sub { display: block !important; }
	.ap-progress.ap-only-m { display: block !important; }
	.ap-only-d { display: none !important; }
	.ap-head-in { padding: 10px 16px; }
	.ap-sub { display: none; }
	.ap-title { font-size: 22px; }
	.ap-main { padding: 14px 16px 140px; }
	.ap-month { min-width: 0; font-size: 22px; }

	.ap-mtool { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
	.ap-mtitle { text-align: center; }
	.ap-mtool .ap-icon[disabled] { opacity: .4; cursor: default; }
	.ap-strip { display: flex; gap: 6px; margin-bottom: 18px; }
	.ap-dpill { flex: 1 1 0; min-width: 0; min-height: 66px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; padding: 6px 0; }
	.ap-dpill .ap-dw { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
	.ap-dpill .ap-dn { font-family: var(--serif); font-size: 20px; font-weight: 600; line-height: 1; }
	.ap-dpill .ap-dot { width: 6px; height: 6px; border-radius: 999px; background: var(--accent); }
	.ap-dpill .ap-dot.ap-none { background: transparent; }
	.ap-dpill.ap-today { border: 2px solid var(--accent); }
	.ap-dpill.ap-empty { opacity: .5; }
	.ap-dpill.ap-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); opacity: 1; }
	.ap-dpill.ap-on .ap-dw { color: var(--accent-ink); }
	.ap-dpill.ap-on .ap-dot { background: var(--accent-ink); }
	.ap-mday-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
	.ap-mday-h .ap-h2 { font-size: 20px; }
	.ap-mslots { display: flex; flex-direction: column; gap: 12px; }
	.ap-mslot { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 76px; padding: 12px 18px; border-radius: 14px; border: 1px solid var(--accent-soft); background: var(--accent-soft); color: var(--accent-text); text-align: left; cursor: pointer; }
	.ap-mslot-t { display: flex; flex-direction: column; gap: 2px; }
	.ap-mslot .ap-sl { font-size: 17px; font-weight: 600; }
	.ap-mslot .ap-st { font-size: 14px; }
	.ap-mslot .ap-ck { width: 28px; height: 28px; border-radius: 999px; border: 2px solid currentColor; display: inline-flex; align-items: center; justify-content: center; flex: none; }
	.ap-mslot .ap-ck svg { width: 16px; height: 16px; }
	.ap-mslot.ap-sel { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
	.ap-mslot.ap-off { background: var(--off); border-color: var(--off); color: var(--off-ink); opacity: .5; cursor: default; }
	.ap-mslot.ap-off .ap-sl { text-decoration: line-through; }
	.ap-mhint { margin: 14px 0 10px; }

	/* Barre du bas (mode inversé) */
	.ap-mbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 99990; align-items: center; gap: 12px; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); background: var(--ink); color: var(--bg); border-radius: 20px 20px 0 0; box-shadow: 0 -8px 24px rgba(0, 0, 0, .18); }
	.ap-mbar-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
	.ap-mbar-txt strong { font-size: 16px; }
	.ap-mbar-txt span { font-size: 13px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
	.ap-mbar .ap-btn { min-height: 48px; flex: none; }

	/* Formulaire, confirmation et gestion en plein écran */
	.ap-panel.ap-sheet { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 100000; margin: 0; border: 0; border-radius: 0; background: var(--bg); overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 28px 20px calc(28px + env(safe-area-inset-bottom)); }
	.ap-panel.ap-sheet.ap-is-form { padding: 0; }
	.ap-sheet .ap-panel-top { position: sticky; top: 0; z-index: 2; background: var(--surface); border-bottom: 1px solid var(--line); }
	.ap-sheet .ap-panel-h { margin: 0; padding: 12px 16px; align-items: center; gap: 10px; }
	.ap-sheet .ap-step-title { font-size: 20px; }
	.ap-progress { height: 4px; background: var(--line); }
	.ap-progress span { display: block; height: 4px; width: 33%; background: var(--accent); transition: width .2s ease; }
	.ap-sheet .ap-chosen { margin: 16px 16px 0; }
	.ap-sheet .ap-form { padding: 18px 16px 0; gap: 18px; }
	.ap-sheet .ap-pills { flex-direction: column; }
	.ap-sheet .ap-pill { min-height: 52px; border-radius: 12px; font-size: 16px; }
	.ap-sheet .ap-field { font-size: 15px; }
	.ap-sheet .ap-field input, .ap-sheet .ap-field select, .ap-sheet .ap-field textarea { min-height: 50px; border-radius: 12px; background: var(--surface); }
	.ap-sheet .ap-field textarea { min-height: 120px; }
	.ap-sheet .ap-form-foot { position: sticky; bottom: 0; margin: 8px -16px 0; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
	.ap-sheet .ap-go { min-height: 52px; font-size: 16px; border-radius: 12px; }
	.ap-sheet .ap-done .ap-h2 { font-size: 28px; }
	.ap-sheet .ap-done-icon { width: 64px; height: 64px; background: var(--accent); color: #FFFFFF; }
	html.ap-lock, html.ap-lock body { overflow: hidden !important; }
}
