/* ==========================================================================
   Relive Health — reset, typography, primitives
   ========================================================================== */

/* Self-hosted, subset to latin. ~8.7kb each. */
@font-face {
	font-family: "Poppins";
	src: url("../fonts/poppins-400.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Poppins";
	src: url("../fonts/poppins-500.woff2") format("woff2");
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Poppins";
	src: url("../fonts/poppins-600.woff2") format("woff2");
	font-weight: 600;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Poppins";
	src: url("../fonts/poppins-700.woff2") format("woff2");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--rl-header-h) + 1rem);
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

body {
	margin: 0;
	font-family: var(--rl-font-body);
	font-size: var(--rl-step-0);
	line-height: var(--rl-lh-body);
	color: var(--rl-ink);
	background: var(--rl-surface);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: hidden;
}

body.rl-no-scroll {
	overflow: hidden;
}

h1,
h2,
h3,
h4,
h5 {
	font-family: var(--rl-font-display);
	font-weight: 700;
	line-height: var(--rl-lh-snug);
	color: var(--rl-slate-900);
	margin: 0 0 var(--rl-4);
	text-wrap: balance;
}

/* Termina is wider than Poppins; when we're on the fallback, tighten a hair
   so headline blocks keep the brand's compact, engineered feel. */
.rl-no-termina h1,
.rl-no-termina h2,
.rl-no-termina h3 {
	letter-spacing: -0.015em;
}

h1 {
	font-size: var(--rl-step-5);
	line-height: var(--rl-lh-tight);
}
h2 {
	font-size: var(--rl-step-4);
	line-height: 1.14;
}
h3 {
	font-size: var(--rl-step-2);
}
h4 {
	font-size: var(--rl-step-1);
}

p {
	margin: 0 0 var(--rl-4);
	text-wrap: pretty;
}

a {
	color: var(--rl-blue-ink);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
	transition: color var(--rl-dur) var(--rl-ease);
}
a:hover {
	color: var(--rl-blue-900);
}

img,
svg,
video {
	max-width: 100%;
	height: auto;
	display: block;
}

/* Inline icons ship without width/height so they can inherit type size.
   This is the floor that stops an unstyled one rendering at 300×150 —
   component rules below override it where a fixed size is wanted. */
.rl-icon {
	width: 1.15em;
	height: 1.15em;
	flex: 0 0 auto;
}
.rl-badge .rl-icon {
	width: 1em;
	height: 1em;
}
.rl-btn .rl-icon {
	width: 1.1em;
	height: 1.1em;
}

ul,
ol {
	margin: 0 0 var(--rl-4);
	padding-left: 1.25em;
}
li {
	margin-bottom: 0.35em;
}

hr {
	border: 0;
	border-top: 1px solid var(--rl-line);
	margin: var(--rl-6) 0;
}

strong,
b {
	font-weight: 600;
}

small {
	font-size: var(--rl-step--1);
}

:focus-visible {
	outline: 2px solid var(--rl-blue-ink);
	outline-offset: 2px;
	border-radius: 4px;
}

::selection {
	background: var(--rl-blue-100);
	color: var(--rl-slate-900);
}

/* --- Accessibility helpers ------------------------------------------------ */

.screen-reader-text,
.rl-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.rl-skip-link {
	position: absolute;
	left: 50%;
	top: 0;
	transform: translate(-50%, -120%);
	background: var(--rl-slate-900);
	color: #fff;
	padding: 0.75rem 1.25rem;
	border-radius: 0 0 var(--rl-r-sm) var(--rl-r-sm);
	z-index: 999;
	font-weight: 600;
	text-decoration: none;
}
.rl-skip-link:focus {
	transform: translate(-50%, 0);
	color: #fff;
}

/* --- Layout primitives ---------------------------------------------------- */

.rl-wrap {
	width: 100%;
	max-width: var(--rl-wrap);
	margin-inline: auto;
	padding-inline: var(--rl-gutter);
}
.rl-wrap--wide {
	max-width: var(--rl-wrap-wide);
}
.rl-wrap--narrow {
	max-width: var(--rl-wrap-narrow);
}

.rl-section {
	padding-block: var(--rl-section);
}
.rl-section--tight {
	padding-block: clamp(2rem, 1.5rem + 3vw, 4rem);
}

