/* Rx wizard pages (.scratch/fillable-rx/spec.md): the /sample-prescription/
   landing list and the [tbfs_rx_fill] form. Theme tokens only; fields match
   the order wizard (2px #e6ecea, 10px radius). Surfaces step in tone (cream
   on white), no shadows at rest. */

/* ---------- Landing: the three forms ---------- */
.tbfs-rx-forms {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(0.75rem, 2vw, 1.25rem);
	max-width: 1180px;
	margin: 0 auto;
	padding: clamp(1.5rem, 4vw, 2.5rem) var(--wp--custom--spacing--band-x, 1.25rem);
}

.tbfs-rx-pick {
	display: flex;
	flex-direction: column;
	background: var(--wp--preset--color--cream);
	border-radius: 20px;
	overflow: hidden;
}

.tbfs-rx-pick__img img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	object-position: center 30%;
}

.tbfs-rx-pick__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 1.25rem 1.5rem 1.5rem;
}

.tbfs-rx-pick__body h2 {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600;
	font-size: 1.4rem;
	line-height: 1.15;
	letter-spacing: -0.015em;
	margin: 0 0 0.4rem;
}

.tbfs-rx-pick__body p {
	font-size: 1rem;
	line-height: 1.5;
	margin: 0 0 1.25rem;
}

/* Buttons sit on the card's bottom edge so the three line up. */
.tbfs-rx-pick .tbfs-rx-actions {
	margin-top: auto;
	gap: 0.25rem 1.25rem;
}

/* The article under the cards: the description kit (style.css) on a page
   column on the cards' grid, so the left edges line up. */
.tbfs-rx-article {
	max-width: 1180px;
	margin: 0 auto;
	padding: clamp(3rem, 7vw, 5.5rem) var(--wp--custom--spacing--band-x, 1.25rem) clamp(3.5rem, 8vw, 6rem);
}

.tbfs-rx a:not(.wp-element-button) {
	color: var(--wp--preset--color--teal-dark);
	font-weight: 600;
}

/* Phones: one compact row per form, small photo beside the text. */
@media (max-width: 760px) {
	.tbfs-rx-forms {
		grid-template-columns: 1fr;
	}
	.tbfs-rx-pick {
		display: grid;
		grid-template-columns: 88px minmax(0, 1fr);
		gap: 0 1rem;
		padding: 1rem;
		border-radius: 18px;
	}
	.tbfs-rx-pick__img {
		grid-row: 1 / span 2;
		align-self: start;
		border-radius: 12px;
		overflow: hidden;
	}
	.tbfs-rx-pick__img img {
		aspect-ratio: 1;
	}
	.tbfs-rx-pick__body {
		display: contents;
	}
	.tbfs-rx-pick__body h2 {
		grid-column: 2;
		font-size: 1.2rem;
		margin-top: 0.1rem;
	}
	.tbfs-rx-pick__body p {
		grid-column: 2;
		font-size: 0.95rem;
		margin: 0;
	}
	.tbfs-rx-pick .tbfs-rx-actions {
		grid-column: 1 / -1;
		flex-wrap: nowrap;
		gap: 1rem;
		margin-top: 0.9rem;
	}
	.tbfs-rx-forms .tbfs-rx-pick .wp-element-button {
		min-height: 44px;
		padding: 0.55rem 1.1rem;
		font-size: 0.95rem;
		white-space: nowrap;
	}
	.tbfs-rx-forms .tbfs-rx-pick .tbfs-rx-link {
		font-size: 0.95rem;
		white-space: nowrap;
	}
}

/* ---------- Shared bits ---------- */
.tbfs-rx-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1.5rem;
}

.tbfs-rx .wp-element-button,
.tbfs-rx-pick .wp-element-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	border: 0;
	border-radius: 999px;
	background: var(--wp--preset--color--coral);
	color: var(--wp--preset--color--base);
	font: inherit;
	font-weight: 600;
	font-size: 1.02rem;
	line-height: 1.2;
	padding: 0.8rem 1.8rem;
	min-height: 48px;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.15s ease;
}

