/* Event booking form. Colours come only from theme tokens or currentColor, so
   the form composes with every design and with dark or light sections. Filled
   states use the button pair (--brass / --on-accent), already contrast-checked
   in every theme. */
.rik-eb {
  --eb-line: color-mix(in srgb, currentColor 16%, transparent);
  --eb-line-strong: color-mix(in srgb, currentColor 30%, transparent);
  --eb-soft: color-mix(in srgb, currentColor 4%, transparent);
  --eb-field: color-mix(in srgb, currentColor 6%, transparent);
  --eb-muted: color-mix(in srgb, currentColor 72%, transparent);
  --eb-accent: var(--brass);
  --eb-accent-soft: color-mix(in srgb, var(--brass) 14%, transparent);
  --eb-ring: color-mix(in srgb, var(--brass) 32%, transparent);
  --eb-on-accent: var(--on-accent);
  --eb-alert: var(--saffron);
  --eb-radius: min(var(--design-radius, var(--radius)), 10px); /* Pill button radii would distort fields. */
  --eb-panel-radius: calc(var(--eb-radius) + 6px);
  position: relative;
  container-type: inline-size; /* Lays out by the space it is given, not the viewport. */
  color-scheme: dark;
}
[data-scheme="light"] .rik-eb, .section--cream .rik-eb { color-scheme: light; }
/* Layout rules below set display; the hidden attribute must still win. */
.rik-eb [hidden] { display: none !important; }

/* ---------- Progress ---------- */
.rik-eb__progress {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem;
  margin: 0 0 clamp(1.25rem, 3vw, 2rem); padding: 0; list-style: none; counter-reset: none;
}
.rik-eb__progress li {
  position: relative; display: flex; align-items: center; gap: .6rem; min-width: 0;
  padding-top: .85rem; color: var(--eb-muted); font-size: .82rem; font-weight: 600; letter-spacing: .02em;
}
.rik-eb__progress li::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 3px; border-radius: 3px; background: var(--eb-line);
  transition: background-color .3s;
}
.rik-eb__progress li span {
  display: inline-grid; place-items: center; flex: none; width: 1.6rem; height: 1.6rem;
  border: 1px solid var(--eb-line-strong); border-radius: 50%; font-size: .74rem; transition: all .3s;
}
.rik-eb__progress li.is-current { color: inherit; }
.rik-eb__progress li.is-current::before { background: color-mix(in srgb, var(--brass) 55%, transparent); }
.rik-eb__progress li.is-current span { border-color: var(--eb-accent); color: inherit; }
.rik-eb__progress li.is-done { color: inherit; }
.rik-eb__progress li.is-done::before { background: var(--eb-accent); }
.rik-eb__progress li.is-done span { border-color: var(--eb-accent); background: var(--eb-accent); color: var(--eb-on-accent); font-size: 0; }
.rik-eb__progress li.is-done span::after { content: ""; width: .5rem; height: .28rem; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-1px) rotate(-45deg); }
@container (max-width: 520px) { .rik-eb__progress li { font-size: 0; gap: 0; } .rik-eb__progress li span { font-size: .74rem; } }

/* ---------- Layout ---------- */
.rik-eb__layout { display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); grid-template-columns: minmax(0, 1fr); }
@container (min-width: 760px) {
  .rik-eb__layout { grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); align-items: start; }
  .rik-eb__summary { position: sticky; top: calc(var(--header-h) + 1.5rem); }
}

