/*
 * Shared step/form styling for the booking wizard — used identically by the
 * standalone booking page (view=fencingevents) and the Instant Booking
 * modal mounted from mod_fencingevents. Extends the price calculator's own
 * palette (#15789c / #0f6b99 teal, fully-rounded controls) rather than
 * inventing a second visual language for the same booking flow.
 */

.fencingevents-wizard {
	color: #1c1c1c;
	display: flex;
	flex-direction: column;
	font-size: 15px;
	gap: 1.75rem;
	max-width: 32rem;
}

.fencingevents-wizard__step h2 {
	font-size: 1.05rem;
	font-weight: 700;
	margin: 0 0 0.9rem;
}

.fencingevents-wizard__field {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	margin-bottom: 0.9rem;
}

.fencingevents-wizard__field label {
	font-size: 0.85rem;
	font-weight: 600;
}

/* `select` included since 1.2.73: a dropdown form field rendered here was
   otherwise left with the browser's own default control, visibly unlike every
   other input in the dialog. The phone-prefix select escaped this only
   because .few-phone-split styles it separately. */
.fencingevents-wizard__field input,
.fencingevents-wizard__field select,
.fencingevents-wizard__field textarea {
	background: #fff;
	border: 1.5px solid #d9d9d9;
	border-radius: 10px;
	color: inherit;
	font: inherit;
	line-height: 1.5;
	/* min-height, not line-height alone: a browser sizes a <select> from its
	   font metrics and ignores line-height, leaving a standalone dropdown
	   shorter than the inputs beside it. This is the inputs' own box — one
	   line plus vertical padding and borders — so the two stay equal. */
	min-height: calc(1.5em + 1.2rem + 3px);
	padding: 0.6rem 0.75rem;
	transition: border-color 0.15s;
}

.fencingevents-wizard__field textarea {
	min-height: 4.5rem;
	resize: vertical;
}

/* A <select> left at appearance:auto is drawn by the OS — on macOS that is a
   visibly different control from the text inputs beside it (its own shading,
   arrow and baseline), no matter how its border and padding are set. Matching
   metrics alone is not enough; the native rendering has to go, which means
   supplying the arrow ourselves. */
.fencingevents-wizard__field select {
	appearance: none;
	-webkit-appearance: none;
	background-color: #fff;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23555' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
	background-position: right 0.8rem center;
	background-repeat: no-repeat;
	padding-right: 2.1rem;
}

/* A select still showing its prompt rather than a chosen value — lighter, so
   an unanswered field reads the same way an empty text input does. The prompt
   option itself is disabled on required fields, which the browser greys in the
   open list for free; this covers the closed control.

   :has() rather than a class toggled from JS, because this markup is rendered
   server-side and the wizard is mounted more than once per page: a class would
   depend on every mount being initialised and on catching every path that
   changes a value. Purely cosmetic, so a browser without :has() simply shows
   the prompt in normal text. */
.fencingevents-wizard__field select:has(option[value=""]:checked) {
	color: #767676;
}

/* Custom form fields (CONTEXT.md, "Field attachment"). A checkbox field puts
   its sentence BESIDE the box rather than above it as a bold label, and the
   text wraps under itself rather than under the box — its label is rendered
   Markdown, so a link inside it must still read as a link. */
.few-form-field--check {
	flex-direction: row;
}

.few-field-check {
	align-items: flex-start;
	cursor: pointer;
	display: flex;
	font-size: 0.85rem;
	font-weight: 400;
	gap: 0.55rem;
	line-height: 1.45;
}

/* Drawn rather than left native: the full-width text-input styling above
   applies to EVERY input, so untouched it stretches the tick box across the
   dialog — and simply stripping that back leaves a small OS control that
   matches nothing else here. Same border and ground as the other fields,
   filled with the wizard's own blue when ticked. */
