/* form.css: landing v2 lead form in two steps (lf-) and the thanks page (ty-). Tokens come from site.css.
   Kalka look: sheets on paper with penumbra shadows (site.css elevation), near-square corners, blue for choice, focus
   and the primary buttons, red only for errors.
   Every control is at least 44 px high. */

/* ---- form section ---- */
.lf-sec { padding: var(--sp-sec) 0 calc(var(--sp-sec) + 16px); }
.lf-grid { display: grid; gap: 24px; align-items: start; }
@media (min-width: 1024px) {
  .lf-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; }
  .lf-copy { position: sticky; top: calc(var(--header) + 32px); }
}
.lf-title { font: 800 var(--fs-h2)/1.1 var(--sans); letter-spacing: -.018em; text-wrap: balance; }
@media (min-width: 1024px) { .lf-title { line-height: 1.08; } }
.lf-art { margin-top: 32px; }

/* the form sheet: the primary sheet of the page (L2 with the drawing's blue corner marks) */
.lf-box { position: relative; background: var(--sheet) var(--grain); border: 1px solid var(--edge-2); box-shadow: var(--hi), var(--sh-2); padding: 24px 20px; }
@media (min-width: 761px) { .lf-box { padding: 40px 44px; } }
.lf-box::before, .lf-box::after { content: ''; position: absolute; width: 18px; height: 18px; border: 0 solid var(--blue); pointer-events: none; }
.lf-box::before { top: -1px; left: -1px; border-top-width: 2px; border-left-width: 2px; }
.lf-box::after { right: -1px; bottom: -1px; border-right-width: 2px; border-bottom-width: 2px; }

.lf { position: relative; }
.lf-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.lf-step { position: relative; display: grid; gap: 24px; }
.lf-step[hidden] { display: none; }

.lf-stephead { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--edge-1); }
.lf-steplabel { font: 600 13px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--soft); }
.lf-steplabel:focus { outline: none; }
.lf-steplabel:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
.lf-bars { display: flex; gap: 6px; }
.lf-bars i { position: relative; overflow: hidden; width: 34px; height: 3px; background: var(--line); }
/* the progress fills from the left when a step turns on */
.lf-bars i.is-on::after { content: ''; position: absolute; inset: 0; background: var(--blue); transform-origin: left; transition: transform 300ms var(--ease-out); }
@starting-style { .lf-bars i.is-on::after { transform: scaleX(0); } }

/* step 1: chips are labels around real radios and checkboxes (keyboard, screen readers, form reset all native) */
.lf-q { position: relative; min-width: 0; margin: 0; padding: 0; border: 0; }
.lf-legend { float: left; width: 100%; margin-bottom: 12px; padding: 0; font: 700 1.0625rem/1.35 var(--sans); }
.lf-legend + * { clear: both; }
.lf-hint { font-weight: 500; color: var(--soft); }
.lf-q.is-missing::before { content: ''; position: absolute; left: -12px; top: 2px; bottom: 0; width: 3px; background: var(--red); }
@media (min-width: 761px) { .lf-q.is-missing::before { left: -20px; } }
.lf-q.is-missing .lf-chip span { border-color: rgba(229, 72, 77, .75); }

.lf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.lf-chip { position: relative; display: block; }
.lf-chip input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
/* choice chip: white on the sheet, a fine edge and a hairline under it; chosen = blue */
.lf-chip span { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 14px; border: 1px solid rgba(38, 41, 47, .28); border-radius: 2px; background: #fff; color: var(--ink);
  box-shadow: 0 1px 1px rgba(38, 41, 47, .06); font: 600 15px/1.25 var(--sans);
  transition: transform var(--t-release) var(--ease-out), background-color 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease; }
@media (hover: hover) and (pointer: fine) { .lf-chip:hover span { border-color: var(--ink); } }
.lf-chip:active span { transform: scale(.97); transition-duration: var(--t-press); }
.lf-chip input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 6px 14px -8px rgba(30, 79, 216, .6); }
.lf-chip input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 3px; }
@media (max-width: 760px) { .lf-chip span { padding: 10px 13px; } }
/* square box of the multiple choice */
.lf-chip i { position: relative; flex: none; width: 14px; height: 14px; border: 1.5px solid currentColor; }
.lf-chip input:checked + span i::after { content: ''; position: absolute; left: 3.5px; top: 0; width: 4px; height: 8px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* step 2: contact */
.lf-fields { display: grid; gap: 18px; }
@media (min-width: 761px) { .lf-fields { grid-template-columns: 1fr 1fr; gap: 20px; } }
.lf-field { display: grid; gap: 8px; align-content: start; }
.lf-label { font: 700 15px/1.3 var(--sans); }
.lf-label b { color: var(--blue); }
.lf-label em { font-style: normal; font-weight: 500; color: var(--soft); }
.lf-input { width: 100%; min-height: 52px; padding: 12px 14px; border: 1px solid rgba(38, 41, 47, .3); border-radius: 2px; background: #fff; color: var(--ink); font: 500 17px/1.3 var(--sans);
  box-shadow: inset 0 1px 2px rgba(38, 41, 47, .06); -webkit-appearance: none; appearance: none; transition: border-color .15s, box-shadow .15s; }
@media (hover: hover) and (pointer: fine) { .lf-input:hover { border-color: rgba(38, 41, 47, .55); } }
.lf-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(30, 79, 216, .18); }
.lf-input[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 3px rgba(229, 72, 77, .16); }
@media (forced-colors: active) { .lf-input:focus { outline: 2px solid CanvasText; } }
.lf-note { font-size: var(--fs-sm); line-height: 1.5; color: var(--soft); }

/* buttons: «Дальше» and the submit are the primary blue button. Until the four answers are in, «Дальше» stands as a
   secondary button (sheet, ink edge, 13:1): readable and still pressable, pressed it says what is missing */
