/* Wirral Skips enquiry form. Scoped under .ws-quote so it sits safely inside any theme.
 *
 * Design tokens come from the Wirral Skips theme when it's active (theme.json colours and font), with the same
 * values as fallbacks, so the form looks the same on any theme. Colour roles:
 *   navy   = identity and headings      action = buttons, links, selected   yellow = restrained accent
 *   cream  = page band behind the card  white  = card and option surfaces
 */
.ws-quote {
	--ws-brand: var(--wp--preset--color--navy, #13293D);
	--ws-action: var(--wp--preset--color--green-dark, #15803D);   /* 5.0:1 with white text (WCAG AA) */
	--ws-action-hover: #116932;
	--ws-action-pale: var(--wp--preset--color--pale-green, #EDF9F0);
	--ws-accent: var(--wp--preset--color--yellow, #F4C542);
	--ws-cream: var(--wp--preset--color--cream, #F8F7F3);
	--ws-muted: #536170;                                           /* secondary text, 6.4:1 on white */
	--ws-line: #DCE2E7;
	--ws-field-line: #CFD6DC;
	--ws-white: #FFFFFF;
	--ws-success: #16A34A;
	--ws-danger: #B42318;                                          /* errors, 6.6:1 on white */
	--ws-danger-pale: #FEF3F2;
	--ws-warn-pale: #FFF8E1;
	--ws-focus: var(--wp--preset--color--navy, #13293D);           /* focus ring: navy on light surfaces */
	/* C9: skip artwork colours are fixed and separate from the UI palette. */
	--ws-skip-yellow: #F2B33D;
	--ws-skip-ink: #1E2B27;
	--ws-radius: 12px;
	--ws-radius-sm: 8px;

	font-family: var(--wp--preset--font-family--system, Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif);
	font-size: 16px;
	line-height: 1.5;
	color: var(--ws-brand);
	background: var(--ws-white);
	border: 1px solid var(--ws-line);
	border-radius: 14px;
	box-shadow: 0 7px 24px rgba(19, 41, 61, .08);
	max-width: 640px;
	margin: 0 auto;
	padding: 30px 32px 34px;
	box-sizing: border-box;
	text-align: left;
	-webkit-font-smoothing: antialiased;
}
.ws-quote *, .ws-quote *::before, .ws-quote *::after { box-sizing: border-box; }
.ws-quote [hidden] { display: none !important; }

/* Progress */
.ws-progress { margin: 0 0 22px; }
.ws-progress__track { height: 6px; background: #E8ECEF; border-radius: 3px; overflow: hidden; }
.ws-progress__fill { display: block; height: 100%; width: 33.3%; background: var(--ws-action); border-radius: 3px; transition: width .25s ease; }
.ws-progress__text { margin: 8px 0 0; font-size: 14px; font-weight: 600; color: var(--ws-muted); }

/* Headings and text: same weight and tracking as the site's section headings */
.ws-quote .ws-h {
	font-family: inherit;
	font-size: 30px;
	line-height: 1.1;
	font-weight: 800;
	letter-spacing: -0.03em;
	margin: 0 0 8px;
	color: var(--ws-brand);
	outline: none;
}
.ws-hint { margin: 0 0 22px; color: var(--ws-muted); font-size: 16px; }

.ws-label { display: block; font-weight: 700; font-size: 16px; margin: 18px 0 8px; }
.ws-step > .ws-label:first-of-type { margin-top: 0; }

/* Fields: as the site's postcode box */
.ws-quote .ws-input {
	display: block;
	width: 100%;
	font: inherit;
	font-size: 17px;
	color: var(--ws-brand);
	background: var(--ws-white);
	border: 1px solid var(--ws-field-line);
	border-radius: var(--ws-radius-sm);
	padding: 14px 15px;
	min-height: 54px;
	margin: 0;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
}
.ws-quote .ws-input:focus { border-color: var(--ws-action); box-shadow: inset 0 0 0 1px var(--ws-action); outline: 3px solid rgba(21, 128, 61, .25); outline-offset: 1px; }
.ws-quote .ws-input[aria-invalid="true"] { border-color: var(--ws-danger); box-shadow: inset 0 0 0 1px var(--ws-danger); }
.ws-quote .ws-input--postcode { font-size: 22px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.ws-quote .ws-input--postcode::placeholder { color: var(--ws-muted); opacity: .5; font-weight: 600; letter-spacing: .06em; }

/* Errors: words plus an icon, never colour alone */
.ws-error { margin: 8px 0 0; color: var(--ws-danger); font-size: 15px; font-weight: 600; display: flex; gap: 7px; align-items: flex-start; }
.ws-error::before { content: "!"; flex: 0 0 18px; height: 18px; margin-top: 2px; border-radius: 50%; background: var(--ws-danger); color: #fff; font-size: 12px; font-weight: 800; line-height: 18px; text-align: center; }
.ws-error:empty { display: none; }
.ws-error--form { margin-top: 14px; padding: 10px 12px; background: var(--ws-danger-pale); border-radius: var(--ws-radius-sm); }

/* Buttons: the site's action button */
.ws-quote .ws-btn {
	display: block;
	width: 100%;
	margin: 24px 0 0;
	min-height: 54px;
	padding: 15px 22px;
	font: inherit;
	font-size: 17px;
	font-weight: 800;
	line-height: 1.2;
	color: var(--ws-white);
	background: var(--ws-action);
	border: 0;
	border-radius: var(--ws-radius-sm);
	cursor: pointer;
	text-align: center;
	text-transform: none;
	letter-spacing: 0;
	box-shadow: none;
}
.ws-quote .ws-btn:hover:not(:disabled) { background: var(--ws-action-hover); }
.ws-quote .ws-btn:focus-visible { outline: 3px solid var(--ws-focus); outline-offset: 3px; }
.ws-quote .ws-btn:disabled { background: #E3E8EC; color: #5B6875; cursor: not-allowed; }
.ws-quote .ws-btn.is-busy { background: var(--ws-action-hover); color: var(--ws-white); cursor: progress; }
.ws-quote .ws-btn--quiet { background: var(--ws-white); color: var(--ws-brand); border: 2px solid var(--ws-brand); }
.ws-quote .ws-btn--quiet:hover:not(:disabled) { background: var(--ws-cream); }

.ws-quote .ws-link {
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	color: var(--ws-action);
	background: none;
	border: 0;
	padding: 4px 0;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
	box-shadow: none;
	/* 44px-tall tap area without changing how it looks */
	min-height: 44px;
	margin: -7px 0;
}
.ws-quote .ws-link:hover { color: var(--ws-action-hover); }
.ws-quote .ws-link:focus-visible { outline: 3px solid var(--ws-focus); outline-offset: 2px; border-radius: 3px; }
.ws-where { margin: 0 0 12px; font-size: 15px; color: var(--ws-muted); display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; }
.ws-where span { font-weight: 700; color: var(--ws-brand); }

.ws-field { border: 0; margin: 24px 0 0; padding: 0; min-width: 0; }
.ws-legend { font-weight: 800; font-size: 17px; margin: 0 0 10px; padding: 0; }

/* Choices (placement, skip sizes): real radio inputs with styled cards.
   Selected = action-green border, pale green fill AND a tick badge (not colour alone). */
.ws-choice, .ws-size { position: relative; display: block; cursor: pointer; margin: 0; }
.ws-choice input, .ws-size input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ws-choices { display: grid; gap: 10px; }
.ws-choices--two { grid-template-columns: repeat(auto-fit, minmax(min(135px, 100%), 1fr)); }
.ws-choice__body, .ws-size__body {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	height: 100%;
	min-height: 64px;
	padding: 13px 44px 13px 15px;
	border: 1px solid var(--ws-line);
	border-radius: var(--ws-radius);
	background: var(--ws-white);
	box-shadow: 0 2px 8px rgba(19, 41, 61, .04);
	transition: border-color .12s ease, background-color .12s ease;
}
.ws-choice:hover .ws-choice__body, .ws-size:hover .ws-size__body { border-color: #9AA6B1; }
.ws-choice__title { font-weight: 700; }
.ws-choice__sub { font-size: 14px; color: var(--ws-muted); margin-top: 2px; }

/* Tick badge: empty ring = can be chosen; filled with a tick = chosen */
.ws-check { position: absolute; top: 12px; right: 12px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #AEB8C1; background: var(--ws-white); }
.ws-choice input:checked + .ws-choice__body,
.ws-size input:checked + .ws-size__body { border-color: var(--ws-action); background: var(--ws-action-pale); box-shadow: inset 0 0 0 1px var(--ws-action); }
.ws-choice input:checked + .ws-choice__body .ws-check,
.ws-size input:checked + .ws-size__body .ws-check { border-color: var(--ws-action); background: var(--ws-action); }
.ws-choice input:checked + .ws-choice__body .ws-check::after,
.ws-size input:checked + .ws-size__body .ws-check::after { content: ""; position: absolute; left: 6px; top: 2px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.ws-choice input:focus-visible + .ws-choice__body,
.ws-size input:focus-visible + .ws-size__body { outline: 3px solid var(--ws-focus); outline-offset: 2px; }

/* "When" rows: radio circle on the left */
.ws-choice--row .ws-choice__body { min-height: 54px; padding: 12px 15px 12px 48px; }
.ws-choice--row .ws-choice__body::before {
	content: "";
	position: absolute;
	left: 15px;
	top: 50%;
	width: 22px;
	height: 22px;
	margin-top: -11px;
	border: 2px solid #AEB8C1;
	border-radius: 50%;
	background: var(--ws-white);
}
.ws-choice--row input:checked + .ws-choice__body::before { border-color: var(--ws-action); background: var(--ws-action); box-shadow: inset 0 0 0 4px var(--ws-white); }
.ws-choice--row .ws-check { display: none; }

.ws-note { margin: 10px 0 0; padding: 11px 13px; font-size: 15px; background: var(--ws-warn-pale); border-left: 4px solid var(--ws-accent); border-radius: 6px; }

/* Skip sizes: any number of options, no per-quantity CSS. Desktop: --ws-cols (set by the plugin from the number of
   sizes) balances the rows, up to 4 across; a "help me choose" option takes its own full row. Phones: one per row. */
.ws-sizes { display: grid; grid-template-columns: repeat(var(--ws-cols, 3), minmax(0, 1fr)); gap: 10px; }
.ws-size { min-width: 0; }
.ws-size.ws-size--help { grid-column: 1 / -1; }
.ws-size__body { justify-content: flex-start; padding: 36px 12px 16px; text-align: center; align-items: center; } /* top band keeps the tick clear of the skip */
.ws-size__art { display: flex; align-items: flex-end; justify-content: center; height: 58px; margin: 4px 0 10px; }
.ws-skip { display: block; width: auto; height: calc(30px + 26px * var(--s, 1)); overflow: visible; }
.ws-skip--unknown { height: 40px; }
.ws-skip__body { fill: var(--ws-skip-yellow); stroke: var(--ws-skip-ink); stroke-width: 2.5; stroke-linejoin: round; }
.ws-skip__rim { fill: var(--ws-skip-ink); }
.ws-skip__lug { fill: var(--ws-skip-ink); }
.ws-skip__rib { stroke: rgba(30, 43, 39, .35); stroke-width: 2.5; fill: none; }
.ws-skip--unknown { color: #7A8794; }
.ws-size input:checked + .ws-size__body .ws-skip--unknown { color: var(--ws-action); }
.ws-size__text { display: block; }
.ws-size__title { display: block; font-weight: 800; font-size: 18px; line-height: 1.2; overflow-wrap: anywhere; }
.ws-size__sub { display: block; font-size: 13.5px; color: var(--ws-muted); margin-top: 4px; line-height: 1.35; }
.ws-size--help .ws-size__body { flex-direction: row; align-items: center; text-align: left; gap: 14px; min-height: 64px; padding: 13px 44px 13px 15px; }
.ws-size--help .ws-size__art { height: 40px; margin: 0; flex: 0 0 auto; }

.ws-date { margin-top: 12px; }
.ws-date .ws-label { margin-top: 0; }

.ws-consent { display: flex; gap: 12px; align-items: flex-start; margin: 22px 0 0; font-size: 15px; color: var(--ws-muted); cursor: pointer; }
.ws-consent input { flex: 0 0 auto; width: 24px; height: 24px; margin: 1px 0 0; accent-color: var(--ws-action); }
.ws-consent input:focus-visible { outline: 3px solid var(--ws-focus); outline-offset: 2px; }
.ws-consent a { color: var(--ws-action); font-weight: 700; }

.ws-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* Result screens */
.ws-result { outline: none; }
.ws-tick { width: 56px; height: 56px; border-radius: 50%; background: var(--ws-success); color: var(--ws-white); display: flex; align-items: center; justify-content: center; margin: 0 0 16px; }
.ws-tick svg { width: 30px; height: 30px; }
.ws-result__msg { margin: 6px 0 0; font-size: 17px; }
.ws-result__caller { margin: 12px 0 0; font-weight: 700; }
.ws-summary { margin: 22px 0 0; padding: 4px 16px; background: var(--ws-cream); border-radius: var(--ws-radius); }
.ws-summary__row { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--ws-line); }
.ws-summary__row:last-child { border-bottom: 0; }
.ws-summary dt { color: var(--ws-muted); margin: 0; }
.ws-summary dd { margin: 0; font-weight: 700; text-align: right; }

/* Phones: same design, comfortable spacing; nothing just shrunk */
@media (max-width: 600px) {
	.ws-quote { padding: 22px 18px 26px; border-radius: 12px; }
	.ws-quote .ws-h { font-size: 26px; }
	.ws-field { margin-top: 20px; }
	/* One option per row: skip on the left, name and description beside it, tick on the right. */
	.ws-quote .ws-sizes { grid-template-columns: 1fr; gap: 8px; }
	.ws-quote .ws-size__body { flex-direction: row; align-items: center; text-align: left; gap: 12px; min-height: 68px; padding: 11px 44px 11px 12px; }
	.ws-quote .ws-size__art { flex: 0 0 76px; height: 36px; margin: 0; align-items: center; }
	.ws-quote .ws-skip { height: calc(15px + 19px * var(--s, 1)); }
	.ws-quote .ws-skip--unknown { height: 26px; }
	.ws-quote .ws-check { top: 50%; margin-top: -11px; }
	.ws-size__title { font-size: 17px; }
}

@media (max-width: 360px) {
	.ws-quote { padding: 20px 14px 24px; }
	.ws-quote .ws-h { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
	.ws-progress__fill, .ws-choice__body, .ws-size__body { transition: none; }
}