.few-field-check input[type="checkbox"] {
	appearance: none;
	-webkit-appearance: none;
	background: #fff;
	border: 1.5px solid #d9d9d9;
	border-radius: 6px;
	cursor: pointer;
	display: grid;
	flex: 0 0 auto;
	height: 1.15rem;
	margin: 0.1rem 0 0;
	min-height: 0;
	padding: 0;
	place-content: center;
	transition: background-color 0.12s, border-color 0.12s;
	width: 1.15rem;
}

.few-field-check input[type="checkbox"]::before {
	box-shadow: inset 1rem 1rem #fff;
	clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
	content: "";
	height: 0.62rem;
	transform: scale(0);
	transition: transform 0.12s ease-in-out;
	width: 0.62rem;
}

.few-field-check input[type="checkbox"]:checked {
	background: #0f6b99;
	border-color: #0f6b99;
}

.few-field-check input[type="checkbox"]:checked::before {
	transform: scale(1);
}

.few-field-check input[type="checkbox"]:hover:not(:checked) {
	border-color: #0f6b99;
}

.few-field-check input[type="checkbox"]:focus-visible {
	outline: 2px solid #0f6b99;
	outline-offset: 2px;
}

.few-field-check-text {
	min-width: 0;
	overflow-wrap: anywhere;
}

.few-field-check-text a {
	text-decoration: underline;
}

/* The label is Markdown, so it arrives wrapped in <p> — a block, which would
   push the trailing required marker onto a line of its own. */
.few-field-check-text p {
	display: inline;
	margin: 0;
}

.fencingevents-wizard__field input:focus-visible,
.fencingevents-wizard__field textarea:focus-visible {
	border-color: #15789c;
	outline: 2px solid #15789c;
	outline-offset: 1px;
}

.few-phone-split {
	display: flex;
	gap: 0.5rem;
}

.few-phone-split select {
	flex: 0 0 auto;
	width: 6.5rem;
}

.few-phone-split input {
	flex: 1 1 auto;
	min-width: 0;
}

.fencingevents-wizard__price {
	align-items: baseline;
	display: flex;
	font-size: 1.1rem;
	gap: 0.5rem;
	justify-content: space-between;
}

/* Buttons — shared vocabulary with the calculator's pill buttons: fully
   rounded, teal-bordered. Two weights (primary/quiet) cover every action
   in the wizard without introducing a third. */
.few-btn {
	background: #fff;
	border: 2px solid #15789c;
	border-radius: 999px;
	color: #0f6b99;
	cursor: pointer;
	font: inherit;
	font-weight: 700;
	padding: 0.65rem 1.4rem;
	transition: background-color 0.15s, color 0.15s, opacity 0.15s;
}

.few-btn:hover {
	background: #eaf4f8;
}

.few-btn:focus-visible {
	outline: 2px solid #15789c;
	outline-offset: 2px;
}

.few-btn:disabled {
	cursor: not-allowed;
	opacity: 0.6;
}

.few-btn--primary {
	background: #0f6b99;
	color: #fff;
}

.few-btn--primary:hover {
	background: #0c567b;
}

.few-btn--quiet {
	border-color: #d9d9d9;
	color: #444;
}

.few-btn--quiet:hover {
	background: #f2f2f2;
}

/* Step footer: a way back on the left, the primary forward action on the
   right — same convention across Details/Add-ons/Review, and the
   payment-cancelled screen's Contact-us/Retry-payment pairing. */
.few-step-actions {
	align-items: center;
	display: flex;
	justify-content: space-between;
	margin-top: 1.25rem;
	width: 100%;
}

.few-back-link {
	color: #0f6b99;
	cursor: pointer;
	font-weight: 700;
	text-decoration: none;
}

.few-back-link:hover {
	text-decoration: underline;
}

.few-onrequest-escape-wrap {
	margin-top: 1.5rem;
	text-align: center;
}

