/**
 * TNC Grading Submissions - customer form.
 *
 * Every brand token is declared on .tncgs-form itself, never on :root and
 * never on a bare element selector. WoodMart owns the page; this form
 * borrows its typography and adds nothing that can leak out of this one
 * container.
 *
 * Contrast, checked rather than assumed: #060928 on #f5f4f2 is roughly
 * 17:1, and #060928 on #FCB040 roughly 9:1 - both clear AA and AAA for
 * body text. The accent is therefore only ever a fill, a border or a
 * focus ring, never text on a light background, where it would fail.
 */

.tncgs-form {
	--tncgs-accent: #FCB040;
	--tncgs-ink: #060928;
	--tncgs-paper: #f5f4f2;
	--tncgs-white: #ffffff;
	--tncgs-rule: rgba(6, 9, 40, 0.14);
	--tncgs-muted: rgba(6, 9, 40, 0.68);
	--tncgs-danger: #9b1c1c;
	--tncgs-radius: 5px;
	--tncgs-gap: 1rem;

	color: var(--tncgs-ink);
	background: var(--tncgs-paper);
	border-radius: var(--tncgs-radius);
	padding: clamp(1rem, 4vw, 2rem);
	font-family: inherit;
	line-height: 1.55;
}

.tncgs-form *,
.tncgs-form *::before,
.tncgs-form *::after {
	box-sizing: border-box;
}

/* Steps and headings -------------------------------------------------- */

.tncgs-step-title {
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--tncgs-ink);
	margin: 0 0 var(--tncgs-gap);
}

.tncgs-card-title {
	font-size: 1rem;
	font-weight: 600;
	margin: 0;
}

.tncgs-loading,
.tncgs-hint,
.tncgs-count {
	color: var(--tncgs-muted);
	font-size: 0.875rem;
	margin: 0.25rem 0 0;
}

/* Card rows ----------------------------------------------------------- */

.tncgs-card-row {
	background: var(--tncgs-white);
	border: 1px solid var(--tncgs-rule);
	border-radius: var(--tncgs-radius);
	padding: var(--tncgs-gap);
	margin-bottom: var(--tncgs-gap);
}

.tncgs-card-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	margin-bottom: 0.75rem;
}

.tncgs-card-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--tncgs-gap);
}

/* Fields -------------------------------------------------------------- */

.tncgs-field {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	min-width: 0;
}

.tncgs-field label {
	font-weight: 600;
	font-size: 0.9375rem;
}

.tncgs-input {
	width: 100%;
	padding: 0.625rem 0.75rem;
	border: 1px solid var(--tncgs-rule);
	border-radius: var(--tncgs-radius);
	background: var(--tncgs-white);
	color: var(--tncgs-ink);
	font: inherit;
	/* 16px on mobile, so iOS does not zoom the page on focus. */
	font-size: 1rem;
}

.tncgs-input:focus-visible,
.tncgs-form button:focus-visible,
.tncgs-form input:focus-visible,
.tncgs-form a:focus-visible {
	outline: 3px solid var(--tncgs-accent);
	outline-offset: 2px;
}

.tncgs-error {
	color: var(--tncgs-danger);
	font-size: 0.875rem;
	font-weight: 600;
	margin: 0;
	min-height: 1px;
}

.tncgs-input[aria-invalid="true"] {
	border-color: var(--tncgs-danger);
}

/* Choices ------------------------------------------------------------- */

.tncgs-fieldset {
	border: 1px solid var(--tncgs-rule);
	border-radius: var(--tncgs-radius);
	padding: var(--tncgs-gap);
	margin: 0 0 var(--tncgs-gap);
	background: var(--tncgs-white);
}

.tncgs-legend {
	font-weight: 700;
	padding: 0 0.35rem;
}

.tncgs-radio,
.tncgs-terms {
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
	padding: 0.45rem 0;
	cursor: pointer;
}

.tncgs-radio input,
.tncgs-terms input {
	/* Comfortably past the 24x24 AA target once padding is counted. */
	width: 1.25rem;
	height: 1.25rem;
	margin: 0.15rem 0 0;
	accent-color: var(--tncgs-ink);
	flex: 0 0 auto;
}