.tbfs-rx .wp-element-button:hover,
.tbfs-rx-pick .wp-element-button:hover {
	background: var(--wp--preset--color--coral-dark);
	transform: translateY(-1px);
}

.tbfs-rx .wp-element-button:disabled {
	opacity: 0.55;
	cursor: progress;
	transform: none;
}

.tbfs-rx-link {
	border: 0;
	background: none;
	padding: 0.5rem 0;
	font: inherit;
	font-weight: 600;
	color: var(--wp--preset--color--teal-dark);
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
	.tbfs-rx .wp-element-button,
	.tbfs-rx-pick .wp-element-button {
		transition: none;
		transform: none !important;
	}
}

/* ---------- Fill-in form ---------- */
.tbfs-rx {
	max-width: 1180px;
	margin: 0 auto;
	padding: clamp(2rem, 5vw, 3.5rem) var(--wp--custom--spacing--band-x, 1.25rem) clamp(3rem, 7vw, 5rem);
	font-size: 1rem;
	line-height: 1.55;
}

/* Centered at a form's width. */
.tbfs-rx > * {
	max-width: 760px;
	margin-inline: auto;
}

.tbfs-rx [hidden] {
	display: none !important;
}

.tbfs-rx-chosen {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.25rem 1.5rem;
}

.tbfs-rx-h {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600;
	font-size: clamp(1.6rem, 1.4vw + 1rem, 2.2rem);
	line-height: 1.15;
	letter-spacing: -0.02em;
	margin: 0;
}

.tbfs-rx-private {
	margin: 1rem auto 1.75rem;
	padding: 1rem 1.25rem;
	border-radius: 16px;
	background: var(--wp--preset--color--teal-light);
	color: var(--wp--preset--color--contrast);
}

.tbfs-rx-group {
	border: 0;
	margin: 0 0 1rem;
	padding: clamp(1.25rem, 3vw, 1.75rem);
	border-radius: 20px;
	background: var(--wp--preset--color--cream);
	min-width: 0;
}

.tbfs-rx-group legend {
	float: left;
	width: 100%;
	padding: 0;
	margin: 0 0 0.9rem;
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600;
	font-size: 1.3rem;
	letter-spacing: -0.01em;
}

.tbfs-rx-group legend + * {
	clear: both;
}

.tbfs-rx-hint,
.tbfs-rx-included {
	margin: 0 0 1rem;
}

.tbfs-rx-included {
	margin: 0;
	font-size: 1.05rem;
}

.tbfs-rx-row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
	gap: 0 1rem;
}

.tbfs-rx-field {
	position: relative;
	margin-bottom: 1rem;
}

.tbfs-rx-field:last-child,
.tbfs-rx-row:last-child .tbfs-rx-field {
	margin-bottom: 0;
}

.tbfs-rx-field label {
	display: block;
	font-weight: 600;
	font-size: 0.95rem;
	margin: 0 0 0.35rem;
}

.tbfs-rx-field input,
.tbfs-rx-field select {
	box-sizing: border-box;
	width: 100%;
	min-height: 48px;
	padding: 0.7rem 0.9rem;
	border: 2px solid #e6ecea;
	border-radius: 10px;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	font: inherit;
	font-size: 1rem;
}

.tbfs-rx-field input:focus,
.tbfs-rx-field select:focus {
	outline: 3px solid var(--wp--preset--color--teal);
	outline-offset: 1px;
	border-color: var(--wp--preset--color--teal-dark);
}

.tbfs-rx-field input[aria-invalid="true"] {
	border-color: #d9534f;
}

.tbfs-rx-field-error,
.tbfs-rx-error {
	margin: 0.35rem 0 0;
	font-size: 0.92rem;
	font-weight: 600;
	color: #b3382f;
}

.tbfs-rx-short {
	max-width: 22rem;
	margin-top: 1rem;
}

.tbfs-rx-checks {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
	gap: 0.6rem;
}