.few-date-button,
.few-slot-button {
	background: #fff;
	border: 1.5px solid #d9d9d9;
	border-radius: 999px;
	color: #1c1c1c;
	cursor: pointer;
	font: inherit;
	font-weight: 600;
	margin: 0.2rem 0.3rem 0.2rem 0;
	padding: 0.5rem 1.05rem;
	transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.few-date-button:hover,
.few-slot-button:hover {
	border-color: #15789c;
}

.few-date-button.is-active,
.few-slot-button.is-active {
	background: #0f6b99;
	border-color: #0f6b99;
	color: #fff;
}

.few-lead-time-message {
	color: #444;
	font-size: 0.9rem;
	margin: 0 0 0.75rem;
}

.few-error {
	background: #fdecee;
	border-radius: 10px;
	color: #b00020;
	font-size: 0.9rem;
	font-weight: 600;
	padding: 0.65rem 0.9rem;
}

.few-error[hidden] {
	display: none;
}

/* Calendar: month-default with a drill-up-to-year and drill-down-to-time
   sub-view switch (see booking-wizard.js's showCalSubview()) — all three
   sub-views live in the DOM the whole time, one shown at a time. */
.few-cal-year__intro {
	color: #444;
	font-size: 0.9rem;
	margin: 0 0 0.75rem;
}

.few-cal-year__options {
	display: flex;
	gap: 0.6rem;
}

.few-cal-year-btn {
	background: #fff;
	border: 1.5px solid #d9d9d9;
	border-radius: 12px;
	cursor: pointer;
	flex: 1 1 0;
	font: inherit;
	font-size: 1.2rem;
	font-weight: 700;
	padding: 1rem;
}

.few-cal-year-btn:hover {
	border-color: #15789c;
}

.few-cal-year-btn.is-active {
	background: #0f6b99;
	border-color: #0f6b99;
	color: #fff;
}

.few-cal-nav {
	align-items: center;
	display: flex;
	justify-content: space-between;
	margin-bottom: 0.75rem;
}

.few-cal-prev,
.few-cal-next {
	background: #fff;
	border: 1.5px solid #d9d9d9;
	border-radius: 999px;
	cursor: pointer;
	font-size: 1.1rem;
	height: 2.1rem;
	width: 2.1rem;
}

.few-cal-prev:hover,
.few-cal-next:hover {
	border-color: #15789c;
}

.few-cal-label {
	background: transparent;
	border: 0;
	cursor: pointer;
	font: inherit;
	font-size: 1rem;
	font-weight: 700;
}

.few-cal-label:hover {
	text-decoration: underline;
}

.few-cal-weekdays,
.few-cal-days {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	text-align: center;
}

.few-cal-weekdays {
	color: #888;
	font-size: 0.75rem;
	font-weight: 700;
	margin-bottom: 0.35rem;
	text-transform: uppercase;
}

.few-cal-days {
	gap: 0.2rem;
}

.few-cal-day {
	background: #fff;
	border: 0;
	border-radius: 10px;
	cursor: pointer;
	font: inherit;
	padding: 0.55rem 0;
}

.few-cal-day:hover:not(:disabled) {
	background: #eaf4f8;
}

.few-cal-day.is-today {
	font-weight: 700;
}

.few-cal-day:disabled {
	color: #ccc;
	cursor: not-allowed;
}

.few-cal-back {
	background: transparent;
	border: 0;
	color: #0f6b99;
	cursor: pointer;
	font: inherit;
	font-weight: 700;
	margin-bottom: 0.75rem;
	padding: 0;
}

.few-cal-back:hover {
	text-decoration: underline;
}

/* Add-on rows: same −/count/+ stepper interaction as the manager UI (see
   manager.js's initAddonSteppers()), restyled here in the wizard's own
   teal/rounded vocabulary rather than reusing manager.css. `.few-addons` is
   the actual grid — each `.few-addon` row is `display:contents` so every
   row shares one set of column tracks (steppers/prices align across rows)
   instead of each row computing its own independent `auto` widths. */
.few-addons {
	align-items: center;
	display: grid;
	gap: 0.5rem 1rem;
	grid-template-columns: 1fr auto auto;
}

.few-addon {
	display: contents;
}

/* `display: contents` above wins over the browser's own default
   `[hidden] { display: none }` UA rule (same specificity, author beats
   UA) — without this, a genuinely sold-out add-on's `hidden` attribute
   (see applyAddonMax() in booking-wizard.js) would carry no visual
   effect at all. */
.few-addon[hidden] {
	display: none;
}

.few-addon > .few-tx,
.few-addon > .few-step,
.few-addon > .few-pr-col {
	border-bottom: 1px solid #eee;
	padding: 0.85rem 0;
}

.few-addon:last-child > .few-tx,
.few-addon:last-child > .few-step,
.few-addon:last-child > .few-pr-col {
	border-bottom: 0;
}

.few-tx b {
	font-weight: 600;
}

.few-addon-description {
	color: #666;
	font-size: 0.85rem;
	margin: 0.2rem 0 0;
}

.few-step {
	align-items: center;
	display: inline-flex;
	gap: 0.6rem;
}

.few-step button {
	align-items: center;
	background: #fff;
	border: 1.5px solid #15789c;
	border-radius: 999px;
	color: #0f6b99;
	cursor: pointer;
	display: inline-flex;
	font-weight: 700;
	height: 1.9rem;
	justify-content: center;
	width: 1.9rem;
}

.few-step button:hover:not(:disabled) {
	background: #eaf4f8;
}

.few-step button:disabled {
	border-color: #d9d9d9;
	color: #b6b6b6;
	cursor: not-allowed;
}

.few-step b {
	font-variant-numeric: tabular-nums;
	min-width: 1.2rem;
	text-align: center;
}

.few-pr-col {
	text-align: right;
}

.few-pr {
	font-weight: 600;
	white-space: nowrap;
}

.few-addon-line-total {
	color: #666;
	display: block;
	font-size: 0.85rem;
	white-space: nowrap;
}

.few-addon-soldout {
	color: #b00020;
	display: block;
	font-size: 0.8rem;
	font-weight: 700;
}

/* Review step */
.few-review-lines {
	border-top: 1px solid #eee;
	margin-bottom: 1rem;
}

.few-review-line {
	display: flex;
	justify-content: space-between;
	padding: 0.6rem 0;
}

.few-review-line:not(:last-child) {
	border-bottom: 1px solid #eee;
}

.few-review-line--total {
	border-top: 2px solid #1c1c1c;
	font-size: 1.1rem;
	font-weight: 700;
	margin-top: 0.25rem;
	padding-top: 0.75rem;
}

.few-review-voucher-remove {
	background: transparent;
	border: 0;
	color: #8a8a8a;
	cursor: pointer;
	font-size: 1.1rem;
	line-height: 1;
	margin-left: 0.6rem;
	padding: 0 0.15rem;
}

.few-review-voucher-remove:hover {
	color: #b00020;
}

.few-review-code {
	margin-bottom: 1.25rem;
}

.few-review-code-toggle {
	background: transparent;
	border: 0;
	color: #0f6b99;
	cursor: pointer;
	font: inherit;
	font-weight: 700;
	padding: 0;
}

.few-review-code-toggle:hover {
	text-decoration: underline;
}

.few-review-code-field {
	margin-top: 0.75rem;
}

.few-review-code-row {
	display: flex;
	gap: 0.5rem;
}

.few-review-code-row input {
	flex: 1 1 auto;
	min-width: 0;
}

.few-review-code-error {
	color: #b00020;
	font-size: 0.85rem;
	font-weight: 600;
	margin: 0.5rem 0 0;
}

.few-review-code-error[hidden] {
	display: none;
}

.few-confirmation-message {
	align-items: stretch;
	display: flex;
	flex-direction: column;
	gap: 0.9rem;
}

.few-form-actions--end {
	display: flex;
	justify-content: flex-end;
	width: 100%;
}

@media (prefers-reduced-motion: reduce) {
	.few-btn,
	.few-date-button,
	.few-slot-button {
		transition: none;
	}
}