.tncgs-terms {
	background: var(--tncgs-white);
	border: 1px solid var(--tncgs-rule);
	border-radius: var(--tncgs-radius);
	padding: var(--tncgs-gap);
	margin-bottom: var(--tncgs-gap);
	flex-wrap: wrap;
}

.tncgs-terms a {
	color: var(--tncgs-ink);
	text-decoration: underline;
}

.tncgs-note {
	background: var(--tncgs-white);
	border-left: 4px solid var(--tncgs-accent);
	border-radius: var(--tncgs-radius);
	padding: 0.75rem var(--tncgs-gap);
	margin: 0 0 var(--tncgs-gap);
}

.tncgs-note p {
	margin: 0 0 0.4rem;
}

.tncgs-note p:last-child {
	margin-bottom: 0;
}

/* Summary ------------------------------------------------------------- */

.tncgs-summary {
	background: var(--tncgs-white);
	border: 1px solid var(--tncgs-rule);
	border-radius: var(--tncgs-radius);
	padding: var(--tncgs-gap);
	margin: var(--tncgs-gap) 0;
}

.tncgs-summary-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 0.5rem;
}

.tncgs-summary-table th,
.tncgs-summary-table td {
	text-align: left;
	padding: 0.4rem 0;
	border-bottom: 1px solid var(--tncgs-rule);
	font-weight: 400;
}

.tncgs-summary-table td {
	text-align: right;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.tncgs-summary-table .tncgs-total th,
.tncgs-summary-table .tncgs-total td {
	font-weight: 700;
	font-size: 1.0625rem;
	border-bottom: none;
	border-top: 2px solid var(--tncgs-ink);
	padding-top: 0.6rem;
}

/* Buttons ------------------------------------------------------------- */

.tncgs-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: center;
	margin: var(--tncgs-gap) 0;
}

.tncgs-button {
	font: inherit;
	font-weight: 700;
	border-radius: var(--tncgs-radius);
	padding: 0.7rem 1.25rem;
	cursor: pointer;
	/* 44px minimum touch target. */
	min-height: 44px;
	border: 2px solid var(--tncgs-ink);
}

.tncgs-button--primary {
	background: var(--tncgs-accent);
	color: var(--tncgs-ink);
	border-color: var(--tncgs-accent);
}

.tncgs-button--primary:hover:not(:disabled) {
	background: var(--tncgs-ink);
	color: var(--tncgs-accent);
	border-color: var(--tncgs-ink);
}

.tncgs-button--ghost {
	background: transparent;
	color: var(--tncgs-ink);
}

.tncgs-button--ghost:hover:not(:disabled) {
	background: var(--tncgs-ink);
	color: var(--tncgs-paper);
}

.tncgs-button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.tncgs-remove {
	font: inherit;
	font-size: 0.875rem;
	background: transparent;
	border: 1px solid var(--tncgs-rule);
	border-radius: var(--tncgs-radius);
	color: var(--tncgs-ink);
	padding: 0.35rem 0.7rem;
	min-height: 32px;
	cursor: pointer;
}

.tncgs-remove:hover {
	border-color: var(--tncgs-danger);
	color: var(--tncgs-danger);
}

/* Notices ------------------------------------------------------------- */

.tncgs-notice {
	border-radius: var(--tncgs-radius);
	padding: 0.85rem var(--tncgs-gap);
	margin: 0 0 var(--tncgs-gap);
	background: var(--tncgs-white);
	border-left: 4px solid var(--tncgs-ink);
}

.tncgs-notice--error {
	border-left-color: var(--tncgs-danger);
	color: var(--tncgs-danger);
	font-weight: 600;
}

.tncgs-notice ul {
	margin: 0.4rem 0 0 1.1rem;
}

/* Wider screens ------------------------------------------------------- */

