/* =============================================================================
   Form controls shared across templates.

   This file exists because the same control was being drawn twice. The
   checkout tick boxes live in woocommerce.css and the contact form's privacy
   tick lives in contact.css; the two pages load different stylesheets, so the
   component had to be written out in both and the two copies were free to
   drift apart. Site-wide and tiny, so there is one definition.

   Only genuinely shared controls belong here. Anything that is true of one
   page stays on that page - see the optical nudge in woocommerce.css, which
   is about where a box sits next to its label, not what the box looks like.
   ============================================================================= */

:root {
	/* The Siegel tick.

	   The red is written into the SVG rather than read from --fig-siegel-red,
	   because a data: URI cannot see a custom property. It is #d41927, the
	   value that token carries, which is also the button red - the tick is
	   meant to match the button. Change one, change the other. */
	--siegel-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23d41927' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.4l3.1 3.1L12.5 5'/%3E%3C/svg%3E");
}

/* ── Checkbox ─────────────────────────────────────────────────────────────
   White box, hairline border, brand-red tick.

   appearance:none because both browsers' own rendering and Gravity Forms'
   were wrong in opposite directions. accent-color at checkout drew a SOLID
   RED BOX with a white tick, the inverse of the design. On the contact form
   accent-color did nothing at all, because GF's theme framework had already
   set appearance:none - and GF drew the tick itself with a ::before in
   #204ce5, its theme's primary, which was the one blue thing on the page.

   Drawing it here settles both, and stops the contact form depending on GF
   internals that a plugin update is free to rename.

   The selector list is long on purpose, and it now covers WooCommerce's own
   boxes too. Signed out, the checkout was showing FOUR different checkboxes
   at once, measured on the live page:

     create an account        18px, appearance:auto, native red fill
     ship to a different..    18px, drawn box, solid red when ticked
     remember me              16px, drawn box, solid red when ticked
     forklift / terms         20px, white box, red tick

   One control now. A bare input[type="checkbox"] rule would still be wrong -
   it would claim the admin bar, plugin fields and anything else that turns
   up - so the list is explicit and grows by hand. */
.siegel-forklift__input,
.siegel-terms__input,
.wc-content__inner #ship-to-different-address input[type="checkbox"],
.wc-content__inner .woocommerce-form__input-checkbox,
.contact-gravity-form .gform_fields .siegel-gf-privacy input[type="checkbox"] {
	appearance: none;
	-webkit-appearance: none;
	flex: 0 0 20px;
	box-sizing: border-box;
	width: 20px;
	height: 20px;
	margin: 0;
	border: 1px solid var(--fig-neutral-100);
	border-radius: var(--r-sm);
	background: var(--fig-siegel-white) center / 14px 14px no-repeat;
	cursor: pointer;
}

/* Gravity Forms draws its own tick in a pseudo-element. Ours is a background,
   so without this both would show. */
.contact-gravity-form .gform_fields .siegel-gf-privacy input[type="checkbox"]::before {
	content: none;
}

.siegel-forklift__input:checked,
.siegel-terms__input:checked,
.wc-content__inner #ship-to-different-address input[type="checkbox"]:checked,
.wc-content__inner .woocommerce-form__input-checkbox:checked,
.contact-gravity-form .gform_fields .siegel-gf-privacy input[type="checkbox"]:checked {
	background-image: var(--siegel-check);
}

/* The old ship-to rule drew a white tick on a solid red fill with its own
   ::after. The fill is gone, so the ::after has to go with it or a second
   tick prints over the first. */
.wc-content__inner #ship-to-different-address input[type="checkbox"]::after,
.wc-content__inner #ship-to-different-address input[type="checkbox"]:checked::after {
	content: none;
}

.siegel-forklift__input:focus-visible,
.siegel-terms__input:focus-visible,
.wc-content__inner #ship-to-different-address input[type="checkbox"]:focus-visible,
.wc-content__inner .woocommerce-form__input-checkbox:focus-visible,
.contact-gravity-form .gform_fields .siegel-gf-privacy input[type="checkbox"]:focus-visible {
	outline: 2px solid var(--btn-stroke-focused);
	outline-offset: 2px;
}
