/* ClerkPages – demand-test site. Plain CSS, no framework. */
:root {
  --ink: #1a1f36;
  --ink-soft: #3d4460;
  --paper: #ffffff;
  --paper-tint: #f4f6f2;
  --brand: #005a4e;        /* 7.6:1 on white */
  --brand-dark: #00423a;
  --accent: #ffdd00;       /* focus colour, GOV.UK-style */
  --line: #6b7280;         /* 4.8:1 on white – non-text contrast */
  --line-soft: #d4d8de;
  --error: #b00020;
  --success: #00703c;
  --radius: 6px;
  --measure: 70ch;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 1rem; }
body {
  overflow-wrap: break-word;
  margin: 0; font-family: var(--font); font-size: 1.125rem; line-height: 1.6;
  color: var(--ink); background: var(--paper);
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
img { max-width: 100%; height: auto; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--brand-dark); text-decoration-thickness: 3px; }
a:visited { color: #4c2c92; }
:focus-visible {
  outline: 3px solid var(--ink); outline-offset: 0;
  box-shadow: 0 0 0 6px var(--accent);
}
a:focus-visible { background: var(--accent); color: var(--ink); text-decoration: none; box-shadow: 0 -2px var(--accent), 0 4px var(--ink); outline: none; }

.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 10;
  background: var(--accent); color: var(--ink); padding: 0.75rem 1rem; font-weight: 700;
}
.skip-link:focus { top: 1rem; }

.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1.25rem; }
.prose { max-width: var(--measure); }

/* Header */
.site-header { background: var(--paper); }
.site-header > .wrap { border-bottom: 0; }
.preview-banner { border-top: 4px solid var(--brand); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem; padding-top: 0.75rem; padding-bottom: 0.75rem; }
.logo { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 800; font-size: 1.35rem; color: var(--ink); text-decoration: none; }
.logo:visited { color: var(--ink); }
.logo svg { flex: none; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.site-nav a { display: inline-flex; align-items: center; padding: 0.25rem 0.1rem; min-height: 44px; line-height: 1.3; color: var(--ink); font-weight: 600; }
@media (max-width: 40rem) { .site-nav ul { gap: 0 1rem; } .site-nav a { font-size: 1rem; } }
.site-nav a:visited { color: var(--ink); }
.site-nav a[aria-current="page"] { text-decoration-thickness: 3px; }

.preview-banner { background: var(--paper-tint); border-bottom: 1px solid var(--line-soft); font-size: 1rem; }
.preview-banner p { margin: 0; padding: 0.6rem 0; }
.tag { display: inline-block; background: var(--ink); color: #fff; font-weight: 700; font-size: 0.85rem; letter-spacing: 0.02em; padding: 0.1rem 0.5rem; border-radius: 3px; margin-right: 0.5rem; text-transform: uppercase; }

/* Type */
h1, h2, h3, h4 { line-height: 1.25; margin: 2rem 0 0.75rem; color: var(--ink); }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); margin-top: 0; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.3rem; }
p, ul, ol, dl { margin: 0 0 1rem; }
li { margin-bottom: 0.4rem; }
.lede { font-size: 1.3rem; color: var(--ink-soft); max-width: 60ch; }
.small { font-size: 1rem; }
.muted { color: var(--ink-soft); }

/* Sections */
main { display: block; }
.hero { padding: 3rem 0 2.5rem; background: var(--paper-tint); border-bottom: 1px solid var(--line-soft); }
.section { padding: 2.5rem 0; }
.section--tint { background: var(--paper-tint); }
.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.25rem 0.5rem; }
.card h3 { margin-top: 0; }
.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.steps li { counter-increment: step; border-left: 4px solid var(--brand); padding: 0.25rem 0 0.25rem 1rem; }
.steps li::before { content: "Step " counter(step); display: block; font-weight: 700; color: var(--brand); }
.callout { border-left: 6px solid var(--brand); background: var(--paper-tint); padding: 1rem 1.25rem; margin: 1.5rem 0; max-width: var(--measure); }
.callout--warn { border-left-color: #8a5a00; }
.callout > :last-child { margin-bottom: 0; }

/* Buttons */
.button, button {
  font: inherit; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0.6rem 1.25rem; border-radius: var(--radius); cursor: pointer;
  border: 2px solid var(--brand); background: var(--brand); color: #fff; text-decoration: none; line-height: 1.2;
}
.button:visited { color: #fff; }
.button:hover, button:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; text-decoration: none; }
.button--secondary, button.button--secondary { background: var(--paper); color: var(--brand); }
.button--secondary:visited { color: var(--brand); }
.button--secondary:hover, button.button--secondary:hover { background: var(--paper-tint); color: var(--brand-dark); }
.button:focus-visible, button:focus-visible { outline: 3px solid var(--ink); box-shadow: 0 0 0 6px var(--accent); background: var(--accent); color: var(--ink); border-color: var(--ink); }
.button-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0; }
.link-button { background: none; border: none; color: var(--brand); text-decoration: underline; padding: 0.25rem 0; min-height: 44px; font-weight: 600; }
.link-button:hover { background: none; color: var(--brand-dark); text-decoration-thickness: 3px; }
.link-button:focus-visible { background: var(--accent); color: var(--ink); }

