/* Lead form (src/components/blocks/lead-form.tsx): the showroom sheet and the "#popup:order" modal.
   White ink on black, hairlines, square corners, mono annotations. Scoped to .kd-lf / .kd-modal. */
@font-face { font-family: 'KD Mono'; font-style: normal; font-weight: 400 500; font-display: swap;
  src: url(/kd/fonts/jbmono-cyrillic-400.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'KD Mono'; font-style: normal; font-weight: 400 500; font-display: swap;
  src: url(/kd/fonts/jbmono-latin-400.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

.kd-lf, .kd-modal {
  --lf-ink: #fff;
  --lf-paper: #000;
  --lf-rule: rgba(255, 255, 255, .22);
  --lf-dim: rgba(255, 255, 255, .5);
  --lf-error: #ff5a4e;
  --lf-mono: 'KD Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --lf-ease: cubic-bezier(.23, 1, .32, 1);
  font-family: var(--t-text-font, 'Montserrat', Arial, sans-serif);
  -webkit-font-smoothing: antialiased;
}
.kd-lf *, .kd-lf *::before, .kd-lf *::after, .kd-modal *, .kd-modal *::before, .kd-modal *::after { box-sizing: border-box; }
/* zero-specificity reset: the component rules below must win */
:where(.kd-lf) :where(p, h2, h3) { margin: 0; padding: 0; }
#allrecords .kd-lf a, .kd-modal .kd-lf a { color: inherit; }

.kd-lf { position: relative; display: flex; flex-direction: column; background: var(--lf-paper); color: var(--lf-ink);
  padding: 30px 32px 0; }
.kd-lf__code { font-family: var(--lf-mono); font-size: 12px; color: var(--lf-dim); margin-bottom: 14px; }
.kd-lf__title { margin-top: 0; font-size: 34px; line-height: 1; font-weight: 400; letter-spacing: -.04em; }
.kd-lf__sub { margin-top: 10px; font-size: 14px; line-height: 1.5; color: var(--lf-dim); max-width: 30em; }

.kd-lf__form { display: flex; flex-direction: column; flex: 1; margin-top: 22px; }
.kd-lf__k { display: block; font-family: var(--lf-mono); font-size: 11px; color: var(--lf-dim); transition: color 160ms ease; }

/* underlined fields */
.kd-lf__pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 24px; }
.kd-lf__row { position: relative; padding: 14px 0 0; border-bottom: 1px solid var(--lf-rule); transition: border-color 160ms ease; }
.kd-lf__row::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--lf-ink);
  transform: scaleX(0); transform-origin: left; transition: transform 300ms var(--lf-ease); }
.kd-lf__row:focus-within::after { transform: scaleX(1); }
.kd-lf__row:focus-within .kd-lf__k { color: var(--lf-ink); }
.kd-lf__row[data-invalid] { border-color: var(--lf-error); }
.kd-lf__row[data-invalid] .kd-lf__k { color: var(--lf-error); }
.kd-lf__input { width: 100%; height: 42px; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--lf-ink);
  font: inherit; font-size: 17px; outline: none; -webkit-appearance: none; appearance: none; }
.kd-lf__input::placeholder { color: rgba(255, 255, 255, .26); }

/* segmented choices: one strip, the chosen cell fills with ink */
.kd-lf__group { padding-top: 18px; }
.kd-lf__seg { margin-top: 8px; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); border: 1px solid var(--lf-rule); }
.kd-lf__seg label { position: relative; display: block; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; }
.kd-lf__seg label + label { border-left: 1px solid var(--lf-rule); }
.kd-lf__seg input { position: absolute; opacity: 0; pointer-events: none; }
.kd-lf__seg span { display: flex; align-items: center; justify-content: center; height: 42px; padding: 0 8px; font-size: 14px; white-space: nowrap;
  color: rgba(255, 255, 255, .78); transition: background-color 160ms ease, color 160ms ease; }
.kd-lf__seg label:active span { background: rgba(255, 255, 255, .08); }
.kd-lf__seg input:checked + span { background: var(--lf-ink); color: var(--lf-paper); }
.kd-lf__seg input:focus-visible + span { outline: 1px solid var(--lf-ink); outline-offset: -5px; }
.kd-lf__seg input:checked:focus-visible + span { outline-color: var(--lf-paper); }

