/* The Toby Center – New Contractor Forms (design concept)
   Light theme only, brand taken from thetobycenter.org */

:root {
  color-scheme: light only;
  --sky: #69a3e1;          /* site link / footer blue */
  --sky-strong: #2f6db3;   /* same hue, dark enough for text on white */
  --sky-tint: #eef5fc;
  --sky-line: #d6e6f7;
  --navy: #14385e;         /* from the logo circle */
  --amber: #e8a33d;        /* from the logo figures */
  --amber-tint: #fff6e6;
  --ink: #1f2328;
  --text: #343434;
  --muted: #5b6b80;
  --line: #e4e9ef;
  --bg: #ffffff;
  --paper: #f8fafc;
  --green: #2e8a5e;
  --green-tint: #e9f6ef;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 56, 94, .06), 0 6px 20px rgba(20, 56, 94, .06);
  --font: "Onest", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--sky-strong); text-underline-offset: 3px; }
button { font: inherit; color: inherit; cursor: pointer; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 6px; }

.wrap { width: min(1200px, 100% - 48px); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 12px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 76px; }
.brand img { height: 46px; width: auto; }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.site-nav ul a {
  display: block; padding: 10px 12px; border-radius: 8px;
  color: #050505; font-size: 15px; font-weight: 500; text-decoration: none;
}
.site-nav ul a:hover { background: var(--sky-tint); color: var(--navy); }
.site-nav ul a.is-current { color: var(--navy); box-shadow: inset 0 -2px 0 var(--sky); border-radius: 8px 8px 0 0; }
.btn-donate {
  padding: 10px 20px; border-radius: 999px;
  background: var(--amber); color: #2a1a03; font-weight: 600; font-size: 15px; text-decoration: none;
  transition: background .15s;
}
.btn-donate:hover { background: #dd9426; }
.menu-toggle { display: none; }

.subnav { background: var(--paper); border-bottom: 1px solid var(--line); }
.subnav-inner { display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; min-height: 48px; }
.subnav-inner::-webkit-scrollbar { display: none; }
.subnav-label { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-right: 10px; white-space: nowrap; }
.subnav a { white-space: nowrap; padding: 7px 12px; border-radius: 999px; color: var(--text); font-size: 14px; text-decoration: none; }
.subnav a:hover { background: #fff; color: var(--navy); }
.subnav a.is-current { background: #fff; color: var(--navy); font-weight: 600; box-shadow: 0 0 0 1px var(--sky-line); }

/* ---------- Hero ---------- */
.hero { padding: 44px 0 26px; }
.hero-inner { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: end; }
.eyebrow { margin: 0 0 10px; color: var(--sky-strong); font-weight: 600; font-size: 14px; letter-spacing: .02em; }
h1 {
  margin: 0; color: var(--ink);
  font-family: var(--serif); font-weight: 500; font-size: clamp(34px, 4.6vw, 52px); line-height: 1.1; letter-spacing: -.01em;
}
.lede { margin: 16px 0 0; max-width: 60ch; font-size: 18px; color: var(--muted); }

.progress-card {
  display: flex; align-items: center; gap: 16px;
  width: 330px; padding: 18px 20px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.ring { position: relative; width: 60px; height: 60px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { stroke-width: 4; }
.ring-bg { stroke: var(--sky-tint); }
.ring-fg { stroke: var(--sky); stroke-dasharray: 119.4; stroke-dashoffset: calc(119.4 * (1 - var(--p))); transition: stroke-dashoffset .5s ease; }
.ring-num { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-size: 18px; color: var(--navy); }
.progress-title { margin: 0; font-weight: 600; color: var(--ink); }
.progress-sub { margin: 2px 0 0; font-size: 13px; line-height: 1.45; color: var(--muted); }

/* ---------- Stepper ---------- */
.steps-section { padding: 8px 0 0; }
.stepper {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden;
}
.step + .step { border-left: 1px solid var(--line); }
.step button {
  width: 100%; height: 100%; min-height: 76px;
  display: flex; align-items: center; gap: 14px; padding: 14px 18px;
  background: none; border: 0; text-align: left;
  transition: background .15s;
}
.step button:hover { background: var(--paper); }
.step-num {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 18px; font-weight: 600;
  color: var(--muted); background: var(--paper); border: 1px solid var(--line);
}
.step-num svg { width: 18px; height: 18px; stroke-width: 2.4; }
.step-text { display: grid; line-height: 1.3; }
.step-title { font-weight: 600; color: var(--ink); }
.step-meta { font-size: 13px; color: var(--muted); }
.step.is-active button { background: var(--sky-tint); box-shadow: inset 0 -3px 0 var(--sky); }
.step.is-active .step-num { background: var(--navy); color: #fff; border-color: var(--navy); }
.step.is-complete .step-num { background: var(--green); color: #fff; border-color: var(--green); }
.step.is-complete .step-meta { color: var(--green); }

/* ---------- Workspace ---------- */
.workspace { padding: 28px 0 64px; }
.workspace-inner { display: grid; grid-template-columns: minmax(330px, 410px) 1fr; gap: 28px; align-items: start; }

.list-head h2 { margin: 2px 0 6px; font-family: var(--serif); font-weight: 500; font-size: 30px; color: var(--ink); line-height: 1.2; }
.list-kicker { margin: 0; font-size: 13px; font-weight: 600; color: var(--sky-strong); text-transform: uppercase; letter-spacing: .06em; }
.list-intro { margin: 0 0 18px; color: var(--muted); }

.items { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.item {
  position: relative; display: flex;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.item:hover { border-color: var(--sky-line); box-shadow: var(--shadow); }
.item.is-open { border-color: var(--sky); box-shadow: 0 0 0 3px var(--sky-tint), var(--shadow); }
.item.is-done { background: #fcfefd; }
.item-main {
  flex: 1; display: flex; gap: 14px; align-items: flex-start;
  padding: 16px 8px 16px 16px; background: none; border: 0; text-align: left; border-radius: var(--radius);
}
.item-icon {
  flex: none; width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center; background: var(--sky-tint); color: var(--sky-strong);
}
.item-icon svg { width: 24px; height: 24px; }
.item[data-kind="form"] .item-icon { background: var(--amber-tint); color: #a46410; }
.item[data-kind="doc"] .item-icon { background: #f0eefb; color: #5546a8; }
.item[data-kind="doc"] .item-icon svg { fill: none; }
.item-body { display: grid; gap: 3px; min-width: 0; }
.item-meta { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.item-title { font-weight: 600; color: var(--ink); line-height: 1.35; }
.item-desc { font-size: 14px; line-height: 1.5; color: var(--muted); }
.item-cta { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 14px; font-weight: 600; color: var(--sky-strong); }
.item-cta svg { width: 16px; height: 16px; transition: transform .15s; }
.item-main:hover .item-cta svg { transform: translateX(3px); }
.item.is-done .item-title { color: var(--muted); }

.check { flex: none; display: grid; place-items: center; width: 56px; cursor: pointer; border-left: 1px dashed var(--line); }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check-box {
  width: 28px; height: 28px; border-radius: 8px; border: 2px solid #c7d2de; background: #fff;
  display: grid; place-items: center; color: #fff; transition: all .15s;
}
.check-box svg { width: 16px; height: 16px; stroke-width: 2.6; opacity: 0; }
.check:hover .check-box { border-color: var(--green); }
.check input:checked + .check-box { background: var(--green); border-color: var(--green); }
.check input:checked + .check-box svg { opacity: 1; }
.check input:focus-visible + .check-box { outline: 3px solid var(--amber); outline-offset: 2px; }

.footnote {
  margin: 16px 0 0; padding: 12px 14px; border-radius: 10px;
  background: var(--amber-tint); color: #5c3b07; font-size: 14px;
}
.footnote a { color: #8a520a; font-weight: 600; }

.list-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 22px; }
.all-set { font-weight: 600; color: var(--green); }

.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: 10px; border: 1px solid transparent; font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: #0e2b49; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--sky); color: var(--navy); }
.btn-done { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-done:hover { border-color: var(--green); color: var(--green); }
.btn-done[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }

/* ---------- Viewer ---------- */
.viewer {
  position: sticky; top: 92px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden;
}
.viewer-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--line);
}
.viewer-title-wrap { min-width: 0; flex: 1 1 240px; }
.viewer-head h3 { margin: 2px 0 0; font-size: 17px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.type-tag { font-size: 12px; font-weight: 600; color: var(--sky-strong); }
.type-tag[data-kind="form"] { color: #a46410; }
.type-tag[data-kind="doc"] { color: #5546a8; }
.viewer-actions { display: flex; gap: 8px; }
.viewer-note { margin: 0; padding: 10px 20px; background: var(--amber-tint); color: #5c3b07; font-size: 14px; border-bottom: 1px solid #f6e2bd; }
.viewer-frame { position: relative; height: clamp(520px, calc(100vh - 230px), 860px); background: var(--paper); }
.viewer-frame iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.viewer-loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 12px;
  color: var(--muted); font-size: 15px; background: var(--paper); z-index: 1;
}
.viewer-loading[hidden] { display: none; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--sky-line); border-top-color: var(--sky); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Help ---------- */
.help { background: var(--sky-tint); padding: 56px 0; }
.help-inner { display: grid; grid-template-columns: 1fr 1.1fr; gap: 40px; align-items: center; }
.help h2 { margin: 0 0 8px; font-family: var(--serif); font-weight: 500; font-size: 32px; color: var(--ink); line-height: 1.2; }
.help-intro p { margin: 0; color: var(--muted); max-width: 46ch; font-size: 17px; }
.contact-card {
  display: flex; gap: 18px; padding: 24px;
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
}
.avatar {
  flex: none; width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center; background: var(--navy); color: #fff; font-weight: 600; letter-spacing: .04em;
}
.contact-body { min-width: 0; flex: 1; }
.contact-name { margin: 0; font-weight: 700; font-size: 18px; color: var(--ink); }
.contact-role { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.contact-list li { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); align-items: baseline; }
.c-label { font-size: 13px; color: var(--muted); }
.contact-list a { font-weight: 600; overflow-wrap: anywhere; }

/* ---------- Footer ---------- */
.site-footer { background: var(--sky); color: #fff; padding: 56px 0 28px; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-top { display: grid; grid-template-columns: auto 1fr; gap: 32px; align-items: center; padding-bottom: 32px; border-bottom: 1px solid rgba(255,255,255,.3); }
.footer-logo { height: 52px; width: auto; background: #fff; padding: 8px 14px; border-radius: 12px; }
.tax { margin: 0; font-size: 14px; font-style: italic; opacity: .95; max-width: 70ch; }
.footer-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; padding: 32px 0; }
.footer-cols h4 { margin: 0 0 12px; font-size: 18px; font-weight: 500; }
.footer-cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 15px; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.3); font-size: 13px; }
.footer-bottom p { margin: 0; }
.concept-mark { opacity: .8; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .site-nav ul a { padding: 10px 8px; font-size: 14px; }
  .site-nav { gap: 14px; }
}
@media (max-width: 960px) {
  .menu-toggle {
    display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px;
    background: #fff; border: 1px solid var(--line); border-radius: 10px; font-weight: 600;
  }
  .bars, .bars::before, .bars::after { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; position: relative; content: ""; }
  .bars::before { position: absolute; top: -6px; }
  .bars::after { position: absolute; top: 6px; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 76px;
    flex-direction: column; align-items: stretch; gap: 12px; padding: 12px 24px 20px;
    background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
  }
  .nav-open .site-nav { display: flex; }
  .site-nav ul { flex-direction: column; }
  .site-nav ul a { padding: 12px; font-size: 16px; }
  .btn-donate { text-align: center; }

  .hero { padding-top: 36px; }
  .hero-inner { grid-template-columns: 1fr; gap: 24px; }
  .progress-card { width: 100%; }
  .stepper { grid-template-columns: repeat(2, 1fr); }
  .step:nth-child(3) { border-left: 0; }
  .step:nth-child(n+3) { border-top: 1px solid var(--line); }
  .workspace-inner { grid-template-columns: 1fr; }
  .viewer { position: static; scroll-margin-top: 88px; }
  .viewer-frame { height: 78vh; min-height: 480px; }
  .help-inner { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .wrap { width: calc(100% - 32px); }
  .header-inner { height: 68px; }
  .brand img { height: 38px; }
  .site-nav { top: 68px; padding-inline: 16px; }
  .menu-label { display: none; }
  .lede { font-size: 16px; }
  .step button { padding: 12px; gap: 10px; min-height: 68px; }
  .step-num { width: 30px; height: 30px; font-size: 16px; }
  .step-title { font-size: 14px; }
  .step-meta { font-size: 12px; }
  .viewer-head { padding: 12px 14px; }
  .viewer-actions { width: 100%; }
  .viewer-actions .btn { flex: 1; justify-content: center; padding: 0 10px; font-size: 14px; }
  .contact-card { flex-direction: column; padding: 20px; }
  .contact-list li { grid-template-columns: 1fr; gap: 0; }
  .footer-top { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr 1fr; gap: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}
