/* The blocks of the four financing routes: /financing/cfa/, /financing/banks/,
 * /financing/cooperative/, /financing/investors/. Chrome (header, pill, plate,
 * card, kicker, placeholder, footer) comes from site/*.css; this file adds only
 * the flat stage, the page head, the segmented pill and the bands under it.
 * Every colour and length resolves through design/ or site/financing.tokens.css.
 *
 * Ported from mocks/pages/b/pages-b.css (branch fable-b, 8cb478d), his picked
 * v1 window, minus the router and doors of the unpicked v2. Added beside
 * base.css and act2-*.css, never carved into them.
 */

/* A standalone route has no hero: the fixed header sits on white from the
   first pixel, so the sheet is flat and clears the header itself. Ported from
   mocks/main2/fable/main2.css, the one part of that kit site/*.css does not
   already carry. */
.stage-flat {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-top: calc(var(--resurs-header-height) + var(--resurs-gap-section));
  padding-bottom: 0;
  border-radius: 0;
  box-shadow: none;
}
.stage-flat > .page { width: min(100% - 2 * var(--resurs-gutter), var(--resurs-page-width)); }
.stage-flat > .site-footer { margin-top: auto; }

[hidden] { display: none !important; }
ol { margin: 0; padding: 0; list-style: none; }
.stage-flat > .page { padding-bottom: var(--resurs-sheet-pad-bottom); }
.footer-more { margin-top: 14px; }

/* --- page head ----------------------------------------------------------- */
.crumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--resurs-size-small);
  color: var(--resurs-ink-muted);
}
.crumb:hover { color: var(--resurs-ink); }
.crumb .icon { transform: rotate(180deg); }
.page-head { margin-top: 18px; display: grid; gap: 14px; max-width: 64ch; }
.page-title {
  font-size: var(--resurs-size-h1);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.page-lead { font-size: var(--resurs-size-lead); line-height: 1.5; color: var(--resurs-ink-muted); }

/* --- shared block parts --------------------------------------------------- */
.block { margin-top: var(--resurs-gap-block); }
.block-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.block-title { font-size: var(--resurs-size-h2); font-weight: 500; line-height: 1.15; letter-spacing: -0.015em; }
.block-note { font-size: var(--resurs-size-small); color: var(--resurs-ink-muted); max-width: 52ch; line-height: 1.45; }
.block-body { margin-top: 26px; }
.sub-title { font-size: var(--resurs-size-h3); font-weight: 500; line-height: 1.25; }
.prose { display: grid; gap: 14px; font-size: var(--resurs-size-nav); line-height: 1.55; max-width: 60ch; }
.prose p + p { color: var(--resurs-ink-soft); }
.aside { padding: 26px 26px 24px; border-radius: var(--resurs-radius-panel); background: var(--resurs-tint); }
.aside .kicker { color: var(--resurs-ink-muted); }
.aside .sub-title { margin-top: 6px; }
.split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 40px; align-items: start; }

/* A list of plate + name + caption, one shape everywhere on the lane. */
.features { margin-top: 18px; display: grid; gap: 6px; }
.feature {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--resurs-radius-tile);
  background: var(--resurs-ground);
}
.feature .plate { width: var(--resurs-row-plate); height: var(--resurs-row-plate); }
.feature-body { display: grid; gap: 3px; min-width: 0; }
.feature-name { font-size: var(--resurs-size-body); font-weight: 500; line-height: 1.3; }
.feature-caption { font-size: var(--resurs-size-small); line-height: 1.4; color: var(--resurs-ink-soft); }
.features-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.features-cols .feature { background: var(--resurs-surface); padding: 18px; }

/* A numbered row of steps: the pipeline. */
.steps { margin-top: 14px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 12px; counter-reset: step; }
.steps li {
  counter-increment: step;
  padding: 18px 18px 16px;
  border-radius: var(--resurs-radius-tile);
  background: var(--resurs-surface);
  font-size: var(--resurs-size-body);
  font-weight: 500;
  line-height: 1.3;
}
.steps li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  margin-bottom: 12px;
  font-size: var(--resurs-size-small);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  color: var(--resurs-accent);
}
.plain-list { margin-top: 14px; display: grid; gap: 8px; font-size: var(--resurs-size-body); }
.plain-list li { display: flex; gap: 12px; align-items: baseline; }
.plain-list li::before { content: ''; flex: none; width: 5px; height: 5px; border-radius: 50%; background: var(--resurs-accent); transform: translateY(-3px); }

