/* Codedruns shared foundation: tokens, type, buttons, forms. See DESIGN.md. */
:root {
  --bg: #f5f7f4;
  --surface: #e8ebef;
  --ink: #131a2d;
  --muted: #4a5168;
  --accent: #c8473b;
  --accent-hover: #a93a30;
  --accent-ink: #ffffff;
  --warn-bg: #fdecc8;
  --warn-ink: #5c3b00;
  --line: #cfd4dc;
  --green: #17874e;
  --coral: #e86154;
  --radius: 14px;
  --gutter: clamp(16px, 3vw, 32px);
  --display: "Bricolage Grotesque", "Source Sans 3", system-ui, sans-serif;
  --text: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --step-small: clamp(0.875rem, 0.85rem + 0.1vw, 0.9375rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2rem, 1.3rem + 3.2vw, 4rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--text); font-size: var(--step-body); line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--ink); }
h1, h2, h3 { color: var(--ink); }
::selection { background: var(--ink); color: var(--bg); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.head { font-family: var(--display); font-weight: 800; font-size: clamp(2.25rem, 1.6rem + 2.4vw, 3.5rem); line-height: 1.02; letter-spacing: -0.02em; margin: 0 0 16px; }
.head-sm { font-family: var(--display); font-weight: 700; font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.25rem); line-height: 1.05; letter-spacing: -0.015em; margin: 0; }
.label { font-size: 1.125rem; font-weight: 700; margin: 0 0 12px; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; }
.skip:focus { top: 12px; }

/* Logo: 1d "The Conversation" mark + wordmark. */
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo-mark { flex: none; }
.logo-word { font-family: var(--display); font-weight: 800; font-size: 1.6rem; line-height: 1; letter-spacing: -0.04em; }
.logo-dot { color: var(--coral); }
.logo-dark { color: #f8f5ee; }
.logo-dark .logo-dot { color: #f17264; }

/* Buttons: flat, fully round, one fill. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 28px; border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: 700 1.0625rem/1.2 var(--text); text-decoration: none; cursor: pointer; transition: background-color .2s ease, transform .15s ease; }
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: scale(.98); }
.btn[disabled], .btn.is-busy { opacity: .6; cursor: progress; }
.btn-small { min-height: 40px; padding: 8px 18px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-quiet { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 18px; border: 0; border-radius: 999px; background: var(--surface); color: var(--ink); font: 600 1rem/1.2 var(--text); text-decoration: none; cursor: pointer; transition: background-color .2s ease; }
.btn-quiet:hover { background: #dce0e7; }
.btn-danger { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 18px; border: 0; border-radius: 999px; background: #7f1d1d; color: #fff; font: 700 1rem/1.2 var(--text); cursor: pointer; }
.textlink { color: var(--ink); font-weight: 600; text-underline-offset: 4px; }
.textlink:hover { text-decoration-thickness: 2px; }
.link { background: none; border: 0; color: var(--ink); font: 600 15px/1 var(--text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 12px 6px; }

/* Forms: real fields keep their lines. */
.form { display: grid; gap: 20px; }
.field { display: grid; gap: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label { font-weight: 600; font-size: 1rem; }
input, select, textarea { font: 400 1.0625rem/1.4 var(--text); color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 14px; min-height: 48px; width: 100%; transition: border-color .2s ease; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: 3px solid rgba(19, 26, 45, .16); outline-offset: 0; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--accent); }
textarea { resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; min-height: 0; accent-color: var(--ink); margin: 0; flex: none; }
.check { grid-template-columns: auto 1fr; align-items: start; column-gap: 12px; }
.check label { font-weight: 400; }
.check .field-error { grid-column: 1 / -1; }
.check-inline { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; min-height: 44px; }
fieldset { border: 0; padding: 0; margin: 0 0 8px; }
legend { font-weight: 700; margin-bottom: 8px; }
.hint { font-size: var(--step-small); color: var(--muted); margin: 0; }
.field-error { color: var(--accent); font-weight: 600; font-size: var(--step-small); margin: 0; }
.form-foot { margin: 0; text-align: center; font-size: var(--step-small); }

.flash { max-width: 720px; margin: 12px auto; padding: 14px 18px; border-radius: 12px; background: var(--surface); }
.flash-error { background: #fde4e8; color: #7a0c25; }
.flash-ok { background: #dcefe4; }

@media (max-width: 640px) {
  .field-row { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