.lf-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; }
.lf-step[data-step="1"] .lf-actions { justify-content: flex-end; }
.lf-btn { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 52px; padding: 14px 26px; border: 0; border-radius: 2px; background: var(--blue); color: #fff; font: 700 16px/1.2 var(--sans); cursor: pointer;
  box-shadow: var(--sh-btn); transition: transform var(--t-release) var(--ease-out), box-shadow var(--t-release) var(--ease-out), background-color 150ms ease, color 150ms ease; }
@media (hover: hover) and (pointer: fine) { .lf-btn:not([aria-disabled="true"]):hover { background: var(--blue-deep); transform: translateY(-1px); } .lf-btn:not([aria-disabled="true"]):hover .ico-arrow { transform: translateX(3px); } }
.lf-btn:active { transform: translateY(1px); box-shadow: var(--sh-btn-press); transition-duration: var(--t-press); }
.lf-btn:focus-visible, .lf-back:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.lf-btn[aria-disabled="true"] { background: var(--sheet); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .lf-btn[aria-disabled="true"]:hover { background: #fff; } }
.lf-btn[aria-disabled="true"]:active { box-shadow: inset 0 0 0 1.5px var(--ink), var(--sh-press); }
.lf-btn .ico-arrow { flex: none; width: 20px; height: 20px; transition: transform .2s var(--ease-out); }
.lf-btn[data-submit] > span { transition: opacity 150ms ease, filter 150ms ease; }
.lf.is-sending .lf-btn[data-submit] { background: var(--soft); color: #fff; box-shadow: none; cursor: progress; }
.lf-btn[data-submit].is-swap > span { opacity: 0; filter: blur(2px); }
.lf-back { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 10px 6px; border: 0; background: none; color: var(--ink-2); font: 600 15px/1.2 var(--sans); cursor: pointer; }
.lf-back .ico-arrow { width: 18px; height: 18px; }
@media (hover: hover) and (pointer: fine) { .lf-back:hover { color: var(--ink); } }
.lf-back:active { color: var(--blue); }
.lf-back:disabled { opacity: .5; cursor: default; }
@media (max-width: 760px) {
  .lf-btn { width: 100%; }
  .lf-step[data-step="2"] .lf-actions { flex-direction: column-reverse; align-items: stretch; }
  .lf-back { justify-content: center; }
}

/* messages: missing answers, empty fields, send failure (with the e-mail); red only here, for errors */
.lf-msg { font: 600 15px/1.45 var(--sans); }
/* empty: out of the layout but still a live region for screen readers */
.lf-msg:empty { position: absolute; width: 1px; height: 1px; overflow: hidden; }
.lf-msg:not(:empty) { padding: 12px 14px; border-left: 3px solid var(--red); background: rgba(229, 72, 77, .07); }
.lf-msg a { color: var(--ink); text-underline-offset: 2px; }

/* ---- thanks page ---- */
.ty-page { display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; }
.ty-hdr { border-bottom: 1px solid var(--line-soft); }
.ty-hdr .wrap { display: flex; align-items: center; min-height: var(--header); }
.ty-name { padding: 14px 0; font: 800 16px/1 var(--sans); letter-spacing: -.01em; text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .ty-name:hover { color: var(--blue); } .ty-link:hover { text-decoration-thickness: 2px; } .ty-req a:hover { color: var(--ink); } }
.ty-name:focus-visible, .ty-link:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.ty-main { flex: 1; padding: clamp(44px, 9vw, 112px) 0 clamp(56px, 9vw, 120px); }
.ty-wrap { max-width: calc(900px + 2 * var(--gutter)); }
.ty-mark { width: 72px; height: 72px; margin-bottom: 28px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: miter; }
.ty-mark .ty-draw-blue { stroke: var(--blue); stroke-width: 3.2; }
@media (prefers-reduced-motion: no-preference) {
  .ty-draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: ty-draw .9s var(--ease) .1s forwards; }
  .ty-draw:nth-child(2) { animation-duration: .35s; animation-delay: .75s; }
  .ty-draw-blue { animation-duration: .6s; animation-delay: 1s; }
}
@keyframes ty-draw { to { stroke-dashoffset: 0; } }
.ty-title { font: 800 var(--fs-h1)/1.05 var(--sans); letter-spacing: -.02em; text-wrap: balance; }
.ty-n { font-family: var(--serif); font-size: 1.12em; font-weight: 600; font-variant-numeric: lining-nums; font-feature-settings: 'lnum' 1; letter-spacing: 0; color: var(--blue); white-space: nowrap; }
.ty-reply { max-width: 36em; margin-top: 22px; font-size: clamp(18px, 1.6vw, 21px); line-height: 1.5; }
.ty-cards { display: grid; gap: 20px; margin-top: clamp(36px, 5vw, 56px); }
@media (min-width: 761px) { .ty-cards { grid-template-columns: 1fr 1fr; gap: 28px; } }
.ty-card { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 16px; align-items: start; padding: 22px 20px; background: var(--sheet) var(--grain); border: 1px solid var(--edge-1); box-shadow: var(--hi), var(--sh-1); }
.ty-card p { font-size: 16px; line-height: 1.55; }
.ty-ico { width: 40px; height: 40px; fill: none; stroke: var(--blue); stroke-width: 1.6; }
.ty-link { color: var(--blue); font-weight: 700; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.ty-ftr { padding: 28px 0 36px; border-top: 1px solid var(--edge-2); color: var(--soft); font-size: var(--fs-sm); line-height: 1.55; }
.ty-notes { display: grid; gap: 4px; margin: 0 0 12px; padding: 0; list-style: none; }
.ty-req a { color: var(--soft); text-underline-offset: 2px; }