.kd-lf__opt input, .kd-lf__consent input { position: absolute; opacity: 0; pointer-events: none; }
.kd-lf__sq { flex: none; width: 14px; height: 14px; border: 1px solid rgba(255, 255, 255, .55); position: relative; transition: border-color 160ms ease; }
.kd-lf__sq::after { content: ""; position: absolute; inset: 2px; background: var(--lf-ink); transform: scale(0); transition: transform 160ms ease-out; }
.kd-lf__consent input:checked + .kd-lf__sq::after { transform: scale(1); }
.kd-lf__consent input:focus-visible + .kd-lf__sq { outline: 1px solid var(--lf-ink); outline-offset: 3px; }
.kd-lf__consent { display: flex; gap: 12px; align-items: flex-start; margin: 20px 0; font-size: 12px; line-height: 1.5; color: var(--lf-dim); cursor: pointer; }
.kd-lf__consent .kd-lf__sq { margin-top: 2px; }
.kd-lf__consent[data-invalid] .kd-lf__sq { border-color: var(--lf-error); }
.kd-lf__consent[data-invalid] { color: rgba(255, 90, 78, .9); }
.kd-lf__consent a { text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .35); text-underline-offset: 3px; }

.kd-lf__error { font-family: var(--lf-mono); font-size: 12px; color: var(--lf-error); }
.kd-lf__error:not(:empty) { margin: -8px 0 16px; }
.kd-lf__submit { margin: auto -32px 0; position: relative; height: 64px; border: 0; border-radius: 0; background: var(--lf-ink);
  color: var(--lf-paper); font: inherit; font-size: 16px; font-weight: 600; letter-spacing: -.01em; cursor: pointer;
  transition: background-color 160ms ease; -webkit-tap-highlight-color: transparent; }
.kd-lf__submit span { display: inline-block; transition: transform 160ms ease-out; }
.kd-lf__submit:active span { transform: scale(.97); }
.kd-lf__submit:focus-visible { outline: 1px solid var(--lf-paper); outline-offset: -6px; }
.kd-lf[data-state="sending"] .kd-lf__submit { pointer-events: none; }
.kd-lf[data-state="sending"] .kd-lf__submit span { opacity: 0; }
.kd-lf[data-state="sending"] .kd-lf__submit::after { content: ""; position: absolute; left: 50%; top: 50%; width: 120px; height: 1px;
  margin-left: -60px; background: var(--lf-paper); transform-origin: left; animation: kd-lf-line 900ms ease-in-out infinite; }
@keyframes kd-lf-line { 0% { transform: scaleX(0); } 50% { transform: scaleX(1); transform-origin: left; } 50.1% { transform-origin: right; } 100% { transform: scaleX(0); transform-origin: right; } }

.kd-lf__alt { margin: 0 -32px; padding: 14px 32px; border-top: 1px solid var(--lf-rule); font-family: var(--lf-mono); font-size: 12px; color: var(--lf-dim);
  display: flex; flex-wrap: wrap; gap: 6px 14px; }
.kd-lf__alt a { color: var(--lf-ink); text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .3); text-underline-offset: 3px; }

.kd-lf__done { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 30px 32px 36px;
  background: var(--lf-paper); opacity: 0; visibility: hidden; transition: opacity 240ms ease, visibility 0s linear 240ms; }
.kd-lf[data-state="done"] .kd-lf__done { opacity: 1; visibility: visible; transition: opacity 240ms ease; }
.kd-lf__done .kd-lf__code { margin-bottom: auto; }
.kd-lf__done h3 { font-size: 34px; line-height: 1; font-weight: 400; letter-spacing: -.04em; }
.kd-lf__done p { margin-top: 12px; font-size: 15px; line-height: 1.5; color: var(--lf-dim); max-width: 24em; }
.kd-lf__stamp { align-self: flex-start; display: inline-block; margin-bottom: 22px; padding: 6px 10px; border: 1px solid var(--lf-ink); font-family: var(--lf-mono);
  font-size: 12px; transform: rotate(-4deg) scale(1.08); opacity: 0; transition: transform 300ms var(--lf-ease) 120ms, opacity 200ms ease 120ms; }
.kd-lf[data-state="done"] .kd-lf__stamp { transform: rotate(-4deg); opacity: 1; }