.tbfs-rx-check {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	min-height: 52px;
	padding: 0.6rem 0.9rem;
	border: 2px solid transparent;
	border-radius: 12px;
	background: var(--wp--preset--color--base);
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.tbfs-rx-check input {
	flex: none;
	width: 1.25rem;
	height: 1.25rem;
	margin: 0;
	accent-color: var(--wp--preset--color--teal-dark);
}

.tbfs-rx-check:has(input:checked) {
	background: var(--wp--preset--color--teal-light);
	border-color: var(--wp--preset--color--teal-dark);
}

.tbfs-rx-check:has(input:focus-visible) {
	outline: 3px solid var(--wp--preset--color--teal);
	outline-offset: 1px;
}

/* Doctor search results float over the form, so they get the one shadow. */
.tbfs-rx-results {
	list-style: none;
	position: absolute;
	z-index: 30;
	left: 0;
	right: 0;
	top: 100%;
	margin: 0.3rem 0 0;
	padding: 0.3rem;
	max-height: 18rem;
	overflow-y: auto;
	background: var(--wp--preset--color--base);
	border-radius: 12px;
	box-shadow: 0 18px 40px -18px rgba(40, 30, 25, 0.45); /* taste-skill-ignore: floating menu */
}

.tbfs-rx-results button {
	display: block;
	width: 100%;
	text-align: left;
	border: 0;
	border-radius: 8px;
	background: none;
	padding: 0.6rem 0.75rem;
	font: inherit;
	color: var(--wp--preset--color--contrast);
	cursor: pointer;
}

.tbfs-rx-results button:hover,
.tbfs-rx-results button:focus-visible {
	background: var(--wp--preset--color--teal-light);
}

.tbfs-rx-results strong {
	display: block;
}

.tbfs-rx-results span {
	font-size: 0.9rem;
}

.tbfs-rx-none {
	padding: 0.6rem 0.75rem;
	font-size: 0.95rem;
}

.tbfs-rx-doc {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.25rem 1rem;
	padding: 0.75rem 1rem;
	border-radius: 12px;
	background: var(--wp--preset--color--base);
}

.tbfs-rx-doc p {
	margin: 0;
	font-weight: 600;
}

.tbfs-rx-blank {
	margin: 1.25rem 0 0;
	padding: clamp(1.25rem, 3vw, 1.75rem);
	border-radius: 20px;
	background: var(--wp--preset--color--coral-soft);
}

.tbfs-rx-blank:focus,
.tbfs-rx-done:focus {
	outline: none;
}

.tbfs-rx-blank h3 {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600;
	font-size: 1.3rem;
	margin: 0 0 0.4rem;
}

.tbfs-rx-blank p {
	margin: 0 0 0.5rem;
}

.tbfs-rx-blank ul {
	margin: 0;
	padding-left: 1.2rem;
}

[data-submit-row] {
	margin-top: 1.5rem;
}

.tbfs-rx-done {
	overflow: hidden;
	border-radius: 24px;
	background: var(--wp--preset--color--cream);
}

.tbfs-rx-done__top {
	padding: clamp(1.5rem, 4vw, 2.5rem);
	background: var(--wp--preset--color--teal-light);
}

.tbfs-rx-done__check {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	margin-bottom: 1rem;
	border-radius: 50%;
	background: var(--wp--preset--color--teal-dark);
	color: var(--wp--preset--color--base);
}

.tbfs-rx-done__top > p {
	font-size: 1.05rem;
	margin: 0.5rem 0 1.5rem;
}

.tbfs-rx .wp-element-button.is-alt {
	background: transparent;
	color: var(--wp--preset--color--teal-dark);
	box-shadow: inset 0 0 0 2px var(--wp--preset--color--teal-dark); /* taste-skill-ignore: outline button ring */
}

.tbfs-rx .wp-element-button.is-alt:hover {
	background: var(--wp--preset--color--base);
}

.tbfs-rx-steps {
	list-style: none;
	counter-reset: rxstep;
	margin: 0;
	padding: clamp(1.25rem, 3.5vw, 2rem) clamp(1.5rem, 4vw, 2.5rem) clamp(0.25rem, 1.5vw, 0.75rem);
}

.tbfs-rx-steps li {
	counter-increment: rxstep;
	position: relative;
	padding-left: 3rem;
	margin-bottom: 1.25rem;
	line-height: 1.55;
}

.tbfs-rx-steps li::before {
	content: counter(rxstep);
	position: absolute;
	left: 0;
	top: -0.1rem;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	border-radius: 50%;
	background: var(--wp--preset--color--coral-soft);
	color: var(--wp--preset--color--coral-dark);
	font-weight: 700;
}

.tbfs-rx-steps strong {
	display: block;
	font-size: 1.05rem;
}

.tbfs-rx-steps a {
	color: var(--wp--preset--color--teal-dark);
	font-weight: 600;
	overflow-wrap: anywhere;
}

.tbfs-rx-nowrap {
	white-space: nowrap;
}

.tbfs-rx-note {
	padding: 1rem 1.25rem;
	border-radius: 16px;
	background: var(--wp--preset--color--coral-soft);
}

/* Date picker: the order form's popup (tbfs-orders flow.css .tbfs-datepick),
   on theme tokens. It floats over the form, so it keeps its shadow. */
.tbfs-rx .tbfs-datepick__pop {
	position: absolute;
	z-index: 40;
	top: 100%;
	left: 0;
	margin-top: 0.3rem;
	width: min(320px, 100%);
	background: var(--wp--preset--color--base);
	border: 2px solid #e6ecea;
	border-radius: 14px;
	box-shadow: 0 10px 30px rgba(35, 60, 57, 0.16); /* taste-skill-ignore: floating menu */
	padding: 0.8rem;
}

.tbfs-rx .tbfs-datepick__head {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-weight: 700;
	margin-bottom: 0.6rem;
}

.tbfs-rx .tbfs-datepick__back {
	border: 0;
	background: var(--wp--preset--color--teal-light);
	color: var(--wp--preset--color--teal-dark);
	border-radius: 8px;
	width: 1.8rem;
	height: 1.8rem;
	font-size: 1.2rem;
	line-height: 1;
	cursor: pointer;
	padding: 0;
}

.tbfs-rx .tbfs-datepick__grid {
	display: grid;
	gap: 0.3rem;
}

.tbfs-rx .tbfs-datepick__grid--years {
	grid-template-columns: repeat(4, 1fr);
	max-height: 220px;
	overflow-y: auto;
}

.tbfs-rx .tbfs-datepick__grid--months {
	grid-template-columns: repeat(3, 1fr);
}

.tbfs-rx .tbfs-datepick__grid--days {
	grid-template-columns: repeat(7, 1fr);
}

.tbfs-rx .tbfs-datepick__grid button {
	border: 0;
	background: transparent;
	border-radius: 8px;
	padding: 0.45rem 0.2rem;
	font: inherit;
	font-size: 0.9rem;
	color: var(--wp--preset--color--contrast);
	cursor: pointer;
}

.tbfs-rx .tbfs-datepick__grid button:hover,
.tbfs-rx .tbfs-datepick__grid button:focus-visible {
	background: var(--wp--preset--color--teal-light);
	color: var(--wp--preset--color--teal-dark);
}

.tbfs-rx .tbfs-datepick__wd {
	text-align: center;
	font-size: 0.72rem;
	font-weight: 700;
	color: var(--wp--preset--color--muted);
	padding-bottom: 0.2rem;
}

@media (max-width: 520px) {
	.tbfs-rx-done__top .wp-element-button {
		width: 100%;
	}
}

/* Kit buttons size as border-box (product pages get this from WooCommerce). */
.tbfs-rx-article .tbfs-desc :is(.tbfs-desc-btn, .tbfs-desc-btn-line) {
	box-sizing: border-box;
}

/* The order button under the "Or let us ask for it" list. */
.tbfs-rx-article .tbfs-desc .tbfs-desc-pick > div > p {
	margin-top: 1.5rem;
}
