/**
 * Typography scale. Sizes are relative (em) so fields inherit the theme's
 * body size; only the relationships between them are ours. Two weights, so
 * "emphasis" always means the same thing.
 *
 * Rule: apply a token only where the parent sets no font-size. Inside an
 * element that already carries one (e.g. .clcf-file-item), inherit instead —
 * em multiplies down the tree.
 */
:root {
	--clcf-fs-sm: 0.85em;   /* help text, file names, status */
	--clcf-fs-md: 1em;      /* labels and controls — the same size, so a label
	                           never looks smaller than the field it names */
	--clcf-fs-lg: 1.15em;   /* section headings */
	--clcf-fw-med: 500;     /* choice labels — interactive, not shouty */
	--clcf-fw-strong: 600;  /* field labels, buttons, headings */
}

/* Alovio Checkout Fields — checkout-facing styles (classic checkout).
   One consistent visual language for ALL field types; the Block checkout gets
   the same vocabulary via build/style-block-checkout.css. */

.clcf-fields {
	margin: 18px 0;
}

/* Two-column layout: half-width fields sit side by side, stack on mobile. */
.clcf-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 18px 16px;
}
.clcf-grid .clcf-w-full { grid-column: 1 / -1; }
@media ( max-width: 600px ) {
	.clcf-grid { grid-template-columns: 1fr; }
	.clcf-grid .clcf-w-half { grid-column: 1 / -1; }
}

.clcf-field { margin: 0; padding: 0; }

/* ── Labels & descriptions ─────────────────────────────────── */
.clcf-field__label {
	display: block;
	font-weight: var(--clcf-fw-strong);
	font-size: var(--clcf-fs-md);
	margin-bottom: 7px;
	line-height: 1.35;
}
.clcf-field__label abbr.required {
	color: #dc2626;
	text-decoration: none;
	border: none;
	margin-left: 2px;
}
.clcf-field__desc {
	display: block;
	color: #6b7280;
	font-size: var(--clcf-fs-sm);
	line-height: 1.45;
	margin: -3px 0 7px;
}

/* ── Text-like inputs — every type, one look ───────────────── */
.clcf-field input[type="text"],
.clcf-field input[type="email"],
.clcf-field input[type="tel"],
.clcf-field input[type="url"],
.clcf-field input[type="number"],
.clcf-field input[type="date"],
.clcf-field input[type="time"],
.clcf-field select,
.clcf-field textarea {
	display: block;
	width: 100%;
	min-height: 46px;
	padding: 11px 14px;
	border: 1.5px solid #d7d9de;
	border-radius: 10px;
	background: #fff;
	color: inherit;
	font: inherit;
	line-height: 1.4;
	box-sizing: border-box;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}
.clcf-field select {
	background-image: url( "data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E" );
	background-repeat: no-repeat;
	background-position: right 14px center;
	padding-right: 38px;
}
.clcf-field input[type="date"],
.clcf-field input[type="time"] {
	-webkit-appearance: auto;
	appearance: auto; /* keep native pickers, inherit the box style */
}
.clcf-field textarea { min-height: 92px; resize: vertical; }

.clcf-field input:hover,
.clcf-field select:hover,
.clcf-field textarea:hover { border-color: #b9bdc4; }

.clcf-field input:focus,
.clcf-field input:focus-visible,
.clcf-field select:focus,
.clcf-field select:focus-visible,
.clcf-field textarea:focus,
.clcf-field textarea:focus-visible {
	outline: none;
	border-color: #f97316;
	box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}
.clcf-field ::placeholder { color: #9ca3af; }

/* ── Checkbox & radio: tappable boxed rows ─────────────────── */
.clcf-checkbox,
.clcf-opt {
	display: flex;
	align-items: center;
	gap: 11px;
	padding: 12px 14px;
	border: 1.5px solid #d7d9de;
	border-radius: 10px;
	background: #fff;
	font-weight: var(--clcf-fw-med);
	cursor: pointer;
	margin: 0;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}
.clcf-opt + .clcf-opt { margin-top: 8px; }
.clcf-checkbox:hover,
.clcf-opt:hover { border-color: #fdba74; }
.clcf-checkbox:has( input:checked ),
.clcf-opt:has( input:checked ) {
	border-color: #f97316;
	background: #fff7ed;
}
.clcf-checkbox input[type="checkbox"],
.clcf-opt input[type="radio"] {
	width: 19px;
	height: 19px;
	margin: 0;
	flex: none;
	accent-color: #f97316;
	cursor: pointer;
}
.clcf-checkbox .required, .clcf-opt .required { margin-left: 2px; }

/* ── File upload: drop-zone look on the native input ───────── */
.clcf-field input[type="file"].clcf-file-picker {
	display: block;
	width: 100%;
	padding: 12px;
	border: 1.5px dashed #c9ccd2;
	border-radius: 10px;
	background: #fafafa;
	box-sizing: border-box;
	font: inherit;
	color: #6b7280;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}
.clcf-field input[type="file"].clcf-file-picker:hover {
	border-color: #f97316;
	background: #fff7ed;
}
.clcf-field input[type="file"].clcf-file-picker:focus-visible {
	outline: none;
	border-color: #f97316;
	box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}
.clcf-field input[type="file"].clcf-file-picker::file-selector-button {
	font: inherit;
	font-weight: var(--clcf-fw-strong);
	color: #1f2328;
	background: #fff;
	border: 1.5px solid #d7d9de;
	border-radius: 8px;
	padding: 8px 14px;
	margin-right: 12px;
	cursor: pointer;
	transition: border-color 0.15s ease;
}
.clcf-field input[type="file"].clcf-file-picker:hover::file-selector-button {
	border-color: #f97316;
	color: #ea580c;
}
.clcf-file-status {
	display: block;
	margin-top: 7px;
	font-size: var(--clcf-fs-sm);
	color: #6b7280;
}
.clcf-file-status:not( :empty ) { color: #047857; font-weight: var(--clcf-fw-strong); }

/* ── Heading fields ────────────────────────────────────────── */
.clcf-field--heading .clcf-heading {
	font-size: var(--clcf-fs-lg);
	font-weight: var(--clcf-fw-strong);
	margin: 8px 0 2px;
}

/* ── Validation state (WooCommerce toggles these classes) ──── */
.clcf-field.woocommerce-invalid input,
.clcf-field.woocommerce-invalid select,
.clcf-field.woocommerce-invalid textarea {
	border-color: #dc2626;
	box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

/* Multi-file uploads: one removable row per attached file. */
.clcf-file-list { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.clcf-file-list:empty { display: none; }
.clcf-file-item {
	display: inline-flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	font-size: var(--clcf-fs-sm);
	padding: 5px 10px;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 6px;
	background: rgba(0, 0, 0, 0.03);
}
.clcf-file-item__name { overflow-wrap: anywhere; }
.clcf-file-remove {
	border: 0;
	background: none;
	cursor: pointer;
	/* Inherit, never a token: this button sits INSIDE .clcf-file-item, which
	   is already 0.85em — an em token here would multiply (0.85 x 1.15) and
	   land somewhere nobody chose. Tokens are for elements whose parent
	   carries no size of its own. */
	font-size: inherit;
	line-height: 1;
	padding: 2px 6px;
	color: inherit;
	opacity: 0.55;
	transition: opacity 0.12s ease;
}
.clcf-file-remove:hover,
.clcf-file-remove:focus-visible { opacity: 1; }