/* The steps sit on one raised card, divided by hairlines. */
.rik-eb__steps {
  min-width: 0; padding: clamp(1.25rem, 3vw, 2.25rem) clamp(1.1rem, 3vw, 2.25rem);
  border: 1px solid var(--eb-line); border-radius: var(--eb-panel-radius); background: var(--eb-soft);
  box-shadow: 0 24px 60px -36px rgb(var(--shadow-rgb) / .5);
}
.rik-eb__step { min-width: 0; margin: 0; padding: clamp(1.5rem, 3vw, 2rem) 0; border: 0; border-top: 1px solid var(--eb-line); }
.rik-eb__step:first-child { padding-top: 0; border-top: 0; }
.rik-eb__step:last-child { padding-bottom: 0; }
.rik-eb__step legend { float: left; width: 100%; display: flex; align-items: center; gap: .85rem; margin: 0 0 .35rem; padding: 0; font-family: var(--font-display); font-size: clamp(1.35rem, 1.15rem + .8vw, 1.7rem); line-height: 1.2; }
.rik-eb__step legend + * { clear: both; }
.rik-eb__num { display: inline-grid; place-items: center; flex: none; width: 2rem; height: 2rem; border-radius: 50%; background: var(--eb-accent-soft); color: inherit; font: 700 .8rem/1 var(--font-body); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brass) 55%, transparent); }
.rik-eb .rik-eb__hint { margin: 0 0 1.25rem; padding-left: calc(2rem + .85rem); color: var(--eb-muted); font-size: .92rem; line-height: 1.5; max-width: none; }
@container (max-width: 520px) { .rik-eb .rik-eb__hint { padding-left: 0; } }

