/*
 * Riwaq — base commune (admin, parcours, espaces élève et professeur).
 * Couleurs de la maison : vert nuit #111c18, or #bc9b6a, crème #faf6ef. Épuré : peu d'ombres, des
 * filets fins, des mouvements courts (moins de 300 ms) qui partent vite (ease-out).
 */
.riwaq-admin, .riwaq-booking, .riwaq-wizard, .rq-ui {
	--rq-ink: #111c18;
	--rq-ink-2: #2a3a33;
	--rq-gold: #bc9b6a;
	--rq-gold-d: #9c7d4f;
	--rq-soft: #faf6ef;
	--rq-soft-2: #f3ece0;
	--rq-line: #e6dfd3;
	--rq-muted: #6f6f6a;
	--rq-ok: #2e6b3a;
	--rq-ok-bg: #e9f3ec;
	--rq-warn: #9a6b0f;
	--rq-warn-bg: #fff4dc;
	--rq-ko: #a3302f;
	--rq-ko-bg: #fbeceb;
	--rq-radius: 10px;
	--rq-shadow: 0 1px 2px rgba(17, 28, 24, .06), 0 8px 24px rgba(17, 28, 24, .08);
	--rq-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
	--rq-ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
}

/* ---------------------------------------------------------------- Retour au toucher */
.riwaq-admin .button, .riwaq-booking .rq-btn, .riwaq-booking .rq-chip, .riwaq-booking .rq-slot,
.riwaq-wizard .rqw-btn, .riwaq-wizard .rqw-next, .riwaq-wizard .rqw-back, .riwaq-wizard .rqw-t, .riwaq-wizard .rqw-mode,
.riwaq-wizard .rqw-chip, .riwaq-wizard .rqw-d, .rq-ui .rq-btn {
	transition: transform 160ms var(--rq-ease-out), background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}
.riwaq-admin .button:active, .riwaq-booking .rq-btn:active, .riwaq-booking .rq-chip:active, .riwaq-booking .rq-slot:active,
.riwaq-wizard .rqw-btn:active, .riwaq-wizard .rqw-next:active, .riwaq-wizard .rqw-back:active, .riwaq-wizard .rqw-t:active,
.riwaq-wizard .rqw-mode:active, .riwaq-wizard .rqw-chip:active, .riwaq-wizard .rqw-d:active, .rq-ui .rq-btn:active {
	transform: scale(0.97);
}
.riwaq-booking :focus-visible, .riwaq-wizard :focus-visible, .rq-ui :focus-visible {
	outline: 2px solid var(--rq-gold);
	outline-offset: 2px;
}
@media (hover: hover) and (pointer: fine) {
	.riwaq-booking .rq-slot:hover, .riwaq-booking .rq-chip:hover { border-color: var(--rq-ink); }
}