.rl-stack > * + * {
	margin-top: var(--rl-4);
}

.rl-grid {
	display: grid;
	gap: var(--rl-5);
}
@media (min-width: 700px) {
	.rl-grid--2 {
		grid-template-columns: repeat(2, 1fr);
	}
	.rl-grid--3 {
		grid-template-columns: repeat(2, 1fr);
	}
}
@media (min-width: 980px) {
	.rl-grid--3 {
		grid-template-columns: repeat(3, 1fr);
	}
	.rl-grid--4 {
		grid-template-columns: repeat(4, 1fr);
	}
}
@media (min-width: 560px) and (max-width: 979px) {
	.rl-grid--4 {
		grid-template-columns: repeat(2, 1fr);
	}
}

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

.rl-eyebrow {
	font-family: var(--rl-font-display);
	font-size: var(--rl-step--1);
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--rl-blue-ink);
	margin: 0 0 var(--rl-3);
	display: block;
}
.rl-eyebrow--light {
	color: var(--rl-blue);
}

.rl-lead {
	font-size: var(--rl-step-1);
	line-height: 1.55;
	color: var(--rl-ink-2);
}

.rl-measure {
	max-width: 62ch;
}
.rl-center {
	text-align: center;
}
.rl-center .rl-measure {
	margin-inline: auto;
}

.rl-muted {
	color: var(--rl-ink-3);
}
.rl-fineprint {
	font-size: var(--rl-step--2);
	line-height: 1.55;
	color: var(--rl-ink-3);
}

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

.rl-btn,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit {
	--btn-bg: var(--rl-blue);
	--btn-fg: var(--rl-black);
	--btn-bd: transparent;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.55em;
	font-family: var(--rl-font-body);
	font-size: var(--rl-step-0);
	font-weight: 600;
	line-height: 1.2;
	padding: 0.95em 1.75em;
	min-height: 48px;
	border-radius: var(--rl-r-pill);
	border: 1.5px solid var(--btn-bd);
	background: var(--btn-bg);
	color: var(--btn-fg);
	text-decoration: none;
	cursor: pointer;
	text-align: center;
	transition: transform var(--rl-dur) var(--rl-ease), box-shadow var(--rl-dur) var(--rl-ease),
		background-color var(--rl-dur) var(--rl-ease), color var(--rl-dur) var(--rl-ease);
	-webkit-appearance: none;
	appearance: none;
}

.rl-btn:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover {
	background: var(--rl-blue-400);
	color: var(--rl-black);
	transform: translateY(-1px);
	box-shadow: var(--rl-shadow-md);
}

.rl-btn:active {
	transform: translateY(0);
}

.rl-btn--slate,
.woocommerce button.button.alt,
.woocommerce a.button.alt,
.woocommerce input.button.alt,
.woocommerce #respond input#submit.alt {
	--btn-bg: var(--rl-slate);
	--btn-fg: #fff;
}
.rl-btn--slate:hover,
.woocommerce button.button.alt:hover,
.woocommerce a.button.alt:hover,
.woocommerce input.button.alt:hover,
.woocommerce #respond input#submit.alt:hover {
	background: var(--rl-slate-700);
	color: #fff;
}

.rl-btn--ghost {
	--btn-bg: transparent;
	--btn-fg: var(--rl-slate-900);
	--btn-bd: var(--rl-slate-200);
}
.rl-btn--ghost:hover {
	background: var(--rl-slate-050);
	color: var(--rl-slate-900);
	--btn-bd: var(--rl-slate-400);
}

.rl-btn--ghost-light {
	--btn-bg: transparent;
	--btn-fg: #fff;
	--btn-bd: rgba(255, 255, 255, 0.45);
}
.rl-btn--ghost-light:hover {
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	--btn-bd: #fff;
}

.rl-btn--lg {
	font-size: var(--rl-step-1);
	padding: 1.05em 2.1em;
	min-height: 56px;
}
.rl-btn--sm {
	font-size: var(--rl-step--1);
	padding: 0.7em 1.25em;
	min-height: 40px;
}
.rl-btn--block {
	display: flex;
	width: 100%;
}

.rl-btn[disabled],
.rl-btn.is-loading,
.woocommerce .button[disabled] {
	opacity: 0.55;
	pointer-events: none;
}

