/* ============================================================
   CRMove — front (header, footer, inner pages). Port of WPMove v3
   header.css / pages.css. Prefixes: .crh- header, .crf- footer.
   Colours: tokens --cr-* (plugin, crmove-tokens.css), light/dark.
   ============================================================ */

/* Ollie presets follow the tokens: existing page content and the plugin
   forms (login, register, pricing) switch to dark mode with the site. */
body.crf-site {
	--wp--preset--color--base: var(--cr-bg-page);
	--wp--preset--color--main: var(--cr-text);
	--wp--preset--color--main-accent: var(--cr-text-muted);
	--wp--preset--color--secondary: var(--cr-text-muted);
	--wp--preset--color--border-light: var(--cr-border);
	--wp--preset--color--primary: var(--cr-accent);
	--wp--preset--color--primary-accent: var(--cr-accent-subtle);
	--wp--preset--color--tertiary: var(--cr-bg);
	--wp--preset--color--contrast: var(--cr-text);
	background: var(--cr-bg-page);
	color: var(--cr-text);
	transition: background-color 0.2s ease, color 0.2s ease;
}

.crh *,
.crf * {
	box-sizing: border-box;
}

/* ---------- Header (always dark) ---------- */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	margin: 0 !important;
}

.admin-bar .site-header {
	top: 32px;
}

@media (max-width: 782px) {
	.admin-bar .site-header {
		top: 0;
	}
}

.crh {
	background: var(--cr-side-bg);
	color: #E8E8F2;
	transition: box-shadow 0.2s ease;
}

.crh.is-scrolled {
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.crh__inner {
	display: flex;
	align-items: center;
	gap: 28px;
	max-width: var(--cr-container);
	min-height: 68px;
	margin: 0 auto;
	padding: 0 24px;
}

.crh a {
	text-decoration: none;
}

.crh__brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: #FFFFFF !important;
	font-size: 19px;
	font-weight: 700;
	letter-spacing: -0.01em;
}

.crh__logo {
	width: 32px;
	height: 32px;
}

.crh__nav {
	display: flex;
	gap: 4px;
	margin-right: auto;
}

.crh__link {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	padding: 0 12px;
	border-radius: 8px;
	color: #C9C9DD !important;
	font-size: 14px;
	font-weight: 500;
}

.crh__link:hover {
	background: rgba(255, 255, 255, 0.07);
	color: #FFFFFF !important;
}

.crh__right {
	display: flex;
	align-items: center;
	gap: 8px;
}

.crh__lang,
.crh__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 10px;
	border: 1px solid rgba(255, 255, 255, 0.16);
	border-radius: 8px;
	background: transparent;
	color: #D4D4E6 !important;
	font: inherit;
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
	list-style: none;
}

.crh__icon::-webkit-details-marker,
.crh__avatar::-webkit-details-marker {
	display: none;
}

.crh__lang:hover,
.crh__icon:hover {
	border-color: rgba(255, 255, 255, 0.45);
	color: #FFFFFF !important;
}

.crh__icon svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.crh-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	padding: 0 16px;
	border-radius: 9px;
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
	text-decoration: none !important;
}

.crh-btn--primary {
	background: #5344F4;
	color: #FFFFFF !important;
}

.crh-btn--primary:hover {
	background: #4335D6;
}

/* Account menu */
.crh-dd {
	position: relative;
}

.crh__avatar {
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: #5344F4;
	color: #FFFFFF;
	font-weight: 700;
	cursor: pointer;
	list-style: none;
}

