/*
 * Portal look: My account pages, the repair request form, cart and checkout (body.frr-portal).
 * A soft tinted page with white cards, stronger type, a real account menu and coloured status badges.
 * Uses WooCommerce's own classes, so it works with any theme; the theme still supplies fonts.
 */
body.frr-portal {
	--frr-ink: #10292a;
	--frr-ink-soft: #4d6162;
	--frr-page: #f0f5f5;
	--frr-line: #d8e3e3;
	--frr-tint: #e4efef;
	--frr-radius-card: 12px;
	--frr-shadow: 0 1px 2px rgba(16, 41, 42, 0.05), 0 6px 20px rgba(16, 41, 42, 0.06);
	background-color: var(--frr-page);
	color: var(--frr-ink);
}

/* Header and footer stay white, framing the tinted page. */
body.frr-portal header.wp-block-template-part {
	background: #fff;
	border-bottom: 1px solid var(--frr-line);
}

body.frr-portal footer.wp-block-template-part {
	margin-top: 3em;
	background: #fff;
	border-top: 1px solid var(--frr-line);
}

/* Regular-weight text and firmer headings instead of the theme's light weight. Body text at 16px: the
   theme's default Large (up to 22px) suits blog posts, not a portal. */
body.frr-portal main {
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.55;
}

body.frr-portal main h1 {
	color: var(--frr-ink);
	font-weight: 600;
	letter-spacing: -0.02em;
}

/* Log in, Create an account and the password pages: the title centred over the centred form card. */
body.frr-portal:is(.frr-auth-login, .frr-auth-register, .woocommerce-lost-password) main h1.wp-block-post-title {
	text-align: center;
}

body.frr-portal main :is(h2, h3) {
	color: var(--frr-ink);
	font-weight: 600;
}

body.frr-portal :is(.woocommerce-MyAccount-content, .frr-request) h3 {
	margin: 1.75em 0 0.6em;
	font-size: 1.1em;
}

body.frr-portal .frr-dashboard .frr-flow-title {
	margin: 0.1em 0 0.3em;
}

body.frr-portal :is(.woocommerce-MyAccount-content, .frr-section) > h3:first-child,
body.frr-portal .frr-section > :first-child > h3:first-child,
body.frr-portal :is(.frr-invoice-box, .frr-decision-box, .frr-ship-box, .frr-dashboard-cta) h3:first-child,
body.frr-portal .frr-section > legend h3 {
	margin-top: 0;
}

/* ---------------------------------------------------------------- Cards */

body.frr-portal .woocommerce-MyAccount-content,
body.frr-portal .frr-section,
body.frr-portal :is(.woocommerce-form-login, .woocommerce-form-register, .woocommerce-ResetPassword) {
	box-sizing: border-box;
	padding: clamp(1.25em, 3vw, 2em);
	border: 1px solid var(--frr-line);
	border-radius: var(--frr-radius-card);
	background: #fff;
	box-shadow: var(--frr-shadow);
}

/* One form at a time (LoginForms): Log in, or Create an account. Full width, which also leaves room for the
   bot check box. Without registration both classes are absent and WooCommerce's layout stays. */
body.frr-portal #customer_login :is(.u-column1, .u-column2) {
	float: none;
	width: 100%;
	max-width: 32rem;
	margin: 0 auto 1.25em;
}

/* Lost password and set a new password: the same card and width as Log in. */
body.frr-portal .woocommerce-ResetPassword {
	max-width: 32rem;
	margin: 0 auto 1.25em;
}

body.frr-portal .woocommerce-ResetPassword .form-row {
	float: none;
	width: 100%;
}

body.frr-auth-login #customer_login .u-column2,
body.frr-auth-register #customer_login .u-column1 {
	display: none;
}

body.frr-portal .frr-auth-switch {
	margin: 1em 0 0;
	text-align: center;
}

body.frr-portal .frr-section {
	margin: 0 0 1.25em;
	min-width: 0;
}

body.frr-portal fieldset.frr-section > legend {
	float: left; /* Keeps the legend inside the card instead of on its border. */
	width: 100%;
	margin: 0 0 0.6em;
	padding: 0;
}

body.frr-portal fieldset.frr-section > legend + * {
	clear: both;
}

/* ---------------------------------------------------------------- Account menu */

body.frr-portal .woocommerce-MyAccount-navigation ul {
	margin: 0;
	padding: 0.5em;
	list-style: none;
	border: 1px solid var(--frr-line);
	border-radius: var(--frr-radius-card);
	background: #fff;
	box-shadow: var(--frr-shadow);
}

body.frr-portal .woocommerce-MyAccount-navigation ul li {
	margin: 0;
	padding: 0;
	border: 0;
}

body.frr-portal .woocommerce-MyAccount-navigation ul li a {
	display: block;
	padding: 0.6em 0.9em;
	border-radius: 8px;
	color: var(--frr-ink);
	text-decoration: none !important; /* The theme underlines the current page. */
}

body.frr-portal .woocommerce-MyAccount-navigation ul li a:hover {
	background: var(--frr-page);
}

