/*
 * Roots 'n' Fruits — checkout page styles (Unit 1 styling pass).
 *
 * Enqueued ONLY on the /checkout/ route (see functions.php, gated on the
 * rnf_checkout query var). Built entirely on the shared tokens in tokens.css
 * and the shared .rnf-btn component in offer.css — no new colours are invented
 * here, so checkout stays visually continuous with the offer page.
 *
 * SCOPING: every rule below is namespaced under .rnf-checkout (the page/card) or
 * .rnf-checkout-header (emitted only by header-checkout.php). No global selector
 * is redefined, so this file cannot affect any other template.
 *
 * NOTE: .disp is scoped as `.rnf .disp` in offer.css and .linkish lives only in
 * portal-account.css, so neither is available on this route — headings and the
 * quiet back-link are styled explicitly below instead.
 */

/* -------------------------------------------------------------------------
 * Simplified checkout header (wordmark only — no nav by design)
 * ---------------------------------------------------------------------- */

.rnf-checkout-header {
	background: var(--paper);
	border-bottom: 1px solid var(--line);
}

/* Matches .rnf-site-header__inner so the bar height lines up with the rest of
   the site, minus the nav. */
.rnf-checkout-header__inner {
	max-width: var(--content-max);
	margin: 0 auto;
	padding: 16px 26px;
	display: flex;
	align-items: center;
	gap: 16px;
}

/* Mirrors .rnf-brand in offer.css. */
.rnf-checkout-header__brand {
	font-family: var(--font-serif);
	font-size: 19px;
	font-weight: 500;
	color: var(--pine);
	text-decoration: none;
}

/* -------------------------------------------------------------------------
 * Page shell + card
 * ---------------------------------------------------------------------- */

.rnf-checkout {
	background: var(--paper);
	padding: 56px 22px 88px;
	display: flex;
	justify-content: center;
}

.rnf-checkout__card {
	width: 100%;
	max-width: 480px;
	background: var(--paper2);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 32px;
	box-shadow: 0 1px 2px rgba(44, 46, 40, 0.04), 0 8px 24px rgba(44, 46, 40, 0.06);
}

/* -------------------------------------------------------------------------
 * Type
 * ---------------------------------------------------------------------- */

.rnf-checkout__title {
	font-family: var(--font-serif);
	font-weight: 500;
	color: var(--ink);
	font-size: 28px;
	line-height: 1.2;
	margin: 0 0 8px;
}

.rnf-checkout__plan {
	color: var(--inks);
	font-size: 14.5px;
	line-height: 1.55;
	margin: 0 0 24px;
}

.rnf-checkout__plan strong {
	color: var(--ink);
	font-weight: 600;
}

.rnf-checkout__lead {
	color: var(--inks);
	font-size: 15px;
	line-height: 1.55;
	margin: 0 0 18px;
}

.rnf-checkout__note {
	color: var(--inks);
	font-size: 14px;
	line-height: 1.55;
	margin: 0 0 24px;
}

/* -------------------------------------------------------------------------
 * Form — label ABOVE input, full-width fields
 * ---------------------------------------------------------------------- */

.rnf-checkout__form {
	display: flex;
	flex-direction: column;
	gap: 16px;
	text-align: left;
}

.rnf-checkout__field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.rnf-checkout__label {
	font-size: 13px;
	font-weight: 500;
	color: var(--ink);
}

.rnf-checkout__input,
.rnf-checkout__select {
	width: 100%;
	padding: 12px 14px;
	font-size: 15px;
	font-family: var(--font-sans);
	color: var(--ink);
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
}

.rnf-checkout__input:focus,
.rnf-checkout__select:focus {
	outline: 2px solid var(--sage);
	outline-offset: 1px;
	border-color: var(--sage);
}

/* Native select arrow room; keeps the control the same height as the inputs. */
.rnf-checkout__select {
	appearance: none;
	-webkit-appearance: none;
	background-image: linear-gradient(45deg, transparent 50%, var(--inks) 50%), linear-gradient(135deg, var(--inks) 50%, transparent 50%);
	background-position: calc(100% - 20px) calc(50% + 2px), calc(100% - 15px) calc(50% + 2px);
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
	padding-right: 40px;
}

/* Submit button: fills the card width (not the viewport). The dark-green
   surface, hover, and radius all come from .rnf-btn in offer.css. */
.rnf-checkout__submit {
	margin-top: 8px;
}

/* -------------------------------------------------------------------------
 * Error notice + confirmation ref
 * ---------------------------------------------------------------------- */

.rnf-checkout__error {
	margin: 0 0 20px;
	padding: 12px 14px;
	font-size: 14px;
	line-height: 1.5;
	color: var(--clay);
	background: var(--paper);
	border: 1px solid var(--clay);
	border-radius: var(--radius-sm);
}

.rnf-checkout__ref {
	display: block;
	margin: 0 0 24px;
	padding: 12px 14px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 13.5px;
	word-break: break-all;
	color: var(--ink);
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
}

.rnf-checkout__ref-label {
	display: block;
	font-size: 13px;
	font-weight: 500;
	color: var(--ink);
	margin: 0 0 6px;
}

/* -------------------------------------------------------------------------
 * Quiet back link (replaces the unavailable .linkish)
 * ---------------------------------------------------------------------- */

.rnf-checkout__back-row {
	margin: 20px 0 0;
	text-align: center;
}

.rnf-checkout__back {
	font-size: 14px;
	color: var(--inks);
	text-decoration: none;
}

.rnf-checkout__back:hover {
	color: var(--pine);
	text-decoration: underline;
}

/* -------------------------------------------------------------------------
 * Responsive
 * ---------------------------------------------------------------------- */

@media (max-width: 520px) {
	.rnf-checkout {
		padding: 32px 14px 64px;
	}

	.rnf-checkout__card {
		padding: 24px 20px;
	}

	.rnf-checkout__title {
		font-size: 25px;
	}

	/* 16px keeps iOS from zooming on focus; 44px keeps the tap target comfortable. */
	.rnf-checkout__input,
	.rnf-checkout__select {
		font-size: 16px;
		min-height: 44px;
	}

	.rnf-checkout-header__inner {
		padding: 14px 18px;
	}
}