/* --- VTB rows: pale bands with an icon object at the left ------------------ */
.rows-head, .row {
  display: grid;
  grid-template-columns: var(--resurs-row-plate) minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 0.8fr);
  gap: 18px;
  align-items: center;
}
.rows-head {
  padding: 0 18px 10px;
  font-size: var(--resurs-size-small);
  color: var(--resurs-ink-muted);
}
.rows-head span:first-child { grid-column: 2; }
.rows { display: grid; gap: 8px; }
.row {
  padding: 14px 18px;
  border-radius: var(--resurs-radius-tile);
  background: var(--resurs-surface);
  transition: background var(--resurs-quick) var(--resurs-ease);
}
.row:hover { background: var(--resurs-tint); }
.row:hover .plate { transform: translateY(-1px); --resurs-plate-cast: var(--resurs-plate-cast-lifted); }
.row .plate { width: var(--resurs-row-plate); height: var(--resurs-row-plate); }
.row-main { display: grid; gap: 2px; min-width: 0; }
.row-name { font-size: var(--resurs-size-body); font-weight: 500; }
.row-sub, .row-cell { font-size: var(--resurs-size-small); color: var(--resurs-ink-soft); }
.row-status {
  justify-self: start;
  padding: 4px 12px;
  border-radius: var(--resurs-radius-pill);
  background: var(--resurs-ground);
  font-size: var(--resurs-size-small);
  white-space: nowrap;
}
.empty {
  padding: 34px 24px;
  border: 1px dashed var(--resurs-placeholder-edge);
  border-radius: var(--resurs-radius-panel);
  text-align: center;
  font-size: var(--resurs-size-body);
  color: var(--resurs-placeholder-ink);
}
.band {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 24px 20px 20px;
  border-radius: var(--resurs-radius-panel);
  background: var(--resurs-tint);
}
.band .plate { width: 48px; height: 48px; }
.band p { flex: 1; min-width: 0; font-size: var(--resurs-size-body); line-height: 1.45; }
.band .card-link { margin-top: 0; padding-top: 0; white-space: nowrap; }

/* --- the calendar placeholder ------------------------------------------- */
.cal { display: grid; gap: 8px; padding: 22px; border-radius: var(--resurs-radius-panel); background: var(--resurs-surface); }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cal-week span { font-size: var(--resurs-size-small); color: var(--resurs-ink-muted); text-align: center; }
.cal-cell { aspect-ratio: 2.4; border: 1px dashed var(--resurs-placeholder-edge); border-radius: var(--resurs-radius-tile); }
.cal-caption { justify-self: center; margin-top: 10px; white-space: normal; text-align: center; }

/* --- fields --------------------------------------------------------------- */
.field { display: grid; gap: 8px; align-content: start; }
.field-wide { grid-column: 1 / -1; }
.field-label { font-size: var(--resurs-size-small); font-weight: 500; }
.field-hint { font-size: var(--resurs-size-small); color: var(--resurs-ink-muted); }
.field-error { font-size: var(--resurs-size-small); color: var(--resurs-danger); min-height: 0; }
.field-error:empty { display: none; }
.field input:not([type='radio']):not([type='checkbox']),
.field select,
.field textarea,
.calc-field input:not([type='radio']),
.calc-field select {
  width: 100%;
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid var(--resurs-field-edge);
  border-radius: var(--resurs-radius-field);
  background: var(--resurs-ground);
  color: var(--resurs-ink);
  font: inherit;
  font-size: var(--resurs-size-field);
  transition: border-color var(--resurs-quick) var(--resurs-ease);
}
.field textarea { resize: vertical; min-height: 96px; }
.field input:hover, .field select:hover, .field textarea:hover, .calc-field input:hover, .calc-field select:hover { border-color: var(--resurs-field-edge-hover); }
.field [aria-invalid='true'], .calc-field [aria-invalid='true'] { border-color: var(--resurs-danger); }
input[type='radio'], input[type='checkbox'] { width: 18px; height: 18px; margin: 0; accent-color: var(--resurs-accent); flex: none; }

/* A choice: one real radio or checkbox inside a bordered label. */
.choices { display: grid; gap: 8px; }
.choices-row { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--resurs-field-edge);
  border-radius: var(--resurs-radius-field);
  background: var(--resurs-ground);
  font-size: var(--resurs-size-body);
  line-height: 1.35;
  cursor: pointer;
  transition: border-color var(--resurs-quick) var(--resurs-ease), background var(--resurs-quick) var(--resurs-ease);
}
.choice:hover { border-color: var(--resurs-field-edge-hover); }
.choice:has(:checked) { border-color: var(--resurs-accent); background: var(--resurs-tint); }
.choice:has(:focus-visible) { outline: 2px solid var(--resurs-accent); outline-offset: 2px; }
.choice input:focus-visible { outline: none; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 8px; }

