/**
 * Hewn — Account page template.
 * Design tokens mirror DESIGN.md (light theme).
 */

:root {
	--hewn-canvas: #F4F5F7;
	--hewn-surface: #FFFFFF;
	--hewn-tonal: #F3F4F6;
	--hewn-hairline: #EBEBEB;
	--hewn-ink: #0A0E1A;
	--hewn-muted: #6B6B7B;
	--hewn-ember: #F55F00;
	--hewn-ember-deep: #CC4D00;
	--hewn-ember-wash: #FFF0E8;
	--hewn-green: #2A7A2A;
	--hewn-green-wash: #E6F5E6;
	--hewn-red: #CC1A1A;
	--hewn-red-wash: #FDE8E8;
	--hewn-r-card: 16px;
	--hewn-r-btn: 14px;
	--hewn-r-field: 6px;
	--hewn-step: 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

@supports (corner-shape: superellipse(1.8)) {
	.hewn-page .hewn-card,
	.hewn-page .hewn-btn,
	.hewn-page .hewn-field,
	.hewn-page .hewn-flash { corner-shape: superellipse(1.8); }
}

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

body.hewn-page {
	margin: 0;
	background: var(--hewn-canvas);
	color: var(--hewn-ink);
	font-family: 'Switzer', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
	font-size: 16px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

.hewn-wrap {
	max-width: 1120px;
	margin: 0 auto;
	padding: 32px 20px 96px;
}

/* ---------- masthead ---------- */

.hewn-masthead {
	display: flex;
	align-items: baseline;
	gap: 12px;
	padding-bottom: 24px;
	border-bottom: 1px solid var(--hewn-hairline);
	margin-bottom: 48px;
}

.hewn-wordmark {
	font-size: 22px;
	font-weight: 700;
	letter-spacing: -0.02em;
	color: var(--hewn-ink);
	text-decoration: none;
}

.hewn-masthead span { font-size: 12px; color: var(--hewn-muted); }

/* ---------- editorial split ---------- */

.hewn-split { display: grid; gap: 48px; align-items: start; }

@media (min-width: 1000px) {
	.hewn-split { grid-template-columns: minmax(0, 26rem) minmax(0, 1fr); gap: 72px; }
	.hewn-lede { position: sticky; top: 40px; }
	.hewn-wrap { padding-top: 48px; }
}

.hewn-page h1 {
	font-size: 36px;
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.025em;
	margin: 0 0 16px;
	text-wrap: balance;
}

.hewn-lede > p {
	font-size: 17px;
	color: var(--hewn-muted);
	margin: 0 0 20px;
	max-width: 34rem;
	text-wrap: pretty;
}

.hewn-contact {
	font-size: 15px;
	color: var(--hewn-muted);
	padding-top: 20px;
	border-top: 1px solid var(--hewn-hairline);
	margin-top: 28px;
}

.hewn-updated {
	display: block;
	font-size: 13px;
	color: var(--hewn-muted);
	margin-bottom: 12px;
}

/* Long policy prose wants a comfortable measure. */
.hewn-page .hewn-card p { line-height: 1.65; }

.hewn-page a { color: var(--hewn-ember-deep); text-underline-offset: 3px; }
.hewn-page a:hover { color: var(--hewn-ember); }

/* The wordmark is a link but reads as identity, not an action. */
.hewn-page a.hewn-wordmark { color: var(--hewn-ink); }
.hewn-page a.hewn-wordmark:hover { color: var(--hewn-ember-deep); }

/* ---------- cards (core group blocks) ---------- */

.hewn-page .hewn-card {
	background: var(--hewn-surface);
	border: 1px solid var(--hewn-hairline);
	border-radius: var(--hewn-r-card);
	padding: 28px;
}

.hewn-page .hewn-card + .hewn-card { margin-top: 20px; }

.hewn-page .hewn-card h2 {
	font-size: 18px;
	font-weight: 600;
	letter-spacing: -0.01em;
	margin: 0 0 4px;
	line-height: 1.35;
}

.hewn-page .hewn-card p {
	margin: 0 0 20px;
	max-width: 62ch;
}

.hewn-page .hewn-card p.hewn-sub {
	color: var(--hewn-muted);
	font-size: 15px;
	margin: 0 0 24px;
}

.hewn-page .hewn-card > *:last-child { margin-bottom: 0; }

/* ---------- unordered lists render as hairline rows ---------- */

.hewn-page .hewn-card ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.hewn-page .hewn-card ul li {
	padding: 14px 0;
	border-top: 1px solid var(--hewn-hairline);
}

.hewn-page .hewn-card ul li:first-child { border-top: 0; padding-top: 0; }
.hewn-page .hewn-card ul li:last-child { padding-bottom: 0; }

/* "Term — note" rows: the term stays ink, the note recedes. */
.hewn-page .hewn-card ul li:has(strong) { color: var(--hewn-muted); }

.hewn-page .hewn-card ul li strong {
	font-weight: 500;
	color: var(--hewn-ink);
}

/* Prose following a list needs its own air. */
.hewn-page .hewn-card ul + p { margin-top: 24px; }

/* A heading straight into a list has no intro paragraph to space it. */
.hewn-page .hewn-card h2 + ul,
.hewn-page .hewn-card h2 + ol { margin-top: 22px; }

/* ---------- ordered lists render as a numbered timeline ---------- */

.hewn-page .hewn-card ol {
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: hewn-step;
}

.hewn-page .hewn-card ol li {
	position: relative;
	padding: 0 0 24px 44px;
	counter-increment: hewn-step;
	color: var(--hewn-muted);
}

.hewn-page .hewn-card ol li::before {
	content: counter(hewn-step);
	position: absolute;
	left: 0;
	top: 0;
	width: 28px;
	height: 28px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: var(--hewn-ember-wash);
	color: var(--hewn-ember-deep);
	font-size: 13px;
	font-weight: 600;
}

.hewn-page .hewn-card ol li::after {
	content: "";
	position: absolute;
	left: 13.5px;
	top: 32px;
	bottom: 4px;
	width: 1px;
	background: var(--hewn-hairline);
}

.hewn-page .hewn-card ol li:last-child { padding-bottom: 0; }
.hewn-page .hewn-card ol li:last-child::after { display: none; }

.hewn-page .hewn-card ol li strong {
	display: block;
	font-weight: 500;
	color: var(--hewn-ink);
}

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

.hewn-form { margin: 0; }

.hewn-field-group { margin-bottom: 24px; }

.hewn-lbl {
	display: block;
	font-size: 15px;
	font-weight: 500;
	margin-bottom: 8px;
}

.hewn-hint {
	display: block;
	font-weight: 400;
	color: var(--hewn-muted);
	font-size: 14px;
	margin-top: 2px;
}

.hewn-field {
	width: 100%;
	font: inherit;
	font-size: 16px;
	color: var(--hewn-ink);
	background: var(--hewn-tonal);
	border: 1px solid transparent;
	border-radius: var(--hewn-r-field);
	padding: 14px;
	min-height: 52px;
	transition: background var(--hewn-step), border-color var(--hewn-step);
}

textarea.hewn-field { min-height: 104px; resize: vertical; line-height: 1.5; }

.hewn-field::placeholder { color: #7A7A8A; }

.hewn-field:hover { background: #EDEEF1; }

.hewn-field:focus,
.hewn-field:focus-visible {
	outline: none;
	background: var(--hewn-surface);
	border-color: var(--hewn-ember);
	box-shadow: inset 0 0 0 1px var(--hewn-ember);
}

.hewn-field[aria-invalid="true"] {
	border-color: var(--hewn-red);
	box-shadow: inset 0 0 0 1px var(--hewn-red);
}

.hewn-err {
	display: block;
	color: var(--hewn-red);
	font-size: 14px;
	margin-top: 8px;
}

.hewn-confirm {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 12px;
	align-items: start;
	padding: 16px;
	background: var(--hewn-tonal);
	border-radius: var(--hewn-r-field);
	font-size: 15px;
	cursor: pointer;
}

.hewn-confirm input {
	width: 22px;
	height: 22px;
	margin: 1px 0 0;
	accent-color: var(--hewn-ember-deep);
	cursor: pointer;
}

.hewn-btn {
	appearance: none;
	border: 0;
	font: inherit;
	font-size: 16px;
	font-weight: 600;
	color: #FFFFFF;
	background: var(--hewn-ember-deep);
	border-radius: var(--hewn-r-btn);
	min-height: 52px;
	padding: 0 28px;
	cursor: pointer;
	transition: background var(--hewn-step), transform 140ms cubic-bezier(0.22, 1, 0.36, 1);
}

.hewn-btn:hover { background: #B84500; }
.hewn-btn:active { transform: scale(0.985); }

.hewn-btn:focus-visible {
	outline: 2px solid var(--hewn-ember);
	outline-offset: 3px;
}

.hewn-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
	margin-top: 28px;
	padding-top: 24px;
	border-top: 1px solid var(--hewn-hairline);
}

.hewn-page .hewn-fineprint {
	font-size: 14px;
	color: var(--hewn-muted);
	margin: 0;
}

.hewn-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ---------- flashes ---------- */

.hewn-page .hewn-flash {
	border-radius: var(--hewn-r-card);
	padding: 20px 24px;
	margin: 0 0 24px;
	border: 1px solid;
}

.hewn-page .hewn-flash strong {
	display: block;
	font-size: 18px;
	font-weight: 600;
	margin-bottom: 6px;
}

.hewn-page .hewn-flash p { margin: 0; font-size: 15px; }

.hewn-page .hewn-flash.ok { background: var(--hewn-green-wash); border-color: #C4E4C4; }
.hewn-page .hewn-flash.ok strong { color: var(--hewn-green); }
.hewn-page .hewn-flash.ok p { color: #1F5C1F; }

.hewn-page .hewn-flash.bad { background: var(--hewn-red-wash); border-color: #F3C9C9; }
.hewn-page .hewn-flash.bad strong { color: var(--hewn-red); }
.hewn-page .hewn-flash.bad p { color: #961414; }

/* ---------- footer ---------- */

.hewn-footer {
	margin-top: 64px;
	padding-top: 24px;
	border-top: 1px solid var(--hewn-hairline);
	font-size: 14px;
	color: var(--hewn-muted);
}

/* ---------- editor parity ---------- */

.hewn-page .wp-block-group.hewn-card > *:first-child { margin-top: 0; }

@media (prefers-reduced-motion: reduce) {
	.hewn-page * {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
	.hewn-btn:active { transform: none; }
}