@media (hover: hover) and (pointer: fine) {
  .kd-lf__submit:hover { background: #e6e6e6; }
  .kd-lf__seg label:hover input:not(:checked) + span { background: rgba(255, 255, 255, .06); color: #fff; }
  .kd-lf__consent:hover .kd-lf__sq { border-color: var(--lf-ink); }
}

/* modal: the same form over the page */
.kd-modal { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 16px; visibility: hidden; pointer-events: none; }
.kd-modal[data-open] { visibility: visible; pointer-events: auto; }
.kd-modal__bg { position: absolute; inset: 0; background: rgba(0, 0, 0, .72); opacity: 0; transition: opacity 160ms ease; }
.kd-modal[data-open] .kd-modal__bg { opacity: 1; transition-duration: 220ms; }
.kd-modal__dialog { position: relative; width: min(540px, 100%); max-height: calc(100dvh - 32px); overflow: auto; border: 1px solid rgba(255, 255, 255, .22);
  opacity: 0; transform: translateY(10px); transition: opacity 160ms ease, transform 160ms ease; }
.kd-modal[data-open] .kd-modal__dialog { opacity: 1; transform: none; transition: opacity 220ms var(--lf-ease), transform 220ms var(--lf-ease); }
.kd-modal__close { position: absolute; top: 0; right: 0; z-index: 2; width: 52px; height: 52px; border: 0; border-left: 1px solid rgba(255, 255, 255, .22);
  border-bottom: 1px solid rgba(255, 255, 255, .22); background: #000; color: #fff; display: grid; place-items: center; cursor: pointer;
  transition: background-color 160ms ease; }
.kd-modal__close svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.2; fill: none; }
.kd-modal__close:focus-visible { outline: 1px solid #fff; outline-offset: -6px; }
.kd-modal .kd-lf__head { padding-right: 40px; }
html.kd-modal-lock, html.kd-modal-lock body { overflow: hidden; }
@media (hover: hover) and (pointer: fine) { .kd-modal__close:hover { background: #151515; } }

@media (max-width: 639px) {
  .kd-lf { padding: 24px 18px 0; }
  .kd-lf__title { font-size: 28px; }
  .kd-lf__pair { grid-template-columns: minmax(0, 1fr); }
  .kd-lf__seg span { font-size: 13px; padding: 0 4px; }
  .kd-lf__submit { margin-left: -18px; margin-right: -18px; }
  .kd-lf__alt { margin: 0 -18px; padding: 14px 18px; }
  .kd-modal { place-items: end center; padding: 0; }
  .kd-modal__dialog { width: 100%; max-height: 94dvh; border-left: 0; border-right: 0; border-bottom: 0; transform: translateY(100%); }
  .kd-modal[data-open] .kd-modal__dialog { transition: opacity 200ms ease, transform 380ms cubic-bezier(.32, .72, 0, 1); }
  .kd-modal .kd-lf { padding-bottom: env(safe-area-inset-bottom); }
}
@media (prefers-reduced-motion: reduce) {
  .kd-modal__dialog, .kd-modal[data-open] .kd-modal__dialog { transform: none; }
  .kd-lf__row::after { transition: none; }
}

/* quiz (light, Tilda's orange buttons): file picker and consent, src/lib/forms.ts */
.kd-upload { font-family: var(--t-text-font, 'Montserrat', Arial, sans-serif); }
.kd-upload__btn { position: relative; display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 24px; border-radius: 4px;
  color: #fff; font-size: 16px; font-weight: 500; cursor: pointer; user-select: none;
  background-image: linear-gradient(.25turn, #ff9f4c 0%, #ff7700 100%); transition: transform 160ms ease-out, filter 200ms ease; }
.kd-upload__btn:active { transform: scale(.97); }
.kd-upload__btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.kd-upload__btn::before { content: ""; width: 18px; height: 18px; flex: none;
  background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 12V3M5 6.5 9 2.5l4 4M3 12.5v2A1.5 1.5 0 0 0 4.5 16h9a1.5 1.5 0 0 0 1.5-1.5v-2'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 12V3M5 6.5 9 2.5l4 4M3 12.5v2A1.5 1.5 0 0 0 4.5 16h9a1.5 1.5 0 0 0 1.5-1.5v-2'/%3E%3C/svg%3E") center/contain no-repeat; }
.kd-upload__btn:focus-within { outline: 2px solid #ff7700; outline-offset: 3px; }
.kd-upload__hint { margin: 12px 0 0; font-size: 14px; line-height: 1.5; color: #8a8a8a; }
.kd-upload__list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; max-width: 520px; }
.kd-upload__item { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 14px; border-radius: 8px; background: #f5f5f5; font-size: 14px; }
.kd-upload__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #222; }
.kd-upload__state { flex: none; color: #8a8a8a; font-variant-numeric: tabular-nums; }
.kd-upload__item.is-done .kd-upload__state { color: #2e9d55; }
.kd-upload__item.is-error .kd-upload__state { color: #e5483a; }
.kd-upload__remove { flex: none; width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: #999; font-size: 20px;
  line-height: 1; cursor: pointer; transition: background-color 200ms ease, color 200ms ease; }
.kd-upload__remove:hover { background: #e9e9e9; color: #333; }
.kd-consent { margin-top: 18px; }
.kd-consent .t-checkbox__control { align-items: flex-start; gap: 0; line-height: 1.5; color: #555; }
.kd-consent a { color: inherit !important; text-decoration: underline; text-underline-offset: 3px; }
@media (hover: hover) and (pointer: fine) { .kd-upload__btn:hover { filter: brightness(1.05); } }
