/* Oakstone Funding — brand stylesheet.
 *
 * Written from the brand prototype's own design language. It is deliberately
 * the OPPOSITE of First Valley's sheet on every axis, because the two brands
 * share a server and must not share a look:
 *
 *   - GENEROUSLY ROUNDED. Sections are large white cards at 24px radius sitting
 *     on a warm cream page; buttons are 12px, pills are fully round. First
 *     Valley is square everywhere. Do not converge them.
 *   - The page is CREAM (#faf8f5) and content floats on white cards with a
 *     1px stone border and a whisper of shadow. Depth comes from cards, not
 *     from hairlines.
 *   - Headings are Newsreader SERIF at weight 700 — solid and bookish, not the
 *     light-weight display type First Valley uses. No italic-serif device here.
 *   - Labels are sentence case in rounded pills; no micro-caps tracking.
 *   - Pine (#1c3d2b) is the solid action colour and is used confidently, unlike
 *     First Valley's hairline emerald accent.
 */
:root {
  --pine: #1c3d2b;
  --pine-d: #163223;
  --pine-dd: #0f2922;
  --moss: #2d5a3f;
  --moss-l: #2a4736;
  --cream: #faf8f5;
  --cream-2: #f4f0e8;
  --cream-3: #f3efea;
  --white: #ffffff;
  --ink: #1c1917;
  --ink-2: #292524;
  --ink-3: #44403c;
  --muted: #78716c;
  --faint: #a8a29e;
  --line: #e7e5e4;
  --line-2: #dfd8cc;
  --danger: #b91c1c;
  --sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --serif: Newsreader, Georgia, "Times New Roman", serif;
  --card: 24px;
  --btn: 12px;
  --shadow: 0 1px 2px rgba(28, 25, 23, .04);
  --gut: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
/* LOAD-BEARING. The engine hides the Back button, the file list, the submit
   progress bar and the held-value boxes with el.hidden, and an author
   `display:` rule silently beats the attribute. Without this the Back button
   shows on question one and the held boxes never hide. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; height: auto; }
a { color: var(--moss); }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; margin: 0 0 .5em; letter-spacing: -.01em; }

.wrap { width: min(1160px, 100% - (var(--gut) * 2)); margin-inline: auto; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--pine); color: #fff; padding: 10px 16px; z-index: 100; }
.skip-link:focus { left: 0; }

/* ----- Header ----- */
.topbar { background: var(--pine-dd); color: #cbd5cd; font-size: 12.5px; }
.topbar .wrap { display: flex; gap: 18px; padding: 8px 0; }
.topbar a { color: #e7e5e4; text-decoration: none; }
.site-header { background: var(--cream); }
.header-inner { display: flex; align-items: center; gap: 26px; padding: 18px 0; }
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo .word { display: block; font-family: var(--serif); font-size: 21px; font-weight: 700; color: var(--pine); letter-spacing: -.01em; }
.logo .logo-sub { font-weight: 400; color: var(--moss); }
.logo .tag { display: block; font-size: 12px; color: var(--muted); }
/* Same as First Valley: .navbar is a sibling of .wrap and must re-establish
   the content width, or the nav runs to the viewport edge. */
.navbar { border-top: 1px solid var(--line); }
.navbar .nav { width: min(1160px, 100% - (var(--gut) * 2)); margin-inline: auto; }
.nav { display: flex; gap: 24px; align-items: center; padding: 6px 0; }
.nav a { color: var(--ink-3); text-decoration: none; font-size: 14.5px; font-weight: 600; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--pine); }
.nav-cta { background: var(--pine); color: #fff !important; padding: 10px 20px; border-radius: var(--btn); font-weight: 700; }
.header-contact { font-size: 13.5px; color: var(--muted); margin-left: auto; text-align: right; }

/* ----- Buttons: rounded, solid pine ----- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 0; cursor: pointer; font: inherit; font-weight: 700; padding: 14px 26px; border-radius: var(--btn); text-decoration: none; }
.btn-moss { background: var(--pine); color: #fff; }
.btn-moss:hover { background: var(--pine-d); }
.btn-ghost { background: var(--cream-3); color: var(--ink-2); border: 1px solid var(--line-2); font-weight: 600; }
.btn-ghost:hover { background: var(--cream-2); }
.btn-arrow::after { content: "\2192"; }
.btn:disabled { opacity: .55; cursor: default; }

/* ----- Card: the structural unit of every page ----- */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--card);
  padding: clamp(24px, 4vw, 64px);
  box-shadow: var(--shadow);
}
.card-cream { background: var(--cream-2); border-color: var(--line-2); }
.stack { display: grid; gap: clamp(28px, 4vw, 56px); padding: 28px 0 56px; }

.pill { display: inline-flex; align-items: center; gap: 9px; background: var(--cream-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 7px 15px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--moss-l); }
.pill .sep { color: var(--line-2); }
.pill .soft { font-weight: 400; color: var(--muted); }

/* ----- Home: hero card ----- */
.hero h1 { font-size: clamp(30px, 4.6vw, 50px); line-height: 1.12; max-width: 22ch; margin: 20px 0 0; }
.hero p.lede { font-size: clamp(16px, 1.4vw, 18.5px); color: var(--ink-3); max-width: 60ch; margin: 18px 0 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.matrix { margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; max-width: 760px; }
.matrix h3 { font-family: var(--sans); font-size: 13px; font-weight: 700; margin: 0 0 4px; color: var(--ink); }
.matrix p { font-size: 13px; color: var(--muted); margin: 0; }
.matrix .big { font-family: var(--serif); font-size: 24px; font-weight: 700; color: var(--pine); display: block; line-height: 1.2; }

/* ----- Section heads inside cards ----- */
.sec-label { font-size: 12.5px; font-weight: 700; color: var(--moss); margin: 0; }
.card h2 { font-size: clamp(22px, 2.8vw, 32px); margin: 4px 0 0; }
.card > p.intro { color: var(--muted); margin: 14px 0 0; max-width: 62ch; }

/* ----- Products: rounded sub-cards inside the section card ----- */
.products { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 28px; }
.product { background: var(--cream); border: 1px solid var(--line); border-radius: 18px; padding: 24px; }
.product .badge { display: inline-block; background: var(--white); border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 11px; font-size: 11.5px; font-weight: 700; color: var(--moss); }
.product h3 { font-size: 19px; margin: 14px 0 8px; }
.product .tagline { font-size: 14px; color: var(--ink-3); margin: 0 0 16px; }
.product ul { list-style: none; margin: 0 0 18px; padding: 0; }
.product li { font-size: 13.5px; color: var(--muted); padding-left: 22px; position: relative; margin-bottom: 8px; }
.product li::before { content: "\2713"; position: absolute; left: 0; color: var(--moss); font-weight: 700; }
.product .meta { border-top: 1px solid var(--line); padding-top: 14px; font-size: 12.5px; color: var(--muted); display: grid; gap: 4px; }
.product .meta b { color: var(--ink-2); font-weight: 700; }

/* ----- Process ----- */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 28px; }
.step { background: var(--cream); border: 1px solid var(--line); border-radius: 18px; padding: 24px; }
.step .n { width: 34px; height: 34px; border-radius: 50%; background: var(--pine); color: #fff; display: grid; place-items: center; font-family: var(--serif); font-weight: 700; }
.step h3 { font-size: 17px; margin: 14px 0 6px; }
.step p { font-size: 13.5px; color: var(--muted); margin: 0; }

/* ----- Documents checklist ----- */
.docs { list-style: none; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.docs li { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 15px 18px; font-size: 14px; display: flex; gap: 12px; align-items: center; }
.docs li::before { content: "\2713"; color: var(--moss); font-weight: 700; }

/* ----- Apply page ----- */
.canvas { background: transparent; }
.apply-main { padding: 26px 0 56px; }
.apply-top { margin-bottom: 22px; }
.apply-top h1 { font-size: clamp(27px, 3.6vw, 40px); }
.lede { color: var(--ink-3); max-width: 64ch; margin: 0 0 8px; }
.welcome { display: none; background: var(--white); border: 1px solid var(--line); border-radius: var(--card); padding: clamp(22px, 3vw, 36px); margin-bottom: 24px; box-shadow: var(--shadow); }
.welcome.is-active { display: block; }
.welcome-pill { display: inline-flex; align-items: center; background: var(--cream-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 5px 14px; font-size: 12.5px; font-weight: 700; color: var(--moss); margin-bottom: 12px; }
.welcome-title { font-size: 24px; margin: 0 0 6px; }
.welcome-sub { color: var(--muted); margin: 0; }

/* ----- The form ----- */
.okform { background: var(--white); border: 1px solid var(--line); border-radius: var(--card); box-shadow: var(--shadow); overflow: hidden; }
.okform-progress { display: flex; align-items: center; gap: 14px; padding: 16px 24px; border-bottom: 1px solid var(--line); background: var(--cream-2); }
.okform-bar { flex: 1; height: 8px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.okform-fill { display: block; height: 100%; background: var(--pine); border-radius: 999px; transition: width .28s ease; }
.okform-count { font-size: 13px; font-weight: 700; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.okform-step { display: none; padding: 30px 26px 8px; border: 0; margin: 0; }
.okform-step.is-active { display: block; }
.okform-tag { font-size: 12.5px; font-weight: 700; color: var(--moss); }
.okform-num { color: var(--faint); font-weight: 600; }
/* .okform-state is the SUBMITTING / SUCCESS panel, not a heading — it must be
   hidden until the engine activates it. Getting this wrong put "A confirmation
   is on its way to your email" on the page before anyone filled the form in. */
.okform-state { display: none; padding: 40px 2px; text-align: center; }
.okform-state.is-active { display: block; }
.okform-state h3 { font-family: var(--serif); font-size: clamp(21px, 2.6vw, 27px); font-weight: 700; margin: 0 0 10px; }
/* The question heading, which is what that rule used to be mistaken for. */
.okform-step h3 { font-family: var(--serif); font-size: clamp(21px, 2.6vw, 27px); font-weight: 700; margin: 8px 0 14px; }
.okform-help { color: var(--muted); font-size: 14.5px; margin: -8px 0 16px; }
.okform-err { color: var(--danger); font-size: 14px; min-height: 20px; margin-top: 10px; }
.okform-nav { display: flex; gap: 12px; align-items: center; padding: 10px 26px 28px; }
.okform-nav .btn-moss { margin-left: auto; }

/* ----- Fields ----- */
.field { margin-bottom: 18px; }
.lbl { display: block; font-size: 13.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 7px; }
.inp { width: 100%; font: inherit; color: var(--ink); background: var(--white); border: 1px solid var(--line-2); border-radius: var(--btn); padding: 13px 15px; }
.inp:focus { outline: 2px solid var(--moss); outline-offset: 1px; border-color: var(--moss); }
.inp[readonly], .inp.is-locked { background: var(--cream-2); color: var(--muted); }
.inp.is-held { border-color: var(--moss); background: #f2f7f2; }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.field-grid { display: grid; gap: 16px; }
.field-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.legal { font-size: 13px; color: var(--muted); }

/* ----- Options ----- */
.opts { display: grid; gap: 11px; }
.opt { display: flex; align-items: center; gap: 13px; padding: 15px 17px; cursor: pointer; border: 1px solid var(--line-2); border-radius: 16px; background: var(--white); }
.opt:hover { border-color: var(--moss); background: var(--cream); }
.opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.opt:has(input:checked) { border-color: var(--pine); background: var(--cream-2); box-shadow: inset 0 0 0 1px var(--pine); }
.opt-key { flex: 0 0 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--cream-2); color: var(--muted); font-size: 12px; font-weight: 700; }
.opt:has(input:checked) .opt-key { background: var(--pine); color: #fff; }
.opt-text { font-weight: 600; font-size: 15px; }
.opt-note { display: block; font-weight: 400; font-size: 13px; color: var(--muted); }

/* ----- Sliders ----- */
.slider-wrap { padding: 4px 0 2px; }
.slider-val { font-family: var(--serif); font-size: 32px; font-weight: 700; color: var(--pine); }
.slider { width: 100%; appearance: none; height: 8px; border-radius: 999px; margin: 16px 0 8px; background: linear-gradient(to right, var(--pine) 0 calc(var(--ok-slider-fill, .5) * 100%), var(--line-2) calc(var(--ok-slider-fill, .5) * 100%) 100%); }
.slider::-webkit-slider-thumb { appearance: none; width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 4px solid var(--pine); cursor: pointer; }
.slider::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 4px solid var(--pine); cursor: pointer; }
.slider-ends, .slider-cap { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }

/* ----- MCA rows ----- */
.mca-rows { display: grid; gap: 11px; }
.mca-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 11px; align-items: center; }

/* ----- Uploads ----- */
.drop { display: block; border: 2px dashed var(--line-2); border-radius: 18px; padding: 28px; text-align: center; cursor: pointer; background: var(--cream); }
.drop:hover, .drop.is-dragging { border-color: var(--moss); background: var(--cream-2); }
.drop.has-files { border-style: solid; }
.drop input[type="file"] { position: absolute; opacity: 0; width: 0; height: 0; }
.filelist { list-style: none; margin: 15px 0 0; padding: 0; display: grid; gap: 9px; }
.filelist li { border: 1px solid var(--line); border-radius: 14px; padding: 12px 15px; font-size: 14px; background: var(--white); }
/* The submit progress bar. Its child is an <i>, not a <span>. */
.upbar { height: 6px; background: var(--line-2); border-radius: 999px; overflow: hidden; margin: 12px auto; max-width: 320px; }
.upbar > i { display: block; height: 100%; width: 0; background: var(--pine); transition: width .2s ease; }

/* File rows are built by the engine: .file-item > .file-name .file-size .file-x
   plus an absolutely positioned .file-bar along the bottom edge. */
.file-item { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 13px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); margin-bottom: 9px; position: relative; overflow: hidden; }
.file-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { font-size: 12.5px; color: var(--muted); }
.file-x { background: none; border: 0; color: var(--faint); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 2px; }
.file-x:hover { color: var(--danger); }
.file-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--moss); transition: width .2s ease; }
.file-item.is-done .file-bar { width: 100% !important; }
.file-item.is-failed .file-bar { background: var(--danger); }

/* ----- Held ("on file") ----- */
.held-note { background: var(--cream-2); border: 1px solid var(--line-2); border-radius: 16px; padding: 14px 17px; font-size: 14px; color: var(--ink-3); }
.held-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--pine); color: #fff; border-radius: 999px; padding: 5px 14px; font-size: 12.5px; font-weight: 700; }
.keep-row { display: flex; align-items: center; gap: 10px; margin-top: 9px; font-size: 14px; }

/* ----- Signature ----- */
.sign-box { border: 1px solid var(--line-2); border-radius: 18px; padding: 14px; background: var(--white); position: relative; }
.sign-pad { width: 100%; height: 190px; touch-action: none; display: block; cursor: crosshair; }
.sign-rule { border-top: 1px solid var(--ink-3); margin: 0 14px; }
.sign-hint { position: absolute; left: 0; right: 0; top: 46%; text-align: center; color: var(--line-2); font-size: 15px; pointer-events: none; }
.sign-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 11px; }
.sign-clear { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; text-decoration: underline; }