.crh-dd__panel {
	position: absolute;
	top: calc(100% + 10px);
	right: 0;
	display: flex;
	flex-direction: column;
	min-width: 230px;
	padding: 6px;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 12px;
	background: var(--cr-side-card);
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.crh-dd__panel a {
	padding: 9px 12px;
	border-radius: 8px;
	color: #E8E8F2 !important;
	font-size: 14px;
}

.crh-dd__panel a:hover {
	background: rgba(255, 255, 255, 0.07);
}

.crh-dd__who {
	padding: 8px 12px 10px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	margin-bottom: 4px;
	color: var(--cr-side-text);
	font-size: 12px;
	overflow: hidden;
	text-overflow: ellipsis;
}

.crh-dd__panel .crh-dd__muted {
	color: var(--cr-side-text) !important;
}

/* Mobile menu */
.crh-burger {
	display: none;
	position: relative;
}

.crh-burger__close,
.crh-burger[open] .crh-burger__open {
	display: none;
}

.crh-burger[open] .crh-burger__close {
	display: block;
}

.crh-burger__panel {
	position: absolute;
	top: calc(100% + 10px);
	right: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
	width: min(86vw, 320px);
	padding: 10px;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 14px;
	background: var(--cr-side-card);
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.crh-burger__panel a:not(.crh-btn) {
	padding: 11px 12px;
	border-radius: 8px;
	color: #E8E8F2 !important;
	font-size: 15px;
}

.crh-burger__panel .crh-btn {
	margin-top: 8px;
}

.crh-burger__sep {
	height: 1px;
	margin: 6px 4px;
	background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 960px) {
	.crh__nav,
	.crh-hide-sm {
		display: none;
	}

	.crh__right {
		margin-left: auto;
	}

	.crh-burger {
		display: block;
	}
}

@media (max-width: 480px) {
	.crh__inner {
		gap: 12px;
		padding: 0 16px;
	}

	.crh__lang {
		display: none;
	}
}

/* ---------- Footer (always dark) ---------- */
.site-footer {
	margin: 0 !important;
}

.crf {
	background: var(--cr-side-bg);
	color: var(--cr-side-text);
	font-size: 14px;
}

.crf a {
	text-decoration: none;
}

.crf__inner {
	display: grid;
	grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr));
	gap: 40px;
	max-width: var(--cr-container);
	margin: 0 auto;
	padding: 64px 24px 40px;
}

.crf__brand {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 16px;
	max-width: 340px;
}

.crf__brand p {
	margin: 0;
	line-height: 1.6;
}

.crf__logo {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: #FFFFFF !important;
	font-size: 18px;
	font-weight: 700;
}

.crf__mark {
	width: 30px;
	height: 30px;
}

.crf__col {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.crf__col strong {
	margin-bottom: 4px;
	color: #FFFFFF;
	font-size: 13px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.crf__col a,
.crf__langs a {
	color: var(--cr-side-text) !important;
}

.crf__col a:hover,
.crf__langs a:hover {
	color: #FFFFFF !important;
}

.crf__bottom {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 12px;
	max-width: var(--cr-container);
	margin: 0 auto;
	padding: 20px 24px 28px;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	font-size: 13px;
}

@media (max-width: 860px) {
	.crf__inner {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 32px;
	}

	.crf__brand {
		grid-column: 1 / -1;
	}
}

/* ---------- Inner pages (existing content, CSS only) ---------- */
body.crf-site:not(.home) .site-content,
body.crf-site:not(.home) main.wp-block-group {
	background: var(--cr-bg-page);
}

body.crf-site:not(.home) :where(h1, h2, h3) {
	letter-spacing: -0.015em;
}

body.crf-site:not(.home) h1.wp-block-post-title,
body.crf-site:not(.home) .wp-block-post-title {
	font-size: clamp(30px, 3.6vw, 44px);
	font-weight: 700;
}

/* Plugin forms and pricing cards: brand accent buttons, softer radii. */
body.crf-site .crmove-btn {
	border-radius: 9px;
	background: var(--cr-accent);
	color: #FFFFFF;
	font-weight: 600;
}

body.crf-site .crmove-btn:hover:not(:disabled) {
	background: var(--cr-accent-hover);
	opacity: 1;
}

body.crf-site .crmove-btn--outline,
body.crf-site .crmove-btn--secondary {
	background: transparent;
	color: var(--cr-text);
	border: 1px solid var(--cr-border-strong);
}

body.crf-site .crmove-btn--outline:hover:not(:disabled),
body.crf-site .crmove-btn--secondary:hover:not(:disabled) {
	background: var(--cr-accent-subtle);
	border-color: var(--cr-accent);
}

/* Ollie paints every field white: follow the tokens instead (dark mode). */
body.crf-site :is(.crmove-wrap, .crmove-auth-wrap, .crmove-auth, form) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]), select, textarea) {
	background-color: var(--cr-surface);
	color: var(--cr-text);
	border-color: var(--cr-border);
}

