/* Rendly — calendrier de réservation. Couleur reprise du thème (preset primary) si elle existe. */
.rendly {
    --rendly-accent: var(--wp--preset--color--primary, var(--wp--preset--color--contrast, #1e3a8a));
    --rendly-on-accent: #fff;
    --rendly-border: color-mix(in srgb, currentColor 18%, transparent);
    --rendly-soft: color-mix(in srgb, var(--rendly-accent) 9%, transparent);
    --rendly-muted: color-mix(in srgb, currentColor 68%, transparent);
    --rendly-radius: 8px;
    --rendly-danger: #b42318;
    max-width: 760px;
    margin-inline: auto;
    font-size: 1rem;
    line-height: 1.5;
}
.rendly *, .rendly *::before, .rendly *::after { box-sizing: border-box; }
.rendly-card { border: 1px solid var(--rendly-border); border-radius: var(--rendly-radius); padding: clamp(16px, 4vw, 28px); background: var(--wp--preset--color--base, #fff); color: inherit; }
.rendly-title { margin: 0 0 4px; font-size: 1.35em; line-height: 1.25; }
.rendly-title:focus { outline: none; }
.rendly-meta, .rendly-tz { margin: 0; color: var(--rendly-muted); font-size: .9em; }
.rendly-desc { margin: 8px 0 0; }
.rendly-tz { margin-top: 16px; }
.rendly-head { padding-left: 14px; border-left: 4px solid var(--rendly-type, var(--rendly-accent)); margin-bottom: 20px; }
.rendly-when { margin: 4px 0 0; font-weight: 600; }
.is-cancelled { text-decoration: line-through; opacity: .75; }
.rendly-loading { color: var(--rendly-muted); }
.rendly-sr, .rendly-trap { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rendly-trap { left: -9999px; }

/* Types */
.rendly-types { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.rendly-type { display: grid; gap: 2px; width: 100%; text-align: left; padding: 14px 16px; border: 1px solid var(--rendly-border); border-left: 4px solid var(--rendly-type, var(--rendly-accent)); border-radius: var(--rendly-radius); background: transparent; color: inherit; font: inherit; cursor: pointer; }
.rendly-type:hover { background: var(--rendly-soft); }
.rendly-type__desc { font-size: .92em; }

/* Calendrier */
.rendly-cal { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 640px) { .rendly-cal { grid-template-columns: 1fr; } }
.rendly-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.rendly-nav__month { font-size: 1.05em; }
.rendly-nav__btn { width: 40px; height: 40px; border: 1px solid var(--rendly-border); border-radius: 50%; background: transparent; color: inherit; font-size: 1.3em; line-height: 1; cursor: pointer; }
.rendly-nav__btn:disabled { opacity: .35; cursor: default; }
.rendly-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.rendly-dow { text-align: center; font-size: .78em; color: var(--rendly-muted); padding: 4px 0; }
.rendly-day { aspect-ratio: 1; min-height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--rendly-muted); font: inherit; font-size: .95em; cursor: default; }
.rendly-day.is-open { background: var(--rendly-soft); color: inherit; font-weight: 700; cursor: pointer; }
.rendly-day.is-open:hover { outline: 2px solid var(--rendly-accent); outline-offset: -2px; }
.rendly-day.is-selected { background: var(--rendly-accent); color: var(--rendly-on-accent); }
.rendly-day.is-today { text-decoration: underline; text-underline-offset: 3px; }
.rendly-slots h3 { margin: 0 0 10px; font-size: 1em; }
.rendly-slots ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; max-height: 340px; overflow: auto; }
.rendly-slots--empty p { margin: 0; color: var(--rendly-muted); }
.rendly-slot { width: 100%; padding: 10px 6px; border: 1px solid var(--rendly-accent); border-radius: var(--rendly-radius); background: transparent; color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
.rendly-slot:hover { background: var(--rendly-accent); color: var(--rendly-on-accent); }

/* Formulaire */
.rendly-form { display: grid; gap: 4px; }
.rendly-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .rendly-row { grid-template-columns: 1fr; } }
.rendly-field { margin: 0 0 10px; }
.rendly-field label { display: block; font-weight: 600; margin-bottom: 4px; }
.rendly-field input[type=text], .rendly-field input[type=email], .rendly-field input[type=tel], .rendly-field textarea { width: 100%; padding: .65em .8em; font: inherit; color: inherit; background: transparent; border: 1px solid var(--rendly-border); border-radius: calc(var(--rendly-radius) - 2px); }
.rendly-field input:focus, .rendly-field textarea:focus { border-color: var(--rendly-accent); outline: 2px solid color-mix(in srgb, var(--rendly-accent) 30%, transparent); }
.rendly-consent label { font-weight: 400; display: flex; gap: 8px; align-items: flex-start; }
.rendly-consent input { margin-top: .3em; }
.has-error input, .has-error textarea { border-color: var(--rendly-danger); }
.rendly-err { display: block; color: var(--rendly-danger); font-size: .9em; margin-top: 4px; }
.rendly-req { color: var(--rendly-danger); }
.rendly-alert, .rendly-notice { padding: .7em 1em; border-radius: calc(var(--rendly-radius) - 2px); border-left: 4px solid var(--rendly-danger); background: color-mix(in srgb, var(--rendly-danger) 8%, transparent); margin: 0 0 12px; }
.rendly-notice { border-color: #067647; background: color-mix(in srgb, #067647 8%, transparent); margin-top: 12px; }

/* Boutons */
.rendly-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 18px 0 0; }
.rendly-btn { display: inline-block; padding: .7em 1.1em; border: 1px solid var(--rendly-accent); border-radius: var(--rendly-radius); background: transparent; color: inherit; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.rendly-btn--primary { background: var(--rendly-accent); color: var(--rendly-on-accent); }
.rendly-btn--danger { border-color: var(--rendly-danger); color: var(--rendly-danger); }
.rendly-btn:disabled { opacity: .6; cursor: wait; }
.rendly-link { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; margin-bottom: 6px; }
.rendly .rendly-btn:focus-visible, .rendly .rendly-link:focus-visible, .rendly-day:focus-visible, .rendly-slot:focus-visible, .rendly-type:focus-visible, .rendly-nav__btn:focus-visible { outline: 3px solid var(--rendly-accent); outline-offset: 2px; }

.rendly-done { text-align: center; }
.rendly-done .rendly-actions { justify-content: center; }
.rendly-check { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 50%; background: #067647; color: #fff; font-size: 1.6em; }

@media (prefers-reduced-motion: no-preference) {
    .rendly-day, .rendly-slot, .rendly-type { transition: background-color .15s, color .15s; }
}
