/* Confido Bookings – front end. Uses theme tokens when present. */
:root {
	--cb-ink: var(--wp--preset--color--ink, #0C1820);
	--cb-signal: var(--wp--preset--color--signal, #FF5A36);
	--cb-signal-deep: var(--wp--preset--color--signal-deep, #D9401F);
	--cb-hivis: var(--wp--preset--color--hivis, #DDF247);
	--cb-cream: var(--wp--preset--color--cream, #F6F2EB);
	--cb-sand: var(--wp--preset--color--sand, #EAE3D7);
	--cb-muted: var(--wp--preset--color--muted, #5B6970);
	--cb-line: var(--wp--preset--color--line, #D9D1C3);
	--cb-display: var(--wp--preset--font-family--display, system-ui, sans-serif);
	--cb-r: 18px;
}

.cb-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .5em;
	padding: .85rem 1.4rem; border: 0; border-radius: 999px; cursor: pointer;
	background: var(--cb-ink); color: var(--cb-cream) !important; text-decoration: none !important;
	font-family: inherit; font-weight: 600; font-size: .9375rem; line-height: 1; transition: background .2s, transform .2s;
}
.cb-btn:hover { background: var(--cb-signal); color: var(--cb-ink) !important; }
.cb-btn:active { transform: scale(.97); }
.cb-btn[disabled] { opacity: .4; cursor: not-allowed; transform: none; background: var(--cb-ink); color: var(--cb-cream) !important; }
.cb-btn--signal { background: var(--cb-signal); color: var(--cb-ink) !important; }
.cb-btn--signal:hover { background: var(--cb-ink); color: var(--cb-cream) !important; }
.cb-btn--block { width: 100%; }
.cb-link { background: none; border: 0; padding: .5rem 0; color: var(--cb-muted); font: inherit; font-size: .9375rem; cursor: pointer; text-decoration: none; }
.cb-link:hover { color: var(--cb-ink); }
.cb-muted { color: var(--cb-muted); }
.cb-spinner { width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: cb-spin .7s linear infinite; }
@keyframes cb-spin { to { transform: rotate(360deg); } }

/* ---------- Filters ---------- */
.cb-filters { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 2rem; }
.cb-filters button {
	border: 1px solid var(--cb-line); background: transparent; color: var(--cb-ink);
	padding: .6rem 1rem; border-radius: 999px; font-family: inherit; font-weight: 500; font-size: .875rem; line-height: 1; cursor: pointer; transition: .2s;
}
.cb-filters button span { opacity: .5; margin-left: .25rem; font-variant-numeric: tabular-nums; }
.cb-filters button:hover { border-color: var(--cb-ink); }
.cb-filters button.is-active { background: var(--cb-ink); border-color: var(--cb-ink); color: var(--cb-cream); }
.cb-filters--small { margin: 0 0 1.25rem; }
.cb-filters--small button { padding: .45rem .8rem; font-size: .8125rem; }

/* ---------- Course cards ---------- */
.cb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 1.25rem; }
.cb-card {
	position: relative; display: flex; flex-direction: column; gap: .9rem;
	background: #fff; border: 1px solid var(--cb-sand); border-radius: var(--cb-r); padding: 1.6rem;
	transition: transform .25s cubic-bezier(.2,.7,.3,1), box-shadow .25s, border-color .25s;
}
.cb-card:hover { transform: translateY(-4px); box-shadow: 0 24px 40px -24px rgba(12,24,32,.35); border-color: transparent; }
.cb-card[hidden] { display: none; }
.cb-card__top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.cb-tag { font-size: .75rem; font-weight: 600; letter-spacing: .02em; padding: .35rem .7rem; border-radius: 999px; background: var(--cb-sand); }
.cb-tag--first-aid { background: #FFE1D8; color: #9A2A10; }
.cb-tag--fire-safety { background: #FFE9C7; color: #8A4B00; }
.cb-tag--health-safety { background: #E3F0FF; color: #1E4C85; }
.cb-tag--equipment-operations { background: #EEF6C4; color: #4B5A00; }
.cb-tag--skills-development { background: #EDE4FF; color: #4C2E8F; }
.cb-duration { display: inline-flex; align-items: center; gap: .3rem; font-size: .8125rem; color: var(--cb-muted); }
.cb-duration svg, .cb-search svg, .cb-summary__help svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.cb-card__title { margin: .25rem 0 0; font-family: var(--cb-display); font-size: 1.375rem; line-height: 1.15; letter-spacing: -.01em; }
.cb-card__title a { text-decoration: none; color: inherit; }
.cb-card__title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.cb-card__excerpt { margin: 0; color: var(--cb-muted); font-size: .9375rem; line-height: 1.55; flex: 1; }
.cb-card__next { display: flex; align-items: center; gap: .5rem; font-size: .8125rem; font-weight: 500; }
.cb-dot { width: 8px; height: 8px; border-radius: 50%; background: #23B26D; box-shadow: 0 0 0 4px rgba(35,178,109,.15); }
.cb-dot.is-full { background: var(--cb-signal); box-shadow: 0 0 0 4px rgba(255,90,54,.15); }
.cb-dot.is-request { background: var(--cb-muted); box-shadow: 0 0 0 4px rgba(91,105,112,.15); }
.cb-card__foot { display: flex; justify-content: space-between; align-items: flex-end; padding-top: 1rem; border-top: 1px dashed var(--cb-line); }
.cb-price small { display: block; font-size: .75rem; color: var(--cb-muted); }
.cb-price strong { font-family: var(--cb-display); font-size: 1.625rem; letter-spacing: -.02em; }
.cb-card .cb-btn { position: relative; z-index: 1; padding: .7rem 1.1rem; }

/* ---------- Upcoming widget ---------- */
.cb-upcoming {
	background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); border-radius: 24px;
	padding: 1.25rem; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); color: var(--cb-cream);
}
.cb-upcoming__head { display: flex; align-items: center; gap: .6rem; font-size: .8125rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; opacity: .85; padding: .25rem .25rem 1rem; }
.cb-live { width: 8px; height: 8px; border-radius: 50%; background: var(--cb-hivis); box-shadow: 0 0 0 0 rgba(221,242,71,.6); animation: cb-pulse 2s infinite; }
@keyframes cb-pulse { 70% { box-shadow: 0 0 0 10px rgba(221,242,71,0); } 100% { box-shadow: 0 0 0 0 rgba(221,242,71,0); } }
.cb-upcoming__item {
	display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .9rem;
	padding: .75rem; border-radius: 16px; color: inherit !important; text-decoration: none !important; transition: background .2s;
}
.cb-upcoming__item:hover { background: rgba(255,255,255,.08); }
.cb-upcoming__text strong { display: block; font-size: .9375rem; line-height: 1.3; }
.cb-upcoming__text small { display: block; font-size: .8125rem; opacity: .65; }
.cb-upcoming__empty { opacity: .75; font-size: .9375rem; padding: 0 .25rem; }
.cb-upcoming__all { display: block; margin-top: .75rem; padding: .9rem; border-radius: 14px; text-align: center; font-weight: 600; font-size: .9375rem; background: var(--cb-signal); color: var(--cb-ink) !important; text-decoration: none !important; transition: background .2s; }
.cb-upcoming__all:hover { background: var(--cb-hivis); }
.cb-cal {
	display: grid; place-items: center; width: 52px; height: 56px; border-radius: 14px;
	background: var(--cb-cream); color: var(--cb-ink); line-height: 1; flex-shrink: 0;
}
.cb-cal small { font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--cb-signal-deep); margin-top: 7px; }
.cb-cal b { font-family: var(--cb-display); font-size: 1.5rem; margin-bottom: 7px; }
.cb-cal--plus b { margin: 0; color: var(--cb-muted); }
.cb-seats { font-size: .75rem; font-weight: 600; padding: .35rem .6rem; border-radius: 999px; background: rgba(35,178,109,.16); color: #1B8A55; white-space: nowrap; }
.cb-upcoming .cb-seats { color: #7EE2B0; }
.cb-seats.is-low { background: rgba(255,90,54,.16); color: var(--cb-signal-deep); }
.cb-upcoming .cb-seats.is-low { color: #FF8F75; }

/* ---------- Course facts (single course) ---------- */
.cb-facts { background: #fff; border-radius: 24px; padding: 1.75rem; border: 1px solid var(--cb-sand); position: sticky; top: 110px; }
.cb-facts__price small { display: block; color: var(--cb-muted); font-size: .8125rem; }
.cb-facts__price strong { font-family: var(--cb-display); font-size: 2.75rem; letter-spacing: -.03em; line-height: 1.1; }
.cb-facts__list { margin: 1.25rem 0; padding: 0; }
.cb-facts__list div { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--cb-sand); font-size: .9375rem; }
.cb-facts__list dt { color: var(--cb-muted); }
.cb-facts__list dd { margin: 0; font-weight: 600; text-align: right; }
.cb-facts__sessions h4 { font-size: .8125rem; text-transform: uppercase; letter-spacing: .08em; margin: 1.25rem 0 .5rem; font-family: inherit; }
.cb-facts__sessions ul { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; gap: .4rem; }
.cb-facts__sessions li > * { display: flex; justify-content: space-between; padding: .7rem .9rem; border-radius: 12px; background: var(--cb-cream); text-decoration: none; color: inherit; font-size: .9375rem; transition: background .2s; }
.cb-facts__sessions li > a:hover { background: var(--cb-hivis); }
.cb-facts__sessions em { font-style: normal; font-size: .8125rem; color: var(--cb-muted); }
.cb-facts__sessions .is-full { opacity: .5; }
.cb-facts__sessions p { font-size: .9375rem; color: var(--cb-muted); }
.cb-facts__wa { display: block; text-align: center; margin-top: .9rem; font-size: .875rem; color: var(--cb-muted); }

/* ---------- Wizard ---------- */
.cb-wizard { --cb-gap: clamp(1rem, 3vw, 2rem); }
.cb-loading { display: flex; align-items: center; gap: .75rem; padding: 3rem; justify-content: center; color: var(--cb-muted); }
.cb-steps { display: flex; gap: .5rem; list-style: none; margin: 0 0 var(--cb-gap); padding: 0; counter-reset: s; overflow-x: auto; scrollbar-width: none; }
.cb-steps li { display: flex; align-items: center; gap: .6rem; flex: 1; min-width: max-content; padding: .75rem 1rem; border-radius: 999px; background: rgba(12,24,32,.05); font-size: .875rem; font-weight: 500; color: var(--cb-muted); }
.cb-steps li span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #fff; font-size: .75rem; font-weight: 700; }
.cb-steps li.is-current { background: var(--cb-ink); color: var(--cb-cream); }
.cb-steps li.is-current span { background: var(--cb-signal); color: var(--cb-ink); }
.cb-steps li.is-done { color: var(--cb-ink); }
.cb-steps li.is-done span { background: var(--cb-hivis); }

.cb-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--cb-gap); align-items: start; }
.cb-main { background: #fff; border-radius: 24px; padding: clamp(1.25rem, 3vw, 2.25rem); border: 1px solid var(--cb-sand); min-height: 420px; animation: cb-in .35s cubic-bezier(.2,.7,.3,1); }
@keyframes cb-in { from { opacity: 0; transform: translateY(8px); } }
.cb-h { font-family: var(--cb-display); font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 1.25rem; letter-spacing: -.02em; line-height: 1.1; }

.cb-search { position: relative; margin-bottom: 1rem; }
.cb-search svg { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--cb-muted); }
.cb-search input { width: 100%; padding: .9rem 1rem .9rem 2.6rem; border-radius: 14px; border: 1px solid var(--cb-line); background: var(--cb-cream); font: inherit; }
.cb-search input:focus, .cb-field input:focus, .cb-field textarea:focus { outline: 2px solid var(--cb-ink); outline-offset: 1px; border-color: transparent; background: #fff; }

.cb-options { display: grid; gap: .5rem; max-height: 560px; overflow-y: auto; padding: 2px; margin: -2px; }
.cb-option, .cb-session {
	display: flex; align-items: center; gap: 1rem; width: 100%; text-align: left; cursor: pointer;
	padding: 1rem 1.1rem; border-radius: 16px; border: 1px solid var(--cb-line); background: #fff; font: inherit; color: inherit; transition: .2s;
}
.cb-option:hover, .cb-session:hover:not([disabled]) { border-color: var(--cb-ink); background: var(--cb-cream); }
.cb-option.is-selected, .cb-session.is-selected { border-color: var(--cb-ink); box-shadow: inset 0 0 0 1px var(--cb-ink); background: var(--cb-cream); }
.cb-session[disabled] { opacity: .45; cursor: not-allowed; }
.cb-option__main, .cb-session__text { flex: 1; min-width: 0; }
.cb-option__main strong, .cb-session__text strong { display: block; font-weight: 600; line-height: 1.3; }
.cb-option__main small, .cb-session__text small, .cb-option__meta small { display: block; font-size: .8125rem; color: var(--cb-muted); }
.cb-option__meta { text-align: right; flex-shrink: 0; }
.cb-option__meta b { font-family: var(--cb-display); font-size: 1.125rem; }
.cb-sessions { display: grid; gap: .5rem; margin-bottom: .5rem; }
.cb-session--request { border-style: dashed; margin-top: .5rem; }

.cb-field { display: grid; gap: .4rem; margin: 0 0 1rem; font-size: .875rem; font-weight: 500; }
.cb-field i { font-style: normal; color: var(--cb-muted); font-weight: 400; }
.cb-field input, .cb-field textarea { width: 100%; padding: .85rem 1rem; border-radius: 12px; border: 1px solid var(--cb-line); background: var(--cb-cream); font: inherit; font-size: 1rem; color: var(--cb-ink); box-sizing: border-box; }
.cb-field [aria-invalid="true"] { border-color: var(--cb-signal-deep); background: #FFF4F1; }
.cb-field--date { margin-top: 1.25rem; max-width: 320px; }
.cb-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.cb-error { display: block; color: var(--cb-signal-deep); font-size: .8125rem; font-style: normal; font-weight: 500; margin: 0; min-height: 0; }
.cb-error:empty { display: none; }
.cb-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.cb-delegates { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.1rem; border-radius: 16px; background: var(--cb-cream); margin-bottom: 1.5rem; }
.cb-delegates small { display: block; color: var(--cb-muted); font-size: .8125rem; }
.cb-stepper { display: flex; align-items: center; gap: .25rem; background: #fff; border-radius: 999px; padding: .25rem; border: 1px solid var(--cb-line); }
.cb-stepper button { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--cb-ink); color: var(--cb-cream); font-size: 1.25rem; cursor: pointer; line-height: 1; }
.cb-stepper button[disabled] { opacity: .25; cursor: not-allowed; }
.cb-stepper output { min-width: 2.5ch; text-align: center; font-family: var(--cb-display); font-size: 1.25rem; font-weight: 700; }

.cb-nav { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--cb-sand); }
.cb-nav--center { justify-content: center; border: 0; }
.cb-review { margin: 0 0 1.5rem; padding: 0; }
.cb-review div { display: grid; grid-template-columns: 130px 1fr; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid var(--cb-sand); font-size: .9375rem; }
.cb-review dt { color: var(--cb-muted); }
.cb-review dd { margin: 0; font-weight: 500; white-space: pre-line; }
.cb-check { display: flex; gap: .75rem; align-items: flex-start; font-size: .9375rem; cursor: pointer; }
.cb-check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--cb-ink); flex-shrink: 0; }
.cb-alert { padding: .9rem 1.1rem; border-radius: 12px; background: #FFF0EC; color: #8A2410; font-size: .9375rem; margin-top: 1rem; }

.cb-summary { position: sticky; top: 110px; background: var(--cb-ink); color: var(--cb-cream); border-radius: 24px; padding: 1.75rem; overflow: hidden; }
.cb-summary::before { content: ""; position: absolute; right: -60px; top: -60px; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, rgba(255,90,54,.45), transparent 70%); pointer-events: none; }
.cb-summary h4 { margin: 0 0 1rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; opacity: .7; font-family: inherit; }
.cb-summary .cb-muted { color: rgba(246,242,235,.7); font-size: .9375rem; }
.cb-summary__course small { display: block; color: var(--cb-hivis); font-size: .8125rem; font-weight: 600; }
.cb-summary__course strong { font-family: var(--cb-display); font-size: 1.5rem; line-height: 1.15; letter-spacing: -.01em; display: block; }
.cb-summary dl { margin: 1.25rem 0; padding: 0; }
.cb-summary dl div { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid rgba(255,255,255,.1); font-size: .875rem; }
.cb-summary dt { opacity: .65; }
.cb-summary dd { margin: 0; text-align: right; font-weight: 500; }
.cb-summary dd small { opacity: .65; font-weight: 400; }
.cb-summary__total { display: flex; justify-content: space-between; align-items: baseline; }
.cb-summary__total strong { font-family: var(--cb-display); font-size: 2.25rem; letter-spacing: -.03em; color: var(--cb-hivis); }
.cb-summary__note { font-size: .8125rem; opacity: .6; margin: .5rem 0 0; }
.cb-summary__help { display: flex; align-items: center; gap: .5rem; justify-content: center; margin-top: 1.25rem; padding: .8rem; border-radius: 14px; background: rgba(255,255,255,.07); color: var(--cb-cream) !important; text-decoration: none !important; font-size: .875rem; font-weight: 500; transition: background .2s; }
.cb-summary__help:hover { background: rgba(255,255,255,.14); }

.cb-success { text-align: center; max-width: 640px; margin: 0 auto; padding: clamp(1.5rem, 4vw, 3rem); background: #fff; border-radius: 28px; border: 1px solid var(--cb-sand); animation: cb-in .5s cubic-bezier(.2,.7,.3,1); }
.cb-success--small { padding: 2rem; border: 0; }
.cb-success__icon { width: 72px; height: 72px; margin: 0 auto 1.25rem; border-radius: 50%; background: var(--cb-hivis); display: grid; place-items: center; animation: cb-pop .5s .15s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes cb-pop { from { transform: scale(.4); opacity: 0; } }
.cb-success__icon svg { width: 34px; fill: none; stroke: var(--cb-ink); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.cb-success h3 { font-family: var(--cb-display); font-size: clamp(1.75rem, 4vw, 2.5rem); margin: .25rem 0 1rem; letter-spacing: -.02em; line-height: 1.1; }
.cb-success .cb-review { text-align: left; margin-top: 1.5rem; }
.cb-eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--cb-signal-deep); margin: 0; }
.cb-ref { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--cb-hivis); padding: .15rem .45rem; border-radius: 6px; }

/* ---------- Contact form ---------- */
.cb-contact .cb-btn { margin-top: .5rem; }
.cb-contact .cb-form__msg:empty { display: none; }

@media (max-width: 900px) {
	.cb-layout { grid-template-columns: 1fr; }
	.cb-summary { position: static; order: -1; padding: 1.25rem 1.5rem; }
	.cb-summary .cb-summary__help, .cb-summary__note, .cb-summary dl { display: none; }
	.cb-summary__course strong { font-size: 1.2rem; }
	.cb-summary__total { margin-top: .75rem; }
	.cb-summary__total strong { font-size: 1.5rem; }
	.cb-facts { position: static; }
}
@media (max-width: 600px) {
	.cb-row { grid-template-columns: 1fr; }
	.cb-steps li { flex: 0 0 auto; padding: .6rem .8rem; }
	.cb-steps li:not(.is-current) { font-size: 0; gap: 0; }
	.cb-option { flex-wrap: wrap; }
	.cb-option__meta { text-align: left; width: 100%; display: flex; gap: .75rem; align-items: baseline; }
	.cb-review div { grid-template-columns: 1fr; gap: .1rem; }
	.cb-nav { flex-direction: column-reverse; align-items: stretch; }
	.cb-nav .cb-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; }
}

.cb-btn { box-sizing: border-box; }
.cb-facts__sessions li { display: block; margin: 0; padding: 0; }
.cb-facts__sessions li > * { width: 100%; box-sizing: border-box; text-align: left; }