/* ---------- Inner pages: title + content width ---------- */
body.crf-site:not(.home) main.wp-block-group {
	padding-top: clamp(48px, 7vw, 88px) !important;
	padding-bottom: clamp(56px, 8vw, 104px) !important;
}

body.crf-site:not(.home) .wp-block-post-title {
	margin-bottom: 8px;
	color: var(--cr-text);
	font-size: clamp(32px, 4vw, 46px) !important;
	font-weight: 750;
	line-height: 1.1;
	text-align: center;
}

body.crf-site:not(.home) .entry-content {
	color: var(--cr-text);
	font-size: 16px;
	line-height: 1.7;
}

/* Long text (privacy, terms): comfortable reading measure and rhythm. */
body.crf-site:not(.home) .entry-content :where(h2) {
	margin-top: 2.2em;
	font-size: clamp(22px, 2.4vw, 28px);
	font-weight: 700;
	letter-spacing: -0.015em;
}

body.crf-site:not(.home) .entry-content :where(h3) {
	margin-top: 1.6em;
	font-size: 19px;
	font-weight: 650;
}

body.crf-site:not(.home) .entry-content :where(p, li) {
	color: var(--cr-text-muted);
}

body.crf-site:not(.home) .entry-content :where(strong) {
	color: var(--cr-text);
}

body.crf-site .entry-content a:not(.crmove-btn):not(.wp-block-button__link) {
	color: var(--cr-accent);
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

/* Pages whose content opens with its own full-width padded section (contact…):
   the template's top padding plus the section's doubled the space above the title. */
body.crf-site:not(.home) .entry-content > .wp-block-group.alignfull:first-child {
	padding-top: 0 !important;
}

/* Payment return opened without a payment: neutral (information) state. */
body.crf-site .crmove-payment-return--neutral .crmove-payment-return__icon {
	background: var(--cr-accent-subtle);
	color: var(--cr-accent);
}

/* A heading opening a card or a section never adds its own top margin
   (the long-text rhythm above is for headings in running text). */
body.crf-site:not(.home) .entry-content :where(h1, h2, h3, h4):first-child,
body.crf-site:not(.home) .entry-content .wp-block-group > :where(h1, h2, h3, h4):first-child {
	margin-top: 0;
}

/* Icons for page content (replace emojis — see todo/harnais/content-fix-icons.php). */
body.crf-site .entry-content .crf-icon-mail {
	display: flex;
	align-items: center;
	gap: 10px;
}

body.crf-site .entry-content .crf-icon-mail::before {
	content: "";
	flex: none;
	width: 20px;
	height: 20px;
	background: var(--cr-accent);
	-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='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3 7 9 6 9-6'/%3E%3C/svg%3E") center / contain 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='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3 7 9 6 9-6'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Bordered groups of the existing page content (contact cards…): token colours. */
body.crf-site .entry-content .wp-block-group.has-border-color,
body.crf-site .entry-content .wp-block-group[style*="border-width"] {
	border-color: var(--cr-border) !important;
	border-radius: var(--cr-radius) !important;
	background: var(--cr-surface);
}

/* ---------- Pricing page ([crmove_pricing]) ---------- */
body.crf-site .crmove-pricing-wrap {
	max-width: 1080px;
	margin: 0 auto;
}

body.crf-site .crmove-plans-grid {
	gap: 18px;
	margin: 24px 0 20px;
}

body.crf-site .crmove-plan-card {
	padding: 26px 22px;
	border-color: var(--cr-border);
	border-radius: var(--cr-radius);
	background: var(--cr-surface);
	box-shadow: none;
}

body.crf-site .crmove-plan-card--current {
	border: 2px solid var(--cr-accent);
	box-shadow: 0 18px 40px -22px color-mix(in srgb, var(--cr-accent) 70%, transparent);
}

body.crf-site .crmove-plan-name {
	font-size: 18px;
}

body.crf-site .crmove-plan-amount {
	font-size: 34px;
	font-weight: 750;
	letter-spacing: -0.02em;
}

body.crf-site .crmove-plan-features {
	gap: 10px;
}

body.crf-site .crmove-plan-feature {
	color: var(--cr-text);
	font-size: 14px;
}

body.crf-site .crmove-plan-feature::before {
	color: var(--cr-success);
}

/* Same button in every card: full width, one centred line. */
body.crf-site .crmove-plan-cta {
	width: 100%;
	min-height: 46px;
	padding: 0 14px;
	font-size: 15px;
	text-align: center;
	white-space: nowrap;
}

body.crf-site .crmove-notice {
	border-radius: var(--cr-radius-sm);
	color: var(--cr-text);
}

body.crf-site .crmove-notice--info {
	background: var(--cr-accent-subtle);
	border-left-color: var(--cr-accent);
}

/* ---------- Login / register: form card + side panel ---------- */
.crf-auth {
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
	max-width: 980px;
	margin: 24px auto 0;
	border: 1px solid var(--cr-border);
	border-radius: 18px;
	background: var(--cr-surface);
	box-shadow: 0 24px 60px -32px rgba(18, 17, 28, 0.35);
	overflow: hidden;
}

.crf-auth__form {
	padding: clamp(24px, 4vw, 40px);
}

.crf-auth__form .crmove-wrap,
.crf-auth__form .crmove-section {
	max-width: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
}

/* The page title already says it ("Register"): drop the form's own heading. */
body.crf-site .entry-content .crf-auth__form h2 {
	display: none;
}

.crf-auth__form .crmove-fields-row {
	grid-template-columns: minmax(0, 1fr);
}

.crf-auth__form .crmove-auth-form {
	gap: 16px;
}

.crf-auth__form .crmove-auth-form label {
	color: var(--cr-text-muted);
	font-size: 13px;
	font-weight: 500;
}

body.crf-site .crf-auth__form :is(input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]), select) {
	min-height: 44px;
	padding: 10px 12px;
	border-radius: var(--cr-radius-sm);
	font-size: 15px;
}