/* --- the single intake form ---------------------------------------------- */
.lead-wrap { padding: 36px 40px 34px; border-radius: var(--resurs-radius-panel); background: var(--resurs-surface); }
.lead-wrap .block-head { margin-bottom: 26px; }
.lead-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.consent { margin-top: 18px; }
.consent .choice { background: transparent; border-color: transparent; padding: 0; font-size: var(--resurs-size-small); }
.consent .choice:has(:checked) { background: transparent; }
.lead-summary {
  margin-top: 18px;
  padding: 12px 16px;
  border-radius: var(--resurs-radius-field);
  background: var(--resurs-danger-soft);
  color: var(--resurs-danger);
  font-size: var(--resurs-size-small);
}
.lead-actions { margin-top: 24px; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.lead-note { font-size: var(--resurs-size-small); color: var(--resurs-ink-muted); }
.lead[data-state='submitting'] .pill-accent { opacity: 0.7; cursor: progress; }
.pill-accent { border: 0; font: inherit; font-size: var(--resurs-size-nav); cursor: pointer; }
.lead-done { display: grid; gap: 14px; justify-items: start; padding: 26px 28px; border-radius: var(--resurs-radius-panel); }
.lead-done[data-kind='success'] { background: var(--resurs-success-soft); }
.lead-done[data-kind='error'] { background: var(--resurs-danger-soft); }
.lead-done-head { display: flex; align-items: center; gap: 14px; }
.lead-done .plate { width: 44px; height: 44px; }
.lead-done[data-kind='success'] .plate { color: var(--resurs-success); }
.lead-done[data-kind='error'] .plate { color: var(--resurs-danger); }
.lead-done-title { font-size: var(--resurs-size-h3); font-weight: 500; }
.lead-done-body { font-size: var(--resurs-size-body); line-height: 1.5; max-width: 60ch; color: var(--resurs-ink-soft); }
.quiet-link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }

/* --- the calculator ------------------------------------------------------- */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.calc-form { display: grid; gap: 20px; align-content: start; padding: 30px 30px 28px; border-radius: var(--resurs-radius-panel); background: var(--resurs-surface); }
.calc-field { display: grid; gap: 8px; }
.calc-result { display: grid; gap: 14px; align-content: start; padding: 30px 30px 28px; border-radius: var(--resurs-radius-panel); background: var(--resurs-tint); }
.calc-message { font-size: var(--resurs-size-nav); line-height: 1.5; color: var(--resurs-ink-muted); }
.calc-result[data-state='range'] .calc-message { color: var(--resurs-danger); }
.calc-result:not([data-state='result']) .calc-result-title,
.calc-result:not([data-state='result']) .calc-lines,
.calc-result:not([data-state='result']) .calc-next,
.calc-result:not([data-state='result']) .card-link { display: none; }
.calc-result-title { font-size: var(--resurs-size-h3); font-weight: 500; }
.calc-lines { display: grid; gap: 10px; }
.calc-lines li { display: flex; gap: 10px; align-items: flex-start; font-size: var(--resurs-size-body); line-height: 1.45; }
.calc-lines .icon { flex: none; margin-top: 3px; color: var(--resurs-accent); }
.calc-next { font-size: var(--resurs-size-small); color: var(--resurs-ink-muted); }
.calc-result .card-link { margin-top: 0; padding-top: 0; }

/* --- mechanic v1: the segmented pill ---------------------------------------- */
.segments-wrap { margin-top: 34px; overflow-x: auto; scrollbar-width: none; }
.segments-wrap::-webkit-scrollbar { display: none; }
.segments {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border-radius: var(--resurs-radius-pill);
  background: var(--resurs-surface);
  white-space: nowrap;
}
.segment {
  padding: 10px 22px;
  border: 0;
  border-radius: var(--resurs-radius-pill);
  background: transparent;
  color: var(--resurs-ink-muted);
  font: inherit;
  font-size: var(--resurs-size-body);
  cursor: pointer;
  transition: color var(--resurs-quick) var(--resurs-ease), background var(--resurs-quick) var(--resurs-ease);
}
.segment:hover { color: var(--resurs-ink); }
.segment[aria-selected='true'] { background: var(--resurs-ground); color: var(--resurs-ink); font-weight: 500; box-shadow: var(--resurs-segment-lift); }
.panel { margin-top: 34px; }
.panel > .block:first-child { margin-top: 0; }

/* --- motion ---------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .row, .row .plate, .choice, .segment, .field input, .field select, .field textarea { transition: none; }
  .row:hover .plate { transform: none; }
}

/* --- widths ---------------------------------------------------------------- */
@media (max-width: 1080px) {
  .split { grid-template-columns: 1fr; gap: 28px; }
  .calc { grid-template-columns: 1fr; }
  .lead-wrap { padding: 28px 26px; }
  .steps { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .lead-grid { grid-template-columns: 1fr; }
  .features-cols { grid-template-columns: 1fr; }
  .rows-head { display: none; }
  .row { grid-template-columns: var(--resurs-row-plate) minmax(0, 1fr); grid-template-rows: auto auto; row-gap: 8px; }
  .row-cell { grid-column: 2; }
  .row-status { grid-column: 2; }
}
@media (max-width: 560px) {
  .page-head { margin-top: 12px; }
  .crumb { min-height: 44px; }
  .lead-wrap { padding: 22px 18px; }
  .lead-actions .pill-accent { width: 100%; justify-content: space-between; }
  .calc-form, .calc-result { padding: 22px 18px; }
  .choices-row { grid-auto-flow: row; }
  .steps { grid-template-columns: 1fr; }
  .band { flex-direction: column; align-items: flex-start; padding: 18px; }
  .cal { padding: 14px; }
  .cal-week, .cal-grid { gap: 4px; }
  .segment { padding: 9px 16px; font-size: var(--resurs-size-small); min-height: 44px; }
}