.rik-eb__row { display: grid; gap: 0 1.1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.rik-eb .rik-eb__field, .rik-eb .rik-eb__field:last-child { max-width: none; margin: 0 0 1.1rem; } /* Beats prose widths and the p:last-child reset. */
.rik-eb__field label, .rik-eb__label { display: block; margin: 0 0 .45rem; font-size: .9rem; font-weight: 600; letter-spacing: 0; text-transform: none; }
.rik-eb__optional { margin-left: .35rem; color: var(--eb-muted); font-size: .8rem; font-weight: 400; }
.rik-eb small { display: block; margin-top: .4rem; color: var(--eb-muted); font-size: .82rem; line-height: 1.45; }

.rik-eb input:not([type="radio"]):not([type="checkbox"]), .rik-eb select, .rik-eb textarea {
  display: block; width: 100%; min-height: 52px; padding: .8rem 1rem;
  border: 1px solid var(--eb-line-strong); border-radius: var(--eb-radius);
  background: var(--eb-field); color: inherit; font: inherit; font-size: 1rem; line-height: 1.4;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.rik-eb input::placeholder, .rik-eb textarea::placeholder { color: color-mix(in srgb, currentColor 45%, transparent); }
.rik-eb textarea { min-height: 7.5rem; resize: vertical; }
.rik-eb select { appearance: none; padding-right: 2.75rem; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 1.3rem) 50%, calc(100% - .95rem) 50%; background-size: .35rem .35rem; background-repeat: no-repeat; }
.rik-eb input:hover, .rik-eb select:hover, .rik-eb textarea:hover { border-color: color-mix(in srgb, currentColor 48%, transparent); }
.rik-eb input:focus-visible, .rik-eb select:focus-visible, .rik-eb textarea:focus-visible { outline: none; border-color: var(--eb-accent); box-shadow: 0 0 0 3px var(--eb-ring); }

/* ---------- Choice cards (sessions and packages) ---------- */
.rik-eb__choices { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 10.5rem), 1fr)); margin: 0 0 .25rem; }
.rik-eb__choices--packages { grid-template-columns: repeat(auto-fill, minmax(min(100%, 13.5rem), 1fr)); }
.rik-eb__choices > .rik-eb__label, .rik-eb__choices > .rik-eb__error { grid-column: 1 / -1; margin-bottom: 0; }
.rik-eb__choice { position: relative; display: block; cursor: pointer; }
.rik-eb__choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: inherit; }
.rik-eb__choice-body {
  position: relative; display: flex; flex-direction: column; gap: .3rem; height: 100%; min-height: 44px; padding: 1rem 2.6rem 1rem 1.1rem;
  border: 1px solid var(--eb-line-strong); border-radius: var(--eb-radius); background: var(--eb-field);
  transition: border-color .2s, background-color .2s, box-shadow .2s, transform .2s;
}
.rik-eb__choice-body strong { font-weight: 600; font-size: 1rem; line-height: 1.3; }
.rik-eb__choice-body small { margin: 0; font-weight: 500; color: var(--eb-muted); font-variant-numeric: tabular-nums; }
.rik-eb__desc { color: var(--eb-muted); font-size: .86rem; line-height: 1.45; }
.rik-eb__price { font-family: var(--font-display); font-size: 1.45rem; line-height: 1.1; color: var(--brass-bright); }
.section--cream .rik-eb__price, [data-scheme="light"] .rik-eb__price { color: var(--accent-on-light); }
.rik-eb__price small { display: inline; margin: 0; font-family: var(--font-body); font-size: .78rem; color: var(--eb-muted); }
.rik-eb__flag { align-self: flex-start; margin-bottom: .2rem; padding: .18rem .55rem; border-radius: 999px; background: var(--eb-accent); color: var(--eb-on-accent); font-size: .62rem; font-style: normal; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.rik-eb__tick { position: absolute; top: 1rem; right: 1rem; width: 1.15rem; height: 1.15rem; border: 1.5px solid var(--eb-line-strong); border-radius: 50%; transition: all .2s; }
.rik-eb__choice--session .rik-eb__choice-body { flex-direction: row; align-items: center; gap: .85rem; }
.rik-eb__choice--session .rik-eb__tick { top: 50%; transform: translateY(-50%); }
.rik-eb__choice-text { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.rik-eb__icon { display: inline-grid; place-items: center; flex: none; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--eb-accent-soft); color: var(--brass-bright); }
.section--cream .rik-eb__icon, [data-scheme="light"] .rik-eb__icon { color: var(--accent-on-light); }
.rik-eb__choice:hover .rik-eb__choice-body { border-color: var(--eb-accent); transform: translateY(-1px); }
.rik-eb__choice input:checked + .rik-eb__choice-body { border-color: var(--eb-accent); box-shadow: 0 0 0 1px var(--eb-accent), 0 14px 30px -20px rgb(var(--shadow-rgb) / .6); background: var(--eb-accent-soft); }
.rik-eb__choice input:checked + .rik-eb__choice-body .rik-eb__tick { border-color: var(--eb-accent); background: var(--eb-accent); }
.rik-eb__choice input:checked + .rik-eb__choice-body .rik-eb__tick::after { content: ""; position: absolute; left: 50%; top: 45%; width: .45rem; height: .25rem; border-left: 2px solid var(--eb-on-accent); border-bottom: 2px solid var(--eb-on-accent); transform: translate(-50%, -50%) rotate(-45deg); }
.rik-eb__choice input:focus-visible + .rik-eb__choice-body { outline: none; box-shadow: 0 0 0 3px var(--eb-ring); border-color: var(--eb-accent); }
.rik-eb__choice.is-featured .rik-eb__choice-body { border-color: color-mix(in srgb, var(--brass) 60%, transparent); }
.rik-eb__unavailable { display: none; color: var(--eb-muted); font-size: .76rem; font-style: normal; }
.rik-eb__choice.is-off { cursor: not-allowed; opacity: .5; }
.rik-eb__choice.is-off .rik-eb__unavailable { display: block; }
.rik-eb__choice.is-off:hover .rik-eb__choice-body { border-color: var(--eb-line-strong); transform: none; }

/* ---------- Date & session: calendar beside the sessions on wide forms ---------- */
.rik-eb__when { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
@container (min-width: 620px) {
  .rik-eb__when { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .rik-eb__choices--sessions { grid-template-columns: minmax(0, 1fr); }
}
.rik-eb__calendar { margin: 0; padding: clamp(.85rem, 2vw, 1.15rem); border: 1px solid var(--eb-line-strong); border-radius: var(--eb-radius); background: var(--eb-field); }
.rik-eb-cal__head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .6rem; }
.rik-eb-cal__title { margin: 0; font-family: var(--font-display); font-size: 1.3rem; line-height: 1.2; white-space: nowrap; }
.rik-eb-cal__nav { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--eb-line-strong); border-radius: 50%; background: transparent; color: inherit; font-size: 1.4rem; line-height: 1; cursor: pointer; transition: border-color .2s, background-color .2s; }
.rik-eb-cal__nav:hover:not(:disabled) { border-color: var(--eb-accent); background: var(--eb-accent-soft); }
.rik-eb-cal__nav:disabled { opacity: .3; cursor: default; }
.rik-eb-cal__grid { width: 100%; border-collapse: separate; border-spacing: 4px; table-layout: fixed; margin: 0 -4px; width: calc(100% + 8px); }
.rik-eb-cal__grid th { padding: .3rem 0; color: var(--eb-muted); font-size: .68rem; font-weight: 600; letter-spacing: .06em; text-align: center; text-transform: uppercase; }
.rik-eb-cal__grid td { padding: 0; text-align: center; }
.rik-eb-cal__day { position: relative; width: 100%; aspect-ratio: 1; max-height: 52px; min-height: 38px; padding: 0; border: 1px solid transparent; border-radius: var(--eb-radius); background: transparent; color: inherit; font: inherit; font-size: .95rem; font-variant-numeric: tabular-nums; cursor: pointer; transition: background-color .15s, border-color .15s, color .15s; }
.rik-eb-cal__day.is-free { border-color: var(--eb-line); background: var(--eb-soft); font-weight: 600; }
.rik-eb-cal__day.is-free:hover { border-color: var(--eb-accent); background: var(--eb-accent-soft); }
.rik-eb-cal__day.is-off { color: var(--eb-muted); opacity: .45; text-decoration: line-through; cursor: not-allowed; }
.rik-eb-cal__day.is-today::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; transform: translateX(-50%); }
.rik-eb-cal__day.is-selected { border-color: var(--eb-accent); background: var(--eb-accent); color: var(--eb-on-accent); opacity: 1; text-decoration: none; box-shadow: 0 8px 18px -10px rgb(var(--shadow-rgb) / .7); }
.rik-eb-cal__day:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--eb-ring); }
.rik-eb-cal__legend { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: .7rem 0 0; color: var(--eb-muted); font-size: .78rem; }
.rik-eb-cal__legend span { display: inline-block; width: .85rem; height: .85rem; margin-left: .6rem; border: 1px solid var(--eb-line-strong); border-radius: 3px; }
.rik-eb-cal__legend span:first-child { margin-left: 0; }
.rik-eb-cal__legend .is-off { background: var(--eb-line); }