body.frr-portal .woocommerce-MyAccount-navigation ul li.is-active a {
	background: var(--frr-tint);
	box-shadow: inset 3px 0 0 var(--frr-brand, #01696e);
	color: var(--frr-brand-dark, #014f53);
	font-weight: 600;
}

body.frr-portal .woocommerce-MyAccount-navigation-link--customer-logout {
	margin-top: 0.35em !important;
	padding-top: 0.35em !important;
	border-top: 1px solid var(--frr-line) !important;
}

/* Phones: the menu becomes tabs that wrap onto a second row, so every item stays in view. */
@media (max-width: 768px) {
	body.frr-portal .woocommerce-MyAccount-navigation {
		margin-bottom: 1.25em;
	}

	body.frr-portal .woocommerce-MyAccount-navigation ul {
		display: flex;
		flex-wrap: wrap;
		gap: 0.25em;
	}

	body.frr-portal .woocommerce-MyAccount-navigation ul li a {
		padding: 0.5em 0.75em;
		white-space: nowrap;
	}

	body.frr-portal .woocommerce-MyAccount-navigation ul li.is-active a {
		box-shadow: inset 0 -3px 0 var(--frr-brand, #01696e);
	}

	body.frr-portal .woocommerce-MyAccount-navigation-link--customer-logout {
		margin-top: 0 !important;
		padding-top: 0 !important;
		border-top: 0 !important;
	}
}

/* ---------------------------------------------------------------- Form fields */

/* Attachments left out as soon as they're chosen (assets/attach-check.js). */
body.frr-portal .frr-attach-errors {
	margin: 0.5em 0 0;
	padding: 0 0 0 1.1em;
	color: #b32d2e;
	font-size: 0.9375em;
}

body.frr-portal main :is(input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="number"], select, textarea),
body.frr-portal .woocommerce form .form-row :is(input.input-text, select, textarea) {
	box-sizing: border-box;
	padding: 0.6em 0.75em;
	border: 1px solid #c3d2d2;
	border-radius: 8px;
	background-color: #fff;
	color: var(--frr-ink);
	font-size: inherit; /* Match the surrounding text; the theme's fields are smaller. */
	font-weight: 400;
}

body.frr-portal main :is(input, select, textarea):focus,
body.frr-portal .woocommerce form .form-row :is(input.input-text, select, textarea):focus {
	border-color: var(--frr-brand, #01696e);
	outline: none;
	box-shadow: 0 0 0 3px rgba(1, 105, 110, 0.18);
}

body.frr-portal main :is(input, textarea)::placeholder {
	color: #7a8c8d;
	font-size: inherit;
}

body.frr-portal main input[type="file"] {
	font-size: 0.9rem;
}

/* ---------------------------------------------------------------- Secondary buttons */

body.frr-portal .frr-button-secondary {
	border: 1.5px solid var(--frr-brand, #01696e);
	background: transparent;
	color: var(--frr-brand, #01696e);
}

body.frr-portal .frr-button-secondary:is(:hover, :focus-visible) {
	background: var(--frr-tint);
	color: var(--frr-brand-dark, #014f53);
}

/* ---------------------------------------------------------------- Tables */

body.frr-portal table.shop_table {
	overflow: hidden;
	border: 1px solid var(--frr-line);
	border-collapse: separate;
	border-spacing: 0;
	border-radius: 10px;
}

body.frr-portal table.shop_table thead th {
	background: #f6f9f9;
	color: var(--frr-ink-soft);
	font-size: 0.78em;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

body.frr-portal table.shop_table :is(th, td) {
	padding: 0.75em 1em;
	border-top: 1px solid var(--frr-line);
	vertical-align: middle;
}

body.frr-portal table.shop_table thead th,
body.frr-portal table.shop_table tbody tr:first-child :is(th, td) {
	border-top: 0;
}

body.frr-portal table.shop_table thead + tbody tr:first-child :is(th, td) {
	border-top: 1px solid var(--frr-line);
}

/* Repairs list: white cards on the page tint's lighter shade, edged in the status colour. */
body.frr-portal .frr-repair-card {
	border-color: var(--frr-line);
	border-left-color: var(--frr-line);
	background: #fff;
	box-shadow: 0 1px 2px rgba(16, 41, 42, 0.05);
	transition: border-color 0.15s, box-shadow 0.15s;
}

body.frr-portal .frr-repair-card:hover {
	border-color: color-mix(in srgb, var(--frr-brand, #01696e) 35%, var(--frr-line));
	box-shadow: var(--frr-shadow);
}

body.frr-portal .frr-repair-card:has(.frr-status) {
	border-left-color: var(--frr-card-state, var(--frr-tint));
}

body.frr-portal .frr-repair-card:has(:is(.frr-status-needs_info, .frr-status-awaiting_shipment, .frr-status-estimate_pending, .frr-status-invoiced)) {
	--frr-card-state: #c47f00;
}

body.frr-portal .frr-repair-card:has(:is(.frr-status-overdue, .frr-status-abandoned)) {
	--frr-card-state: #a52a2a;
}

body.frr-portal .frr-repair-card:has(:is(.frr-status-paid, .frr-status-shipped, .frr-status-closed)) {
	--frr-card-state: #1d6b3c;
}

body.frr-portal .frr-repair-card-id {
	color: var(--frr-ink);
}

body.frr-portal .frr-repair-card-id:is(a:hover, a:focus-visible) {
	color: var(--frr-brand, #01696e);
}

/* My account → Orders: six columns (WooCommerce's five plus Repair ID). Fit the box like the repairs list:
   totals wrap, the actions keep a narrow column, and when there isn't room each order becomes a card.
   Scoped to .account-orders-table: the My repairs table shares WooCommerce's other table classes. */
body.frr-portal .woocommerce-MyAccount-content {
	container-type: inline-size;
}

body.frr-portal table.account-orders-table {
	width: 100%;
	table-layout: auto;
}

body.frr-portal .account-orders-table :is(th, td) {
	padding-inline: 0.75em;
}

body.frr-portal .woocommerce-orders-table__cell-order-total {
	white-space: normal;
}

body.frr-portal .woocommerce-orders-table__cell-order-actions {
	width: 1%;
	white-space: nowrap;
	text-align: right;
}

body.frr-portal .woocommerce-orders-table__cell-order-actions .button {
	margin: 0.15em 0 0.15em 0.35em;
}

@container (max-width: 640px) {
	body.frr-portal .account-orders-table thead {
		display: none;
	}

	body.frr-portal .account-orders-table,
	body.frr-portal .account-orders-table :is(tbody, tr, th, td) {
		display: block;
		width: auto;
	}

	/* WooCommerce's phone styles hide the order number cell (a th); keep it in the card. */
	body.frr-portal table.account-orders-table tbody th {
		display: block;
	}

	body.frr-portal .account-orders-table tbody :is(th, td) {
		border-top: 0;
		text-align: right;
		white-space: normal;
	}

	body.frr-portal .account-orders-table tbody :is(th, td)::before {
		content: attr(data-title) ": ";
		float: left;
		font-weight: 600;
	}

	/* Where each order starts. */
	body.frr-portal .account-orders-table tbody tr > :first-child {
		background: #f6f9f9;
	}

	body.frr-portal .account-orders-table tbody tr + tr > :first-child {
		border-top: 2px solid var(--frr-line);
	}

	body.frr-portal .woocommerce-orders-table__cell-order-actions::before {
		content: none !important;
	}

	body.frr-portal .woocommerce-orders-table__cell-order-actions .button {
		display: block;
		box-sizing: border-box;
		width: 100%;
		margin: 0.35em 0 0;
		text-align: center;
	}
}

/* Device numbers on the repair page. */
body.frr-portal .frr-items-list > li.frr-numbered {
	padding-left: 3em;
}

body.frr-portal .frr-item-number {
	background: var(--frr-tint);
	color: var(--frr-brand-dark, #014f53);
}

/* Search box above My repairs and Orders. */
body.frr-portal .frr-search {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
	margin: 0 0 1em;
}

body.frr-portal .frr-search input[type="search"] {
	flex: 1 1 14em;
	min-width: 0;
	padding: 0.55em 0.8em;
	border: 1px solid var(--frr-line);
	border-radius: 8px;
}

body.frr-portal .frr-search .frr-search-result {
	flex-basis: 100%;
	margin: 0;
	color: var(--frr-ink-soft);
	font-size: 0.9em;
}

/* ---------------------------------------------------------------- Status badges */

body.frr-portal .frr-status {
	display: inline-block;
	padding: 0.2em 0.7em;
	border-radius: 999px;
	background: var(--frr-tint);
	color: var(--frr-brand-dark, #014f53);
	font-size: 0.85em;
	font-weight: 600;
	line-height: 1.5;
}

/* In the repairs list a long status wraps; rounded corners suit two lines better than a pill. */
body.frr-portal .frr-repair-card .frr-status {
	border-radius: 8px;
	line-height: 1.35;
	padding-block: 0.3em;
}

/* Waiting on the customer. */
body.frr-portal :is(.frr-status, .frr-status-box):is(.frr-status-needs_info, .frr-status-awaiting_shipment, .frr-status-estimate_pending, .frr-status-invoiced) {
	--frr-state: #a15c00;
	--frr-state-bg: #fdf0db;
}

/* Overdue: unpaid after the due date. */
body.frr-portal :is(.frr-status, .frr-status-box).frr-status-overdue,
body.frr-portal .frr-status-box.frr-overdue {
	--frr-state: #a52a2a;
	--frr-state-bg: #fbe9e9;
}

body.frr-portal .frr-unpaid {
	border: 1px solid var(--frr-line);
	border-left: 4px solid #c47f00;
	border-radius: 10px;
	background: #fdf0db;
}

body.frr-portal .frr-unpaid.frr-overdue {
	border-left-color: #a52a2a;
	background: #fbe9e9;
}

/* Done. */
body.frr-portal :is(.frr-status, .frr-status-box):is(.frr-status-paid, .frr-status-shipped, .frr-status-closed) {
	--frr-state: #1d6b3c;
	--frr-state-bg: #e2f2e7;
}

body.frr-portal :is(.frr-status, .frr-status-box).frr-status-abandoned {
	--frr-state: #a52a2a;
	--frr-state-bg: #fbe9e9;
}

body.frr-portal :is(.frr-status, .frr-status-box).frr-status-cancelled {
	--frr-state: #5a6667;
	--frr-state-bg: #ebeff0;
}

body.frr-portal .frr-status {
	background: var(--frr-state-bg, var(--frr-tint));
	color: var(--frr-state, var(--frr-brand-dark, #014f53));
}

/* The status box at the top of a repair, coloured to match. */
body.frr-portal .frr-status-box {
	border: 0;
	border-left: 4px solid var(--frr-state, var(--frr-brand, #01696e));
	border-radius: 10px;
	background: var(--frr-state-bg, var(--frr-tint));
}

body.frr-portal .frr-status-box .frr-status-label {
	color: var(--frr-state, var(--frr-brand-dark, #014f53));
	font-size: 1.1em;
}

/* ---------------------------------------------------------------- Repair page */

body.frr-portal :is(.frr-invoice-box, .frr-decision-box, .frr-ship-box) {
	border: 1px solid var(--frr-line);
	border-left: 4px solid var(--frr-brand, #01696e);
	border-radius: 10px;
	background: #fbfdfd;
}

body.frr-portal .frr-decision-box {
	border-left-color: #c47f00;
}

body.frr-portal .frr-estimate-note {
	margin: 0 0 1em;
	padding: 0.6em 1em;
	border-left: 3px solid var(--frr-line);
	color: var(--frr-ink);
	font-style: normal;
}

body.frr-portal .frr-estimate-note p:last-child {
	margin-bottom: 0;
}

body.frr-portal .frr-item-estimate {
	border-radius: 8px;
	background: var(--frr-tint);
	color: var(--frr-ink);
}

body.frr-portal .frr-item-estimate .frr-estimate-price {
	color: var(--frr-brand-dark, #014f53);
}

body.frr-portal .frr-items-list > li {
	padding: 0.75em 1em;
	border: 1px solid var(--frr-line);
	border-radius: 10px;
}

body.frr-portal .frr-event {
	border-radius: 10px;
	background: #f4f8f8;
}

/* Messages: a little smaller than the page, with tighter paragraphs, so long notes read as one block. */
body.frr-portal .frr-event-body {
	font-size: 0.9375em; /* 15px */
	line-height: 1.55;
}

body.frr-portal .frr-event-body p {
	margin: 0 0 0.7em;
}

body.frr-portal .frr-from-staff {
	border-left: 4px solid var(--frr-brand, #01696e);
	background: var(--frr-tint);
}

/* Progress and compact timeline lines in the brand colour. */
body.frr-portal .frr-progress { color: var(--frr-brand, #01696e); }
body.frr-portal .frr-progress-label { color: var(--frr-ink); }
body.frr-portal .frr-progress-dot { border-color: var(--frr-line); }
body.frr-portal .frr-progress-done .frr-progress-dot,
body.frr-portal .frr-progress-current .frr-progress-dot { border-color: var(--frr-brand, #01696e); }
body.frr-portal .frr-progress-current .frr-progress-dot { box-shadow: 0 0 0 4px var(--frr-tint); }
body.frr-portal .frr-progress li:not(:first-child)::before { background: var(--frr-line); }
body.frr-portal .frr-progress li:is(.frr-progress-done, .frr-progress-current)::before { background: var(--frr-brand, #01696e); }
body.frr-portal .frr-event-compact { background: none; color: var(--frr-ink-soft); }
body.frr-portal .frr-event-compact::before { background: var(--frr-brand, #01696e); }
body.frr-portal .frr-timeline .frr-day { color: var(--frr-ink-soft); }

/* ---------------------------------------------------------------- Request form */

body.frr-portal .frr-request .frr-item {
	border-color: var(--frr-line);
	border-radius: 10px;
	background: #f8fbfb;
}

body.frr-portal .frr-request .frr-item legend {
	padding: 0.15em 0.7em;
	border-radius: 999px;
	background: var(--frr-tint);
	color: var(--frr-brand-dark, #014f53);
	font-size: 0.9em;
}

/* Return choices as clickable option cards. */
body.frr-portal .frr-return-choice {
	margin: 0 0 0.6em;
}

body.frr-portal .frr-return-choice label {
	display: block;
	padding: 0.85em 1em 0.85em 2.6em;
	border: 1px solid var(--frr-line);
	border-radius: 10px;
	cursor: pointer;
	position: relative;
}

body.frr-portal .frr-return-choice label input {
	position: absolute;
	top: 1.05em;
	left: 1em;
	accent-color: var(--frr-brand, #01696e);
}

body.frr-portal .frr-return-choice label:hover {
	background: #f8fbfb;
}

body.frr-portal .frr-return-choice label:has(input:checked) {
	border-color: var(--frr-brand, #01696e);
	background: var(--frr-tint);
	box-shadow: inset 0 0 0 1px var(--frr-brand, #01696e);
}

body.frr-portal .frr-request .frr-return-choice .frr-hint {
	margin: 0.15em 0 0;
	line-height: 1.5;
}

body.frr-portal .frr-request .frr-submit {
	margin-top: 1.5em;
}

/* ---------------------------------------------------------------- Cart */

/* WooCommerce's cart block: the items and the totals each sit in a card. */
body.frr-portal :is(.wp-block-woocommerce-cart-items-block, .wp-block-woocommerce-cart-totals-block, .wp-block-woocommerce-empty-cart-block) {
	box-sizing: border-box;
	padding: clamp(1.25em, 3vw, 2em);
	border: 1px solid var(--frr-line);
	border-radius: var(--frr-radius-card);
	background: #fff;
	box-shadow: var(--frr-shadow);
}

body.frr-portal :is(.wp-block-woocommerce-cart-items-block, .wp-block-woocommerce-cart-totals-block) {
	margin-bottom: 1.25em;
}

/* Cards keep their own height instead of stretching to match each other. */
body.frr-portal .wc-block-cart.wc-block-components-sidebar-layout {
	align-items: flex-start;
}

body.frr-portal .wc-block-cart {
	color: var(--frr-ink);
	font-size: inherit; /* The block's text is smaller than the rest of the portal. */
}

body.frr-portal .wc-block-cart-items {
	margin: 0;
}

body.frr-portal .wc-block-cart-items__header th {
	padding-top: 0;
	border-bottom: 1px solid var(--frr-line);
	color: var(--frr-ink-soft);
	font-size: 0.78em;
	font-weight: 600;
	letter-spacing: 0.05em;
}

body.frr-portal .wc-block-cart-items .wc-block-cart-items__row:last-child > td {
	border-bottom: 0;
	padding-bottom: 0;
}

body.frr-portal .wc-block-cart-items .wc-block-components-product-name {
	color: var(--frr-ink);
	font-size: 1.05em;
	font-weight: 600;
	text-decoration: none;
}

body.frr-portal .wc-block-cart-items .wc-block-components-product-metadata {
	color: var(--frr-ink-soft);
}

body.frr-portal .wc-block-cart-item__image img {
	border-radius: 8px;
}

/* Repairs have no product photo; keep WooCommerce's placeholder in the background. */
body.frr-portal .wc-block-cart-item__image img[src*="placeholder"] {
	opacity: 0.6;
}

body.frr-portal .wc-block-cart-item__total {
	font-weight: 600;
}

body.frr-portal .wc-block-cart-item__remove-link {
	color: var(--frr-ink-soft) !important;
}

body.frr-portal .wc-block-cart-item__remove-link:is(:hover, :focus-visible) {
	color: #b42318 !important;
}

/* Totals card. */
body.frr-portal .wc-block-cart__totals-title {
	padding: 0 0 0.6em !important;
	color: var(--frr-ink);
	font-size: 1.2em !important;
	font-weight: 600 !important;
	text-align: left !important;
	text-transform: none !important;
}

body.frr-portal .wp-block-woocommerce-cart-totals-block .wc-block-components-totals-wrapper {
	border-color: var(--frr-line);
}

body.frr-portal .wp-block-woocommerce-cart-totals-block .wc-block-components-totals-item__label {
	color: var(--frr-ink-soft);
}

body.frr-portal .wp-block-woocommerce-cart-totals-block .wc-block-components-totals-footer-item {
	margin: 0.25em 0 0;
	padding: 0.75em;
	border-radius: 8px;
	background: var(--frr-tint);
	color: var(--frr-brand-dark, #014f53);
}

body.frr-portal .wp-block-woocommerce-cart-totals-block .wc-block-components-totals-footer-item :is(.wc-block-components-totals-item__label, .wc-block-components-totals-item__value) {
	color: inherit;
	font-size: 1.15em;
	font-weight: 600;
}

body.frr-portal .wc-block-cart__submit-container {
	padding-bottom: 0 !important;
}

body.frr-portal .wc-block-cart__submit-button {
	font-size: 1rem;
	font-weight: 600;
}

/* Empty cart: a pointer to the repair request form (EmptyCart.php). */
body.frr-portal .wp-block-woocommerce-empty-cart-block {
	padding-block: 2.5em;
	text-align: center;
}

body.frr-portal .frr-empty-cart .frr-empty-cart-title {
	margin: 0 0 0.4em;
	font-size: 1.5em;
}

body.frr-portal .frr-empty-cart p {
	margin: 0 0 1em;
}

body.frr-portal .frr-empty-cart p:has(> .button) {
	margin-top: 1.5em;
}

body.frr-portal .frr-empty-cart .frr-empty-cart-note {
	margin: 1.5em 0 0;
	color: var(--frr-ink-soft);
	font-size: 0.9em;
}

/* ---------------------------------------------------------------- Checkout */

/* Desktop: your details on the left, the order and payment as one card on the right. */
@media (min-width: 900px) {
	body.frr-portal form.woocommerce-checkout {
		display: grid;
		grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
		/* payment: evolve puts the payment methods after the order card; without a row of their own they dropped
		   into the empty notices row at the top. */
		grid-template-areas: "notices notices" "details heading" "details review" "details confirm" "payment payment";
		grid-template-rows: auto auto auto 1fr auto;
		column-gap: 2em;
		align-items: start;
	}

	body.frr-portal form.woocommerce-checkout > * {
		grid-column: 1 / -1; /* Anything else WooCommerce or a plugin adds spans the width. */
	}

	body.frr-portal form.woocommerce-checkout > .woocommerce-NoticeGroup {
		grid-area: notices;
	}

	body.frr-portal form.woocommerce-checkout > #customer_details {
		grid-area: details;
	}

	body.frr-portal form.woocommerce-checkout > #order_review_heading {
		grid-area: heading;
	}

	body.frr-portal form.woocommerce-checkout > #order_review {
		grid-area: review;
	}

	body.frr-portal form.woocommerce-checkout > #payment {
		grid-area: payment;
	}

	/* "Ship my repair back to" (CheckoutAddress): under the order, just above the payment methods and Place order.
	   Without an area it was placed after the payment row. */
	body.frr-portal form.woocommerce-checkout > #frr-ship-confirm {
		grid-area: confirm;
	}
}

body.frr-portal form.woocommerce-checkout #customer_details,
body.frr-portal form.woocommerce-checkout #order_review_heading,
body.frr-portal form.woocommerce-checkout #order_review {
	box-sizing: border-box;
	border: 1px solid var(--frr-line);
	background: #fff;
	box-shadow: var(--frr-shadow);
}

body.frr-portal form.woocommerce-checkout #customer_details {
	margin-bottom: 1.25em;
	padding: clamp(1.25em, 3vw, 2em);
	border-radius: var(--frr-radius-card);
}

/* The "Your order" heading and the box below it read as one card. */
body.frr-portal form.woocommerce-checkout #order_review_heading {
	margin: 0;
	padding: clamp(1.25em, 3vw, 2em) clamp(1.25em, 3vw, 2em) 0.6em;
	border-bottom: 0;
	border-radius: var(--frr-radius-card) var(--frr-radius-card) 0 0;
	clip-path: inset(-30px -30px 0 -30px);
}

body.frr-portal form.woocommerce-checkout #order_review {
	margin-bottom: 1.25em;
	padding: 0 clamp(1.25em, 3vw, 2em) clamp(1.25em, 3vw, 2em);
	border-top: 0;
	border-radius: 0 0 var(--frr-radius-card) var(--frr-radius-card);
}

/* Billing, then shipping and notes, stacked inside the details card. */
body.frr-portal #customer_details :is(.col-1, .col-2) {
	float: none;
	width: 100%;
	max-width: none;
}

body.frr-portal #customer_details .col-2 {
	margin-top: 1.5em;
	padding-top: 1.5em;
	border-top: 1px solid var(--frr-line);
}

body.frr-portal .woocommerce-checkout #customer_details h3 {
	margin: 0 0 0.8em;
	font-size: 1.2em;
}

body.frr-portal form.woocommerce-checkout h3#order_review_heading {
	font-size: 1.2em;
}

body.frr-portal .woocommerce-checkout .woocommerce-additional-fields h3 {
	margin-top: 1.25em;
}

body.frr-portal #ship-to-different-address label {
	display: flex;
	align-items: center;
	gap: 0.5em;
	cursor: pointer;
}

body.frr-portal .woocommerce-checkout input[type="checkbox"],
body.frr-portal .woocommerce-checkout input[type="radio"] {
	width: 1.1em;
	height: 1.1em;
	accent-color: var(--frr-brand, #01696e);
}

/* Smaller, firmer labels so the fields lead. */
body.frr-portal .woocommerce-checkout .form-row > label {
	margin-bottom: 0.3em;
	color: var(--frr-ink);
	font-size: 0.9em;
	font-weight: 500;
	line-height: 1.4;
}

body.frr-portal .woocommerce-checkout .form-row {
	margin-bottom: 0.9em;
}

/* Country and state pickers (selectWoo) match the other fields. */
body.frr-portal .select2-container {
	font-size: inherit;
}

body.frr-portal .select2-container--default .select2-selection--single {
	box-sizing: border-box;
	height: auto;
	padding: 0.6em 2.25em 0.6em 0.75em;
	border: 1px solid #c3d2d2;
	border-radius: 8px;
	background: #fff;
}

body.frr-portal .select2-container--default .select2-selection--single .select2-selection__rendered,
body.frr-portal .woocommerce form .form-row .select2-container .select2-selection--single .select2-selection__rendered {
	padding: 0; /* WooCommerce pads this inner box too, making the pickers taller than the fields. */
	color: var(--frr-ink);
	font-size: inherit;
	line-height: normal;
}

body.frr-portal .select2-container--default .select2-selection--single .select2-selection__arrow {
	top: 50%;
	right: 0.6em;
	height: 1.5em;
	transform: translateY(-50%);
}

body.frr-portal .select2-container--focus .select2-selection--single,
body.frr-portal .select2-container--open .select2-selection--single {
	border-color: var(--frr-brand, #01696e);
	box-shadow: 0 0 0 3px rgba(1, 105, 110, 0.18);
}

body.frr-portal .select2-dropdown {
	border-color: var(--frr-brand, #01696e);
	border-radius: 8px;
	overflow: hidden;
}

body.frr-portal .select2-container--default .select2-results__option--highlighted[aria-selected],
body.frr-portal .select2-container--default .select2-results__option--highlighted[data-selected] {
	background: var(--frr-brand, #01696e);
}

/* "Have a coupon?" bar (block themes print it as a notice banner). */
body.frr-portal .woocommerce-form-coupon-toggle :is(.woocommerce-info, .wc-block-components-notice-banner) {
	border: 1px solid var(--frr-line);
	border-radius: 10px;
	background: #fff;
	color: var(--frr-ink);
}

body.frr-portal .woocommerce-form-coupon-toggle .woocommerce-info::before {
	color: var(--frr-brand, #01696e);
}

body.frr-portal .woocommerce-form-coupon-toggle .wc-block-components-notice-banner > svg {
	background: var(--frr-brand, #01696e);
}

body.frr-portal form.checkout_coupon {
	border: 1px solid var(--frr-line);
	border-radius: 10px;
	background: #fff;
}

/* Order summary. */
body.frr-portal .woocommerce-checkout-review-order-table {
	margin-bottom: 1.5em;
}

body.frr-portal .woocommerce-checkout-review-order-table tfoot :is(th, td) {
	font-weight: 400;
}

body.frr-portal .woocommerce-checkout-review-order-table tfoot th {
	color: var(--frr-ink-soft);
}

body.frr-portal .woocommerce-checkout-review-order-table tr.order-total :is(th, td) {
	background: var(--frr-tint);
	color: var(--frr-brand-dark, #014f53);
	font-size: 1.15em;
	font-weight: 600;
}

body.frr-portal .woocommerce-checkout-review-order-table #shipping_method {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Payment: each method is an option card, like the return choices on the request form. */
body.frr-portal #payment {
	border-radius: 0;
	background: none;
}

body.frr-portal #payment ul.payment_methods {
	margin: 0;
	padding: 0;
	border: 0;
}

body.frr-portal #payment ul.payment_methods li.wc_payment_method {
	margin: 0 0 0.6em;
	padding: 0.85em 1em;
	border: 1px solid var(--frr-line);
	border-radius: 10px;
	list-style: none;
}

body.frr-portal #payment ul.payment_methods li.wc_payment_method:has(> input:checked),
body.frr-portal #payment ul.payment_methods li.wc_payment_method:only-child {
	border-color: var(--frr-brand, #01696e);
	box-shadow: inset 0 0 0 1px var(--frr-brand, #01696e);
}

body.frr-portal #payment ul.payment_methods li.wc_payment_method > label {
	font-weight: 600;
	cursor: pointer;
}

body.frr-portal #payment div.payment_box {
	margin: 0.75em 0 0;
	padding: 0.75em 1em;
	border-radius: 8px;
	background: var(--frr-tint);
	color: var(--frr-ink);
	font-size: 0.92em;
}

body.frr-portal #payment div.payment_box::before {
	border-bottom-color: var(--frr-tint);
}

body.frr-portal #payment div.payment_box p:last-child {
	margin-bottom: 0;
}

body.frr-portal #payment div.form-row.place-order {
	margin: 1em 0 0;
	padding: 0;
}

body.frr-portal #payment .woocommerce-privacy-policy-text {
	color: var(--frr-ink-soft);
	font-size: 0.85em;
	line-height: 1.5;
}

body.frr-portal #payment #place_order {
	float: none;
	width: 100%;
	margin-top: 0.75em;
	padding: 0.9em 1.25em;
	font-size: 1.05em;
	font-weight: 600;
}

/* ---------------------------------------------------------------- Order received */

/* Block themes use WooCommerce's order confirmation blocks; classic themes use .woocommerce-order. */
body.frr-portal :is(.wc-block-order-confirmation-status > p, .woocommerce-order .woocommerce-thankyou-order-received) {
	display: flex;
	align-items: center;
	gap: 0.75em;
	margin: 0.5em 0 1.25em;
	padding: 1em 1.25em;
	border-left: 4px solid #1d6b3c;
	border-radius: 10px;
	background: #e2f2e7;
	color: #1d6b3c;
	font-size: 1.05rem;
	font-weight: 600;
}

body.frr-portal :is(.wc-block-order-confirmation-status > p, .woocommerce-order .woocommerce-thankyou-order-received)::before {
	content: "\2713";
	display: grid;
	flex: none;
	place-items: center;
	width: 1.75em;
	height: 1.75em;
	border-radius: 50%;
	background: #1d6b3c;
	color: #fff;
	font-size: 0.9em;
}

/* Order number, date, total... as one strip. */
body.frr-portal :is(ul.wc-block-order-confirmation-summary-list, .woocommerce-order ul.woocommerce-order-overview) {
	display: flex;
	flex-wrap: wrap;
	gap: 1px; /* The line colour shows through as dividers, however the items wrap. */
	overflow: hidden;
	margin: 0 0 1.25em;
	padding: 0;
	border: 1px solid var(--frr-line);
	border-radius: var(--frr-radius-card);
	background: var(--frr-line);
	box-shadow: var(--frr-shadow);
	list-style: none;
}

body.frr-portal :is(.wc-block-order-confirmation-summary-list, .woocommerce-order-overview) li {
	flex: 1 1 auto;
	margin: 0;
	padding: 1em 1.25em;
	border: 0;
	background: #fff;
	color: var(--frr-ink);
	font-size: inherit;
	font-weight: 600;
	overflow-wrap: anywhere;
	text-transform: none;
}

body.frr-portal :is(.wc-block-order-confirmation-summary-list-item__key, .woocommerce-order-overview li > :not(strong)) {
	display: block;
	margin-bottom: 0.3em;
	color: var(--frr-ink-soft);
	font-size: 0.75em;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

body.frr-portal .woocommerce-order-overview li strong {
	display: block;
	margin-top: 0.3em;
}

/* Order details and addresses as cards. */
body.frr-portal :is(.wc-block-order-confirmation-totals-wrapper, .wc-block-order-confirmation-shipping-wrapper, .wc-block-order-confirmation-billing-wrapper),
body.frr-portal .woocommerce-order :is(.woocommerce-order-details, .woocommerce-customer-details) {
	box-sizing: border-box;
	height: 100%;
	margin: 0 0 1.25em;
	padding: clamp(1.25em, 3vw, 2em);
	border: 1px solid var(--frr-line);
	border-radius: var(--frr-radius-card);
	background: #fff;
	box-shadow: var(--frr-shadow);
}

body.frr-portal .wc-block-order-confirmation-totals-wrapper {
	height: auto;
}

body.frr-portal :is(.wc-block-order-confirmation-totals-wrapper, .wc-block-order-confirmation-shipping-wrapper, .wc-block-order-confirmation-billing-wrapper) h2,
body.frr-portal .woocommerce-order :is(.woocommerce-order-details, .woocommerce-customer-details) h2 {
	margin: 0 0 0.6em;
	font-size: 1.25em;
}

body.frr-portal :is(.wc-block-order-confirmation-shipping-address, .wc-block-order-confirmation-billing-address) {
	padding: 0;
	border: 0;
}

body.frr-portal .woocommerce-order .woocommerce-customer-details address {
	border: 1px solid var(--frr-line);
	border-radius: 10px;
}

body.frr-portal .frr-order-repair {
	margin: 0 0 1em;
}

/* Totals table, like the checkout summary. */
body.frr-portal .wc-block-order-confirmation-totals__table {
	width: 100%;
	overflow: hidden;
	border: 1px solid var(--frr-line);
	border-collapse: separate;
	border-spacing: 0;
	border-radius: 10px;
}

body.frr-portal .wc-block-order-confirmation-totals__table :is(th, td) {
	padding: 0.75em 1em;
	border: 0;
	border-top: 1px solid var(--frr-line);
}

body.frr-portal .wc-block-order-confirmation-totals__table thead th {
	border-top: 0;
	background: #f6f9f9;
	color: var(--frr-ink-soft);
	font-size: 0.78em;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

body.frr-portal .wc-block-order-confirmation-totals__table tfoot th {
	color: var(--frr-ink-soft);
	font-weight: 400;
}

body.frr-portal .wc-block-order-confirmation-totals__table tfoot tr:last-child :is(th, td) {
	background: var(--frr-tint);
	color: var(--frr-brand-dark, #014f53);
	font-size: 1.15em;
	font-weight: 600;
}

/* ---------------------------------------------------------------- USPS address check (AddressCheck) */

body.frr-portal .frr-address-check {
	margin: 0.5em 0 1.25em;
	padding: 0.9em 1em;
	border: 1px solid #e6c37a;
	border-radius: 8px;
	background: #fdf6e7;
}

body.frr-portal .frr-address-check legend {
	float: left; /* Inside the box, not on its border. */
	width: 100%;
	margin: 0 0 0.5em;
	padding: 0;
	font-size: 1em; /* Some themes (evolve) size every legend like a heading. */
	font-weight: 600;
}

body.frr-portal .frr-address-check label {
	display: flex;
	clear: both;
	gap: 0.5em;
	align-items: baseline;
	margin: 0.35em 0 0;
	font-weight: normal;
}

/* WooCommerce's show/hide password button: some themes (e.g. evolve) style every button as a coloured pill and
don't load WooCommerce's eye icon, so it's restyled here as a plain eye inside the field. */
body.frr-portal .password-input {
	position: relative;
	display: block;
}

body.frr-portal .password-input input {
	padding-right: 2.75em;
}

body.frr-portal .show-password-input {
	position: absolute;
	top: 50%;
	right: 0.5em;
	width: 2em;
	height: 2em;
	min-width: 0;
	margin: 0;
	padding: 0;
	transform: translateY(-50%);
	border: 0;
	border-radius: 6px;
	box-shadow: none;
	color: var(--frr-ink-soft);
	cursor: pointer;
	background: currentColor;
	background-image: none;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / 1.25em no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / 1.25em no-repeat;
}

body.frr-portal .show-password-input::before,
body.frr-portal .show-password-input::after,
body.frr-portal .show-password-input > span {
	display: none;
}

body.frr-portal .show-password-input.display-password {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M3 3l18 18'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M3 3l18 18'/%3E%3C/svg%3E");
}

body.frr-portal .show-password-input:hover,
body.frr-portal .show-password-input:focus-visible {
	background-color: var(--frr-ink);
}

/* Two addresses side by side (order details, thank-you page, My account → Addresses). Themes built on Bootstrap
   (evolve) read WooCommerce's col-1/col-2 as a 1/12 and 2/12 grid column, which squeezed them into a sliver. */
body.frr-portal .col2-set:not(#customer_details) {
	display: flex;
	flex-wrap: wrap;
	gap: 1.25em;
}

body.frr-portal .col2-set:not(#customer_details) > :is(.col-1, .col-2) {
	flex: 1 1 16em;
	width: auto;
	max-width: none;
	float: none;
	padding: 0;
}

body.frr-portal .col2-set:not(#customer_details)::before,
body.frr-portal .col2-set:not(#customer_details)::after {
	content: none;
}

/* evolve (EvolveAccount): the theme turns off WooCommerce's stylesheet, so the account menu sits beside the page
   here instead, and the theme's large headings are brought down to the portal's size. */
@media (min-width: 769px) {
	body.frr-portal.frr-evolve .woocommerce:has(> .woocommerce-MyAccount-navigation) {
		display: grid;
		grid-template-columns: minmax(12em, 15em) minmax(0, 1fr);
		gap: 1.5em;
		align-items: start;
	}

	body.frr-portal.frr-evolve .woocommerce:has(> .woocommerce-MyAccount-navigation) > * {
		grid-column: 2;
	}

	body.frr-portal.frr-evolve .woocommerce > .woocommerce-MyAccount-navigation {
		grid-column: 1;
		grid-row: 1 / span 20;
	}

	body.frr-portal.frr-evolve .woocommerce > :is(.woocommerce-MyAccount-navigation, .woocommerce-MyAccount-content) {
		float: none;
		width: auto;
		margin: 0;
	}
}

body.frr-portal.frr-evolve .woocommerce-MyAccount-content h2 {
	margin: 0 0 0.5em;
	font-size: 1.35em;
}

/* Checkout for a repair that ships back: "Ship my repair back to" with the required tick (CheckoutAddress). */
body.frr-portal .frr-ship-confirm {
	clear: both;
	margin: 1.25em 0;
	padding: 1em;
	border: 1px solid #cfdfe0;
	border-radius: 8px;
	background: #f4f9f9;
}

body.frr-portal .frr-ship-confirm h3 {
	margin: 0 0 0.4em;
	font-size: 1.15em;
}

body.frr-portal .frr-ship-confirm address {
	margin: 0 0 0.75em;
	font-style: normal;
	font-weight: 600;
	line-height: 1.5;
}

body.frr-portal .frr-ship-confirm .form-row {
	margin: 0;
	padding: 0;
}

/* Not ticked when placing the order: WooCommerce marks the row invalid (and adds an inline message). */
body.frr-portal .frr-ship-confirm:has(.woocommerce-invalid) {
	border: 2px solid #b32d2e;
	background: #fcf0f1;
}

body.frr-portal .frr-ship-confirm .woocommerce-invalid label {
	color: #b32d2e;
	font-weight: 600;
}

body.frr-portal .frr-ship-confirm .woocommerce-invalid input[type="checkbox"] {
	outline: 2px solid #b32d2e;
	outline-offset: 2px;
}

body.frr-portal .frr-ship-confirm .checkout-inline-error-message {
	margin: 0.3em 0 0;
	color: #b32d2e;
	font-size: 0.9em;
}

body.frr-portal .frr-ship-confirm .frr-hint {
	margin: 0.4em 0 0;
	color: #5a6b6c;
	font-size: 0.9em;
}