.rl-btn.is-loading::after {
	content: "";
	width: 1em;
	height: 1em;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: rl-spin 0.7s linear infinite;
}

@keyframes rl-spin {
	to {
		transform: rotate(360deg);
	}
}

.rl-link-arrow {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	font-weight: 600;
	text-decoration: none;
}
.rl-link-arrow::after {
	content: "→";
	transition: transform var(--rl-dur) var(--rl-ease);
}
.rl-link-arrow:hover::after {
	transform: translateX(3px);
}

/* --- Forms ---------------------------------------------------------------- */

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="date"],
select,
textarea {
	width: 100%;
	font-family: inherit;
	font-size: max(16px, var(--rl-step-0)); /* 16px min stops iOS zoom on focus */
	line-height: 1.4;
	color: var(--rl-ink);
	background: #fff;
	border: 1.5px solid var(--rl-slate-200);
	border-radius: var(--rl-r-sm);
	padding: 0.8em 0.95em;
	min-height: 48px;
	transition: border-color var(--rl-dur) var(--rl-ease), box-shadow var(--rl-dur) var(--rl-ease);
	-webkit-appearance: none;
	appearance: none;
}

select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%233F5C74' d='M1.4 0 6 4.6 10.6 0 12 1.4 6 7.4 0 1.4z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 1rem center;
	background-size: 11px;
	padding-right: 2.6rem;
}

textarea {
	min-height: 120px;
	resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
	outline: none;
	border-color: var(--rl-blue-ink);
	box-shadow: 0 0 0 3px var(--rl-blue-100);
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"],
.rl-field.has-error input,
.rl-field.has-error select,
.rl-field.has-error textarea {
	border-color: var(--rl-danger);
}

label {
	display: block;
	font-weight: 500;
	font-size: var(--rl-step--1);
	color: var(--rl-slate-900);
	margin-bottom: 0.4rem;
}

.rl-field {
	margin-bottom: var(--rl-4);
}
.rl-field__hint {
	font-size: var(--rl-step--2);
	color: var(--rl-ink-3);
	margin-top: 0.35rem;
}
.rl-field__error {
	font-size: var(--rl-step--2);
	color: var(--rl-danger);
	margin-top: 0.35rem;
	font-weight: 500;
}
.rl-field:not(.has-error) .rl-field__error {
	display: none;
}

/* --- Badges & pills ------------------------------------------------------- */

.rl-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	font-size: var(--rl-step--2);
	font-weight: 600;
	letter-spacing: 0.02em;
	padding: 0.35em 0.8em;
	border-radius: var(--rl-r-pill);
	background: var(--rl-slate-100);
	color: var(--rl-slate-900);
	line-height: 1.35;
}
.rl-badge--rx {
	background: var(--rl-blue-050);
	color: var(--rl-blue-900);
	box-shadow: inset 0 0 0 1px var(--rl-blue-200);
}
.rl-badge--best {
	background: var(--rl-slate-900);
	color: #fff;
}
.rl-badge--save {
	background: var(--rl-success-bg);
	color: var(--rl-success);
}
.rl-badge--soon {
	background: var(--rl-warn-bg);
	color: var(--rl-warn);
}

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

.rl-card {
	background: #fff;
	border: 1px solid var(--rl-line);
	border-radius: var(--rl-r-lg);
	padding: var(--rl-5);
}
.rl-card--flush {
	padding: 0;
	overflow: hidden;
}
.rl-card--soft {
	background: var(--rl-surface-2);
	border-color: transparent;
}

/* --- Surfaces ------------------------------------------------------------- */

.rl-on-dark {
	background: var(--rl-slate-900);
	color: rgba(255, 255, 255, 0.86);
}
.rl-on-dark h1,
.rl-on-dark h2,
.rl-on-dark h3,
.rl-on-dark h4 {
	color: #fff;
}
/* Buttons carry their own colours — exempt them, or a blue link rule paints
   blue text onto a blue button. */
.rl-on-dark a:not(.rl-btn),
.rl-on-slate a:not(.rl-btn) {
	color: var(--rl-blue);
}
.rl-on-slate {
	background: var(--rl-slate);
	color: rgba(255, 255, 255, 0.9);
}
.rl-on-slate h1,
.rl-on-slate h2,
.rl-on-slate h3 {
	color: #fff;
}
.rl-on-soft {
	background: var(--rl-surface-2);
}