/* ---------- Consent, honeypot, errors and status ---------- */
.rik-eb__consent { margin: .35rem 0 0; }
.rik-eb__consent label { display: flex; align-items: flex-start; gap: .75rem; font-size: .92rem; line-height: 1.5; cursor: pointer; }
.rik-eb__consent input { flex: none; width: 1.3rem; height: 1.3rem; margin: .15rem 0 0; accent-color: var(--eb-accent); }
.rik-eb__consent a, .rik-eb__small a { color: inherit; font-weight: 600; }
.rik-eb__honey { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.rik-eb__error { margin: .5rem 0 0; padding: .45rem .7rem; border-left: 3px solid var(--eb-alert); border-radius: 0 var(--eb-radius) var(--eb-radius) 0; background: color-mix(in srgb, var(--saffron) 10%, transparent); font-size: .86rem; font-weight: 600; line-height: 1.4; }
.has-error input, .has-error select, .has-error textarea, .has-error .rik-eb__choice-body, .rik-eb__calendar.has-error { border-color: var(--eb-alert); }
.rik-eb__notice { margin: 0 0 1.5rem; padding: 1.1rem 1.25rem; border: 1px solid var(--eb-accent); border-left-width: 4px; border-radius: var(--eb-radius); background: var(--eb-soft); }
.rik-eb__notice:has(.rik-eb__bad) { border-color: var(--eb-alert); }
.rik-eb__notice p { margin: 0; }
.rik-eb__notice:focus { outline: none; }

/* ---------- Summary ---------- */
.rik-eb__summary {
  padding: clamp(1.35rem, 2.5vw, 1.85rem); border: 1px solid var(--eb-line); border-top: 3px solid var(--eb-accent);
  border-radius: var(--eb-panel-radius); background: color-mix(in srgb, currentColor 6%, transparent);
  box-shadow: 0 24px 60px -36px rgb(var(--shadow-rgb) / .55);
}
.rik-eb__summary-title { margin: 0 0 .5rem; font-family: var(--font-display); font-size: 1.45rem; line-height: 1.2; }
.rik-eb__summary dl { margin: 0 0 1.1rem; }
.rik-eb__summary dl div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--eb-line); }
.rik-eb__summary dt { color: var(--eb-muted); font-size: .86rem; }
.rik-eb__summary dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.rik-eb__summary dd.is-empty { color: var(--eb-muted); font-weight: 400; }
.rik-eb__estimate { display: grid; gap: .2rem; margin: 0 0 1.1rem; padding: .9rem 1rem; border-radius: var(--eb-radius); background: var(--eb-accent-soft); }
.rik-eb__estimate > span { color: var(--eb-muted); font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.rik-eb__estimate strong { font-family: var(--font-display); font-size: 1.8rem; font-weight: 500; line-height: 1.1; }
.rik-eb__estimate small { margin: 0; }
.rik-eb__submit { margin: 0 0 1rem; }
.rik-eb__submit .button { width: 100%; min-height: 54px; }
.rik-eb__assure { display: grid; gap: .45rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.rik-eb__assure li { position: relative; padding-left: 1.6rem; font-size: .88rem; line-height: 1.4; }
.rik-eb__assure li::before { content: ""; position: absolute; left: .2rem; top: .32em; width: .55rem; height: .3rem; border-left: 2px solid var(--eb-accent); border-bottom: 2px solid var(--eb-accent); transform: rotate(-45deg); }
.rik-eb__small { margin: 0 0 .6rem; color: var(--eb-muted); font-size: .84rem; line-height: 1.5; }
.rik-eb__small:last-child { margin-bottom: 0; }
.rik-eb--closed { padding: 1.25rem; border: 1px solid var(--eb-line); border-radius: var(--eb-radius); }

/* ---------- Sent ---------- */
.rik-eb.is-sent .rik-eb__notice { margin: 0; padding: 0; border: 0; background: none; }
.rik-eb__done { max-width: 40rem; margin-inline: auto; padding: clamp(1.75rem, 5vw, 3rem); border: 1px solid var(--eb-line); border-top: 3px solid var(--eb-accent); border-radius: var(--eb-panel-radius); background: var(--eb-soft); text-align: center; }
.rik-eb__done-icon { position: relative; display: inline-block; width: 3.5rem; height: 3.5rem; margin-bottom: 1rem; border-radius: 50%; background: var(--eb-accent); }
.rik-eb__done-icon::after { content: ""; position: absolute; left: 50%; top: 46%; width: 1.1rem; height: .6rem; border-left: 3px solid var(--eb-on-accent); border-bottom: 3px solid var(--eb-on-accent); transform: translate(-50%, -50%) rotate(-45deg); }
.rik-eb__done-title { margin: 0 0 .5rem; font-family: var(--font-display); font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem); font-weight: 400; }
.rik-eb__done .rik-eb__ok { margin: 0 auto 1.5rem; max-width: 32rem; color: var(--eb-muted); }
.rik-eb__done-recap { margin: 0 0 1.5rem; padding: .25rem 1rem; border: 1px solid var(--eb-line); border-radius: var(--eb-radius); text-align: left; }
.rik-eb__done-recap div { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--eb-line); }
.rik-eb__done-recap div:last-child { border-bottom: 0; }
.rik-eb__done-recap dt { color: var(--eb-muted); font-size: .86rem; }
.rik-eb__done-recap dd { margin: 0; font-weight: 600; text-align: right; }
.rik-eb__done-label { margin: 0 0 .6rem; font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--eb-muted); }
.rik-eb__done-next { display: grid; gap: .6rem; margin: 0; padding: 0; list-style: none; counter-reset: next; text-align: left; }
.rik-eb__done-next li { position: relative; padding-left: 2.2rem; line-height: 1.45; counter-increment: next; }
.rik-eb__done-next li::before { content: counter(next); position: absolute; left: 0; top: -.05rem; display: grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--eb-accent-soft); font-size: .75rem; font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  .rik-eb *, .rik-eb *::before, .rik-eb *::after { transition: none !important; }
  .rik-eb__choice:hover .rik-eb__choice-body { transform: none; }
}