.crf-auth__form .crmove-auth-form button[type="submit"] {
	width: 100%;
	min-height: 46px;
	font-size: 15px;
}

.crf-auth__form .crmove-auth-link {
	margin-top: 18px;
	color: var(--cr-text-muted);
	font-size: 14px;
	text-align: center;
}

.crf-auth__aside {
	display: flex;
	flex-direction: column;
	gap: 18px;
	padding: clamp(24px, 4vw, 40px);
	background: var(--cr-band);
	color: rgba(255, 255, 255, 0.86);
}

.crf-auth__logo {
	width: 40px;
	height: 40px;
}

.crf-auth__aside h2 {
	margin: 0;
	color: #FFFFFF;
	font-size: 24px;
	font-weight: 700;
	letter-spacing: -0.015em;
	line-height: 1.2;
}

.crf-auth__aside ul {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 15px;
	line-height: 1.5;
}

.crf-auth__aside li {
	display: flex;
	gap: 10px;
	align-items: flex-start;
}

.crf-auth__aside svg {
	flex: none;
	width: 18px;
	height: 18px;
	margin-top: 2px;
	fill: none;
	stroke: #C9C3FF;
	stroke-width: 2.4;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.crf-auth__aside p {
	margin: auto 0 0;
	color: rgba(255, 255, 255, 0.65);
	font-size: 13px;
}

/* The panel sits inside .entry-content: beat the long-text typography above. */
body.crf-site .entry-content .crf-auth__aside :is(li, span) {
	color: rgba(255, 255, 255, 0.9);
}

body.crf-site .entry-content .crf-auth__aside p {
	color: rgba(255, 255, 255, 0.7);
}

body.crf-site .entry-content .crf-auth__aside h2 {
	margin: 0;
	color: #FFFFFF;
	font-size: 24px;
}

body.crf-site .entry-content .crf-auth__aside .crf-auth__logo {
	width: 40px;
	height: 40px;
}

@media (max-width: 760px) {
	.crf-auth {
		grid-template-columns: minmax(0, 1fr);
	}

	/* The form comes first on mobile; the panel follows it. */
	.crf-auth__aside p {
		margin-top: 0;
	}
}