/* ----- Banner / submitting / success ----- */
.banner { border-radius: 16px; padding: 15px 18px; margin: 0 26px 4px; font-size: 14.5px; display: none; }
.banner.is-active { display: block; background: #fef2f2; border: 1px solid #fecaca; color: #7f1d1d; }
.spinner { width: 36px; height: 36px; margin: 0 auto 16px; border-radius: 50%; border: 4px solid var(--line-2); border-top-color: var(--pine); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.success-mark { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 50%; background: var(--pine); color: #fff; display: grid; place-items: center; font-size: 26px; }

/* ----- Rail ----- */
.rail-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.rail-item { font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--cream-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 5px 13px; }
.rail-item.is-current { background: var(--pine); border-color: var(--pine); color: #fff; }
.rail-item.is-done { color: var(--moss); background: #eef3ea; border-color: #cfdcc9; }
.rail-fine { font-size: 13px; color: var(--muted); }

/* ----- Footer ----- */
.site-footer { background: var(--pine-dd); color: #b9c2bb; margin-top: 20px; padding: 46px 0 28px; font-size: 14px; border-radius: var(--card) var(--card) 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 30px; }
.site-footer a { color: #e7e5e4; text-decoration: none; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-fine { border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 28px; padding-top: 18px; font-size: 12.5px; color: #8d968f; line-height: 1.7; }

@media (max-width: 960px) {
  .products, .steps, .matrix { grid-template-columns: 1fr; }
  .docs { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  /* Wraps rather than hides — see the note in First Valley's sheet. */
  .header-contact { display: none; }
  .nav { flex-wrap: wrap; gap: 12px 16px; padding-bottom: 10px; }
  .nav-cta { padding: 9px 16px; }
}
@media (max-width: 640px) {
  .field-grid-2, .field-grid-3 { grid-template-columns: 1fr; }
  .mca-row { grid-template-columns: 1fr; }
}