@media (min-width: 40rem) {
	.tncgs-card-grid {
		grid-template-columns: 2fr 1.5fr 1fr;
		align-items: start;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tncgs-form * {
		transition: none !important;
	}
}

/* Disclosures ---------------------------------------------------------
 *
 * Everything a customer needs to know, folded under the form. Native
 * <details>, with no JavaScript anywhere near it — not a preference:
 * this store is behind Cloudflare's WAF, where an inline handler is a
 * blocked request. A browser also opens a <details> that a fragment
 * targets, which is how the terms link in the form reaches the terms
 * text without a line of script.
 */

.tncgs-form .tncgs-help-panel {
	margin-top: 2rem;
	border-top: 2px solid var(--tncgs-rule);
	padding-top: 1.25rem;
}

.tncgs-form .tncgs-help-panel > h2 {
	font-size: 1.05rem;
	margin: 0 0 0.75rem;
}

.tncgs-form .tncgs-help-panel > .tncgs-hint {
	margin: 0 0 1rem;
}

.tncgs-form .tncgs-disclose {
	border: 1px solid var(--tncgs-rule);
	border-radius: var(--tncgs-radius);
	background: var(--tncgs-white);
	margin-bottom: 0.5rem;
	overflow: hidden;
}

.tncgs-form .tncgs-disclose > summary {
	list-style: none;
	cursor: pointer;
	padding: 0.85rem 1rem 0.85rem 2.4rem;
	position: relative;
	font-weight: 600;
	color: var(--tncgs-ink);
}

.tncgs-form .tncgs-disclose > summary::-webkit-details-marker {
	display: none;
}

/* A chevron drawn from two borders, so no icon font and no SVG request. */
.tncgs-form .tncgs-disclose > summary::before {
	content: "";
	position: absolute;
	left: 1rem;
	top: 1.15rem;
	width: 0.5rem;
	height: 0.5rem;
	border-right: 2px solid var(--tncgs-ink);
	border-bottom: 2px solid var(--tncgs-ink);
	transform: rotate(-45deg);
	transition: transform 0.15s ease;
}

.tncgs-form .tncgs-disclose[open] > summary::before {
	transform: rotate(45deg);
	top: 0.95rem;
}

@media (prefers-reduced-motion: reduce) {
	.tncgs-form .tncgs-disclose > summary::before {
		transition: none;
	}
}

.tncgs-form .tncgs-disclose > summary:focus-visible {
	outline: 3px solid var(--tncgs-accent);
	outline-offset: -3px;
}

.tncgs-form .tncgs-disclose__sub {
	display: block;
	font-weight: 400;
	color: var(--tncgs-muted);
	font-size: 0.9em;
}

.tncgs-form .tncgs-disclose__body {
	padding: 0 1rem 1rem 2.4rem;
}

.tncgs-form .tncgs-disclose__body > :first-child {
	margin-top: 0;
}

.tncgs-form .tncgs-disclose__body > :last-child {
	margin-bottom: 0;
}

.tncgs-form .tncgs-disclose__body address {
	font-style: normal;
}

.tncgs-form .tncgs-disclose__body ol {
	padding-left: 1.2rem;
}

.tncgs-form .tncgs-disclose__body li {
	margin-bottom: 0.5rem;
}

/* The terms are a decision, not a disclosure. The panel is marked out so
   it does not read as one more optional thing to skip, and the version
   line sits outside the fold — it is what the store will be asked about. */
.tncgs-form .tncgs-terms-block {
	border: 1px solid var(--tncgs-rule);
	border-left: 3px solid var(--tncgs-accent);
	border-radius: var(--tncgs-radius);
	background: var(--tncgs-white);
	padding: 0.35rem 1rem 1rem;
	margin-bottom: 0.5rem;
}

.tncgs-form .tncgs-terms-block .tncgs-disclose {
	border: 0;
	margin: 0;
	background: transparent;
}

.tncgs-form .tncgs-terms-block .tncgs-disclose > summary {
	padding-left: 1.4rem;
	font-size: 0.95rem;
}

.tncgs-form .tncgs-terms-block .tncgs-disclose > summary::before {
	left: 0;
}

.tncgs-form .tncgs-terms-block .tncgs-disclose__body {
	padding: 0.5rem 0 0 1.4rem;
}

.tncgs-form .tncgs-terms-version {
	font-size: 0.8rem;
	color: var(--tncgs-muted);
	margin: 0.6rem 0 0;
}