/* ---------------------------------------------------------------- Boutons de l'admin aux couleurs Riwaq */
.riwaq-admin .button-primary, .rq-ui .button-primary {
	background: var(--rq-ink); border-color: var(--rq-ink); color: #fff;
}
.riwaq-admin .button-primary:hover, .riwaq-admin .button-primary:focus, .rq-ui .button-primary:hover {
	background: var(--rq-ink-2); border-color: var(--rq-ink-2); color: #fff;
}
.riwaq-admin .page-title-action { border-color: var(--rq-gold); color: var(--rq-ink); background: var(--rq-soft); border-radius: 6px; }
.riwaq-admin .page-title-action:hover { border-color: var(--rq-ink); background: #fff; color: var(--rq-ink); }

/* ---------------------------------------------------------------- Pastilles de statut */
.rq-st { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 999px; font-size: 12px; line-height: 1.6; background: var(--rq-soft-2); color: var(--rq-ink); white-space: nowrap; }
.rq-st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.rq-st.is-confirmed { background: var(--rq-ok-bg); color: var(--rq-ok); }
.rq-st.is-booked { background: var(--rq-warn-bg); color: var(--rq-warn); }
.rq-st.is-done { background: #eef0ef; color: #4a524e; }
.rq-st.is-cancelled, .rq-st.is-late_cancel, .rq-st.is-no_show, .rq-st.is-teacher_absent { background: var(--rq-ko-bg); color: var(--rq-ko); }

/* ---------------------------------------------------------------- Panneau latéral */
.rq-backdrop {
	position: fixed; inset: 0; z-index: 100000; background: rgba(17, 28, 24, .32);
	opacity: 0; transition: opacity 200ms ease; pointer-events: none;
}
.rq-backdrop.is-open { opacity: 1; pointer-events: auto; }
.rq-drawer {
	position: fixed; top: 0; right: 0; bottom: 0; z-index: 100001; width: min(440px, 100vw);
	background: #fff; box-shadow: -12px 0 40px rgba(17, 28, 24, .14); display: flex; flex-direction: column;
	transform: translateX(100%); transition: transform 280ms var(--rq-ease-drawer); visibility: hidden;
	color: var(--rq-ink); font-size: 14px;
}
.rq-drawer.is-open { transform: translateX(0); visibility: visible; }
.rq-drawer.is-closing { transition-duration: 200ms; }
.rq-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--rq-line); }
.rq-drawer-head h2 { margin: 0; font-size: 17px; line-height: 1.3; }
.rq-drawer-close { appearance: none; border: 0; background: transparent; font-size: 22px; line-height: 1; width: 34px; height: 34px; border-radius: 8px; cursor: pointer; color: var(--rq-muted); transition: background-color 160ms ease, transform 160ms var(--rq-ease-out); }
.rq-drawer-close:hover { background: var(--rq-soft); color: var(--rq-ink); }
.rq-drawer-close:active { transform: scale(0.94); }
.rq-drawer-body { padding: 16px 20px 28px; overflow-y: auto; flex: 1; }
.rq-drawer-body h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--rq-muted); margin: 20px 0 8px; font-weight: 600; }
.rq-drawer-body h3:first-child { margin-top: 0; }
.rq-drawer-body form { padding: 12px; border: 1px solid var(--rq-line); border-radius: 8px; margin: 0 0 10px; background: #fff; }
.rq-drawer-body form label { display: block; margin: 0 0 8px; }
.rq-drawer-body input[type=date], .rq-drawer-body input[type=time], .rq-drawer-body select, .rq-drawer-body input[type=text], .rq-drawer-body input:not([type]) { max-width: 100%; }
.rq-facts { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; margin: 0; }
.rq-facts dt { color: var(--rq-muted); }
.rq-facts dd { margin: 0; }
body.rq-locked { overflow: hidden; }

/* ---------------------------------------------------------------- Notifications */
.rq-toasts { position: fixed; z-index: 100002; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.rq-toast {
	pointer-events: auto; max-width: min(380px, calc(100vw - 40px)); padding: 11px 14px 11px 12px; border-radius: 10px;
	background: var(--rq-ink, #111c18); color: #fff; font-size: 14px; line-height: 1.4; box-shadow: 0 10px 30px rgba(17, 28, 24, .22);
	display: flex; gap: 10px; align-items: flex-start;
	opacity: 1; transform: translateY(0); transition: opacity 240ms ease, transform 240ms var(--rq-ease-out, ease-out);
}
@starting-style { .rq-toast { opacity: 0; transform: translateY(12px); } }
.rq-toast.is-leaving { opacity: 0; transform: translateY(6px); transition-duration: 160ms; }
.rq-toast::before { content: "✓"; color: #bc9b6a; font-weight: 700; }
.rq-toast.is-error { background: #7e2524; }
.rq-toast.is-error::before { content: "!"; color: #fff; }

/* ---------------------------------------------------------------- Chargement */
.rq-skel { display: block; border-radius: 6px; background: linear-gradient(90deg, #f1ece3 0%, #f8f4ed 50%, #f1ece3 100%); background-size: 200% 100%; animation: rq-shimmer 1.2s linear infinite; }
.rq-skel + .rq-skel { margin-top: 8px; }
@keyframes rq-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.rq-busy { opacity: .55; pointer-events: none; transition: opacity 160ms ease; }

/* ---------------------------------------------------------------- Mouvement réduit */
@media (prefers-reduced-motion: reduce) {
	.rq-drawer, .rq-toast { transition: opacity 160ms ease; transform: none !important; }
	.rq-drawer:not(.is-open) { opacity: 0; }
	.rq-skel { animation: none; }
	.riwaq-admin .button:active, .riwaq-booking .rq-btn:active, .riwaq-wizard .rqw-next:active, .rq-ui .rq-btn:active { transform: none; }
}

/* Fiches « Comment… » : capture, pastilles numérotées, étapes courtes. */
.rq-howto-grid { display: grid; gap: 14px; }
@media (min-width: 1000px) { .rq-howto-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.rq-howto-head { margin: 18px 2px 10px; font-size: 19px; }
.rq-howto { padding: 16px; }
.rq-howto h2, .rq-howto h3 { margin: 0 0 12px; font-size: 17px; }
.rq-howto-fig { position: relative; margin: 0 0 12px; border: 1px solid #e6dfd3; border-radius: 12px; overflow: hidden; background: #faf6ef; }
.rq-howto-fig img { display: block; width: 100%; height: auto; }
.rq-howto-n { display: inline-grid; place-items: center; width: 26px; height: 26px; font: 700 14px/1 Georgia, serif; color: #111c18; background: #bc9b6a; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 2px 6px rgba(17, 28, 24, .3); }
.rq-howto-fig .rq-howto-n { position: absolute; width: 22px; height: 22px; font-size: 12px; transform: translate(-78%, -62%); }
.rq-howto-n.is-inline { flex: none; box-shadow: none; border: 0; width: 24px; height: 24px; font-size: 13px; }
.rq-howto-steps { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.rq-howto-steps li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.45; }
.rq-howto-steps li > span { padding-top: 2px; }
.rq-howto-steps li.is-plain > i { flex: none; width: 24px; height: 24px; display: grid; place-items: center; }
.rq-howto-steps li.is-plain > i::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #bc9b6a; }

/* Aide : vignettes (image + titre), fiche ouverte (image à gauche, étapes à droite sur grand écran). */
.rq-tiles-h { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin: 0 0 18px; }
.rq-tile-h { display: grid; grid-template-rows: auto auto auto; gap: 4px; padding: 10px 10px 12px; color: inherit !important; text-decoration: none !important; background: #fff; border: 1px solid #e6dfd3; border-radius: 14px; transition: border-color .15s, box-shadow .15s, transform .15s; }
.rq-tile-h:hover { border-color: #bc9b6a; box-shadow: 0 6px 18px rgba(17, 28, 24, .08); transform: translateY(-1px); }
.rq-tile-img { position: relative; display: block; aspect-ratio: 16 / 10; margin: 0 0 6px; overflow: hidden; background: #faf6ef; border: 1px solid #efe7da; border-radius: 9px; }
.rq-tile-img img { position: absolute; display: block; max-width: none; height: auto; }
.rq-tile-h b { font-weight: 600; font-size: 15px; line-height: 1.3; color: #111c18; }
.rq-tile-h small { font-size: 12px; color: #6f6f6a; }
.rq-howto-body { display: grid; gap: 14px; }
@media (min-width: 900px) { .rq-howto-body { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; } .rq-howto-body .rq-howto-fig { margin: 0; } }
.rq-howto-fig { margin-left: auto; margin-right: auto; }
.rq-guides-all > summary { cursor: pointer; font-size: 15px; }
.rq-guides-all .rq-guide { padding: 12px 0 0; border-top: 1px solid #efe7da; margin-top: 12px; }
.rq-guides-all .rq-guide h3 { margin: 0 0 6px; font-size: 15px; }
@media (max-width: 600px) { .rq-tiles-h { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .rq-tile-h b { font-size: 13.5px; } }
.riwaq-booking .rq-tile-h, .rq-tiles-h .rq-tile-h { font: inherit; text-align: start; cursor: pointer; width: 100%; }
