/**
 * TAF FileDrop: the Design Check Service (checkout card), and the expired-uploads
 * notice's rows (v1.11.0, on the cart and checkout; last section).
 *
 * The card is the checkout design's (v1.12.0, site redesign Phase 4b): a white
 * card with a 20px radius and a light border, the title, the "Recommended" pill,
 * the intro, two option rows (an 18px ring; on accept a 38px cyan tile with the
 * shield, and the price on the right) and the scope note. The root also carries
 * the TAF theme's taf-co-card class, which numbers it among checkout's cards;
 * this file draws the card in full either way. Every value reads a theme token
 * with a literal fallback (the --fd- set below), as taffd.css does, so the card
 * reads the same with another theme.
 */

.taffd-design-check {
	--fd-ink: var(--color-text, #1a1a1a);
	--fd-text-muted: var(--color-text-light, #666666);
	--fd-ground: var(--color-bg, #ffffff);
	--fd-border: var(--color-border-light, #EBEBEB);
	--fd-tile: var(--color-primary, #00AEEF);
	--fd-error: var(--state-error-text, #8A0052);
	--fd-focus: var(--focus-ring, #1a1a1a);
	/* Component-scoped, deliberately NOT aliased to the theme's --state-* tokens.
	   The accept/decline options are CHOICES, not outcomes: naming them as semantic
	   states would mean a future change to the success or info tint silently
	   restyles a radio button. The choice tints are the chosen option's ground,
	   the same grey for both, as the design draws it. --taffd-accent-ink is the
	   same value the theme calls --state-success-text, and is duplicated here for
	   the same reason: a badge should not inherit a success tone. */
	--taffd-accent-ink: #005C7F;
	--taffd-pill-bg: #E6F7FE;
	--taffd-choice-accept-bg: #F5F5F5;
	--taffd-choice-decline-bg: #F5F5F5;
	/* The unchosen ring in the muted ink, 5.74:1 on white, not the mock's #B3B3B3, which
	   measures 2.1:1 and fails 1.4.11's 3:1: with appearance: none the ring is the radio's
	   only edge (the theme's product.css takes the same grey for the picker's unset dash).
	   The mock's grey stays for the row's hover border, which is not the control's edge. */
	--taffd-ring: var(--color-text-light, #666666);
	--taffd-hover-border: #B3B3B3;
	--taffd-ring-size: 18px;
	--taffd-tile-size: 38px;
	--taffd-option-gap: 14px;
	display: flex;
	flex-direction: column;
	gap: 18px;
	margin: 1.5rem 0;
	padding: 26px;
	border: 1px solid var(--fd-border);
	border-radius: 20px;
	background: var(--fd-ground);
	color: var(--fd-ink);
}

/* The title on its own line, then the pill and, after a failed Place order,
   the inline error beside it. */
.taffd-design-check__header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 8px;
}

.taffd-design-check .taffd-design-check__title {
	flex: 1 0 100%;
	margin: 0;
	color: var(--fd-ink);
	font-size: 20px;
	font-weight: var(--font-weight-bold, 700);
	letter-spacing: -0.01em;
	line-height: 1.3;
}

.taffd-design-check__pill {
	display: inline-flex;
	align-items: center;
	height: 22px;
	padding: 0 9px;
	border-radius: 999px;
	background: var(--taffd-pill-bg);
	/* #005C7F on #E6F7FE; brand cyan there would fail 4.5:1. */
	color: var(--taffd-accent-ink);
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.04em;
	line-height: 1;
}

/* The inline error ("Please choose an option"), which taffd-checkout.js prints as
   #taffd-design-check_description after Place order with no choice, and removes on a
   choice. Two classes, so a theme's paragraph rule (the TAF theme's
   .taf-page-content p) does not reach it. */
.taffd-design-check .taffd-design-check__error {
	margin: 0;
	color: var(--fd-error);
	font-size: 13px;
	font-weight: var(--font-weight-semibold, 600);
	line-height: 1.4;
}

.taffd-design-check__description {
	color: var(--fd-text-muted);
	font-size: 15px;
	line-height: 1.6;
}

.taffd-design-check .taffd-design-check__description p {
	margin: 0;
	line-height: inherit;
}

.taffd-design-check__description strong {
	font-weight: var(--font-weight-semibold, 600);
}

.taffd-design-check__options {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

/* One option row. The whole row is the radio's label, so its hit area is the row,
   well over 44px tall. */
.taffd-design-check__option {
	display: flex;
	align-items: center;
	gap: var(--taffd-option-gap);
	margin: 0;
	padding: 16px;
	border: 1.5px solid var(--fd-border);
	border-radius: 16px;
	background: var(--fd-ground);
	color: var(--fd-ink);
	cursor: pointer;
	transition: border-color 120ms ease, background-color 120ms ease;
}

.taffd-design-check__option:hover {
	border-color: var(--taffd-hover-border);
}

/* Chosen: an ink border on the choice tint, and the ring's dot (below). */
.taffd-design-check__option--accept:has(input:checked) {
	border-color: var(--fd-ink);
	background: var(--taffd-choice-accept-bg);
}

.taffd-design-check__option--decline:has(input:checked) {
	border-color: var(--fd-ink);
	background: var(--taffd-choice-decline-bg);
}

/* Keyboard focus. The option is a <label> and is not focusable itself, so the ring is
   driven from the radio inside it. Ink deliberately, NOT the error magenta: a magenta
   ring would make every keyboard tab read as a validation failure. */
.taffd-design-check__option:has(input:focus-visible) {
	outline: 2px solid var(--fd-focus);
	outline-offset: 2px;
}

/* The radio, drawn as the design's ring: 2px, muted ink until chosen, then ink around an
   8px ink dot. It stays a native input, so the keyboard, the form post and :checked
   are the browser's own; its focus shows on the row (above). */
.taffd-design-check__option input[type="radio"] {
	flex-shrink: 0;
	-webkit-appearance: none;
	appearance: none;
	width: var(--taffd-ring-size);
	height: var(--taffd-ring-size);
	margin: 0;
	border: 2px solid var(--taffd-ring);
	border-radius: 50%;
	background: var(--fd-ground);
	cursor: pointer;
}

.taffd-design-check__option input[type="radio"]:checked {
	border-color: var(--fd-ink);
	background: radial-gradient(circle, var(--fd-ink) 0 4px, var(--fd-ground) 4.5px);
}

.taffd-design-check__option input[type="radio"]:focus {
	outline: none;
}

/* The accept option's tile: the shield in ink on brand cyan (6.88:1). */
.taffd-design-check__option-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: var(--taffd-tile-size);
	height: var(--taffd-tile-size);
	border-radius: 12px;
	background: var(--fd-tile);
	color: var(--fd-ink);
}

.taffd-design-check__option-icon svg {
	display: block;
	width: 20px;
	height: 20px;
}

/* The option's title over its sub-line. */
.taffd-design-check__option-body {
	display: flex;
	flex-direction: column;
	gap: 3px;
	flex: 1 1 auto;
	min-width: 0;
}

.taffd-design-check__label {
	color: var(--fd-ink);
	font-size: 15px;
	font-weight: var(--font-weight-bold, 700);
	line-height: 1.4;
}

.taffd-design-check__support {
	color: var(--fd-text-muted);
	font-size: 13px;
	line-height: 1.45;
}

.taffd-design-check__price {
	flex-shrink: 0;
	color: var(--fd-ink);
	font-weight: var(--font-weight-bold, 700);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.taffd-design-check .taffd-design-check__scope-note {
	margin: 0;
	color: var(--fd-text-muted);
	font-size: 12.5px;
	line-height: 1.5;
}

/* Invalid: set by taffd-checkout.js when checkout's error names the Design Check, and
   cleared on a choice. Both options' borders turn the error ink (#8A0052, 8.4:1 on
   white), and the inline error shows beside the pill. The card keeps its own border:
   no glow, no tint. */
.taffd-design-check.is-invalid .taffd-design-check__option {
	border-color: var(--fd-error);
}

@media (prefers-reduced-motion: reduce) {
	.taffd-design-check__option {
		transition: none;
	}
}

/* Phones: a tighter card, and the price drops under the accept option's text,
   lined up with it. FileDrop's own breakpoint, not a copy of the theme's mobile
   query. */
@media (max-width: 640px) {
	.taffd-design-check {
		--taffd-option-gap: 12px;
		padding: 20px;
	}
	.taffd-design-check__option {
		flex-wrap: wrap;
		row-gap: 6px;
		padding: 14px;
	}
	.taffd-design-check__option-body {
		flex: 1 1 0;
	}
	.taffd-design-check__price {
		flex-basis: 100%;
		padding-left: calc(var(--taffd-ring-size) + var(--taffd-tile-size) + 2 * var(--taffd-option-gap));
	}
}

/* ── The expired-uploads notice (v1.11.0) ──
   FileDrop's own taffd-reupload markup inside a WooCommerce error notice, on the
   cart and on checkout (enqueue_checkout_assets() loads this sheet on both). The
   box is the theme's; this styles what FileDrop prints in it: the title and body,
   then one white row per product with its name, its missing files as mono chips
   and its Re-upload link as a black 36px pill with a 44px hit area. Every value
   reads a theme token with a literal fallback (the --fd- set below), so the rows
   read the same with another theme. Scoped by .woocommerce-error, the class
   WooCommerce prints on every error notice, with or without the TAF theme. */
.woocommerce-error .taffd-reupload__title,
.woocommerce-error .taffd-reupload__body,
.woocommerce-error .taffd-reupload__list {
	--fd-text: var(--color-text, #1a1a1a);
	--fd-text-muted: var(--color-text-light, #666666);
	--fd-ground: var(--color-bg, #ffffff);
	--fd-surface-muted: var(--color-bg-muted, #F5F5F5);
	--fd-primary: var(--color-primary, #00AEEF);
	--fd-radius-full: var(--radius-full, 999px);
	--fd-mono: var(--font-mono, ui-monospace, Menlo, monospace);
	--fd-focus: var(--focus-ring, #1a1a1a);
	--fd-ease: var(--ease-out-fast, 0.2s ease-out);
}

/* The title and body set their margins and line heights in full: a theme's
   paragraph rule (the TAF theme's .taf-page-content p: a 1.5rem bottom margin,
   a 1.8 line height) would otherwise reach them on the cart and checkout. The
   title takes the box's line height, so the box's square sits on its line. */
.woocommerce-error .taffd-reupload__title {
	margin: 0;
	line-height: inherit;
}

.woocommerce-error .taffd-reupload__body {
	margin: 4px 0 0;
	color: var(--fd-text-muted);
	font-size: 14px;
	font-weight: var(--font-weight-normal, 400);
	line-height: 1.5;
}

.woocommerce-error .taffd-reupload__list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 14px 0 0;
	padding: 0;
	list-style: none;
}

/* The name over the chips, the pill beside both. The rows' 10px radius sits
   inside the theme box's 12px. */
.woocommerce-error .taffd-reupload__row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: 8px 16px;
	margin: 0;
	padding: 12px 12px 12px 16px;
	border-radius: 10px;
	background: var(--fd-ground);
}

.woocommerce-error .taffd-reupload__name {
	grid-column: 1;
	color: var(--fd-text);
	font-size: 13.5px;
	font-weight: var(--font-weight-bold, 700);
	line-height: 1.4;
}

.woocommerce-error .taffd-reupload__files {
	grid-column: 1;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.woocommerce-error .taffd-reupload__files code {
	display: inline-block;
	max-width: 100%;
	padding: 4px 10px;            /* 26px tall on one line; a long name wraps */
	border-radius: var(--fd-radius-full);
	background: var(--fd-surface-muted);
	color: var(--fd-text);
	font-family: var(--fd-mono);
	font-size: 12px;
	font-weight: var(--font-weight-normal, 400);
	line-height: 18px;
	overflow-wrap: anywhere;
}

.woocommerce-error .taffd-reupload__button {
	position: relative;
	grid-column: 2;
	grid-row: 1 / span 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 36px;
	padding: 0 14px;
	border: 1.5px solid var(--fd-text);
	border-radius: var(--fd-radius-full);
	background: var(--fd-text);
	color: var(--fd-ground);
	font-size: 12.5px;
	font-weight: var(--font-weight-semibold, 600);
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	transition: background var(--fd-ease), border-color var(--fd-ease), color var(--fd-ease);
}

.woocommerce-error .taffd-reupload__button::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	height: 44px;
	transform: translateY(-50%);
}

/* Cyan with ink on it (6.88:1), as the theme's pills hover. */
.woocommerce-error .taffd-reupload__button:hover {
	border-color: var(--fd-primary);
	background: var(--fd-primary);
	color: var(--fd-text);
}

.woocommerce-error .taffd-reupload__button:focus-visible {
	outline: 2px solid var(--fd-focus);
	outline-offset: 2px;
}

/* Phones: each row stacks, the name, the chips, then Re-upload at full width
   and 44px. FileDrop's own breakpoint, the one this file's Design Check card
   uses, not a copy of the theme's mobile query. */
@media (max-width: 640px) {
	.woocommerce-error .taffd-reupload__row {
		grid-template-columns: minmax(0, 1fr);
		padding: 12px;
	}

	.woocommerce-error .taffd-reupload__button {
		grid-column: 1;
		grid-row: auto;
		height: 44px;
		font-size: 13.5px;
	}
}