/* Pricing */
.price { font-size: 2.5rem; font-weight: 800; margin: 0; line-height: 1.1; }
.price small { font-size: 1.1rem; font-weight: 600; color: var(--ink-soft); }
.plan { border: 2px solid var(--brand); border-radius: var(--radius); padding: 1.5rem; max-width: 34rem; background: var(--paper); }
.plan ul { padding-left: 1.25rem; }

/* FAQ */
.faq details { border-top: 1px solid var(--line); max-width: var(--measure); }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 0.9rem 0; font-weight: 700; font-size: 1.15rem; min-height: 44px; list-style-position: outside; margin-left: 1.25rem; }
.faq details > div { padding: 0 0 1rem 1.25rem; }

/* Forms */
.form-group { margin-bottom: 1.5rem; max-width: 40rem; }
.form-group--error { border-left: 5px solid var(--error); padding-left: 1rem; }
label, legend { display: block; font-weight: 700; margin-bottom: 0.25rem; }
legend { font-size: 1.15rem; padding: 0; }
fieldset { border: 0; margin: 0 0 1.5rem; padding: 0; min-width: 0; }
.hint { display: block; color: var(--ink-soft); font-size: 1rem; margin-bottom: 0.4rem; font-weight: 400; }
.error-message { display: block; color: var(--error); font-weight: 700; margin-bottom: 0.4rem; }
input[type="text"], input[type="email"], input[type="url"], input[type="tel"], input[type="date"], input[type="number"], select, textarea {
  font: inherit; width: 100%; max-width: 100%; padding: 0.55rem 0.65rem; min-height: 48px;
  border: 2px solid var(--ink); border-radius: 0; background: #fff; color: var(--ink);
}
textarea { min-height: 7rem; resize: vertical; }
input.input--short { max-width: 10rem; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 0; box-shadow: inset 0 0 0 2px var(--ink); }
.input--error { border-color: var(--error) !important; }
.choice { display: flex; align-items: flex-start; gap: 0.6rem; margin-bottom: 0.6rem; }
.choice input { width: 1.6rem; height: 1.6rem; margin: 0.15rem 0 0; flex: none; accent-color: var(--brand); }
.choice label { font-weight: 400; margin: 0; }
.choice .hint { margin: 0; }
.error-summary { border: 5px solid var(--error); padding: 1rem 1.25rem; margin-bottom: 1.5rem; max-width: 40rem; }
.error-summary h2 { margin-top: 0; font-size: 1.3rem; }
.error-summary a { color: var(--error); font-weight: 700; }
.notice-success { border: 5px solid var(--success); padding: 1rem 1.25rem; max-width: 40rem; }
.notice-success h2, .notice-success h3 { margin-top: 0; }

/* Generator */
.gen-layout { display: grid; gap: 2rem; }
@media (min-width: 70rem) { .gen-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } .gen-output { position: sticky; top: 1rem; } }
.issue { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1rem 0.25rem; margin-bottom: 1rem; background: var(--paper); }
.issue h4 { margin: 0 0 0.75rem; font-size: 1.1rem; }
.gen-output { border: 2px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; background: #fff; }
.preview-box { display: block; width: 100%; height: 32rem; border: 2px solid var(--line); background: #fff; }
.preview-box h1 { font-size: 1.6rem; margin-top: 0.75rem; }
.preview-box h2 { font-size: 1.3rem; }
.preview-box h3 { font-size: 1.1rem; }
.code-box { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9rem; min-height: 12rem; }
.tabs-note { font-size: 1rem; }
.status { min-height: 1.6em; font-weight: 700; color: var(--success); }

/* Articles */
.article-meta { color: var(--ink-soft); font-size: 1rem; }
.toc { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem 0.25rem; max-width: var(--measure); background: var(--paper-tint); }
.toc h2 { margin-top: 0; font-size: 1.2rem; }
.sources li { word-break: break-word; }
table { border-collapse: collapse; width: 100%; max-width: var(--measure); margin-bottom: 1.25rem; font-size: 1rem; }
caption { text-align: left; font-weight: 700; padding-bottom: 0.5rem; }
th, td { overflow-wrap: anywhere; border: 1px solid var(--line); padding: 0.5rem 0.65rem; text-align: left; vertical-align: top; }
th { background: var(--paper-tint); }
blockquote { margin: 1rem 0; padding: 0.5rem 1rem; border-left: 4px solid var(--line); color: var(--ink-soft); max-width: var(--measure); }
.breadcrumbs ol { list-style: none; padding: 0; margin: 1rem 0; display: flex; flex-wrap: wrap; gap: 0.25rem; font-size: 1rem; }
.breadcrumbs li:not(:last-child)::after { content: "›"; margin-left: 0.4rem; color: var(--ink-soft); }

/* Footer */
.site-footer { margin-top: 3rem; border-top: 4px solid var(--brand); background: var(--paper-tint); padding: 2rem 0; font-size: 1rem; }
.site-footer ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.site-footer a { display: inline-block; min-height: 44px; line-height: 2.6; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (forced-colors: active) {
  .button, button { border: 2px solid ButtonText; }
  :focus-visible { outline: 3px solid Highlight; }
}
@media print {
  .site-header nav, .skip-link, .site-footer, .preview-banner, form, .button-row { display: none; }
}
.error-summary:focus, .notice-success:focus, #output-title:focus, main:focus { outline: 3px solid var(--accent); outline-offset: 4px; }
main:focus { outline: none; }

/* Honeypot: hidden from people, visible to naive bots */
.hp-field { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
