/* Окно формы — доска Form макета Claude Design (Form.dc.html): подложка, карточка 560,
   поля, согласие, кнопка, «Или напишите», экран «Заявка получена». Поведение — scripts/form.js. */

.fmodal, .fmodal * { box-sizing: border-box; }
/* Стабильное место полосы сохраняет ширину страницы и её липкой шапки. */
html { scrollbar-gutter: stable; }
html.fmodal-root-open, body.fmodal-open { overflow: hidden; }
@supports not (scrollbar-gutter: stable) {
  body.fmodal-open { padding-right: var(--fmodal-body-padding, 0px); }
}
.fmodal { position: fixed; inset: var(--fmodal-top, 0px) 0 auto; height: var(--fmodal-height, 100vh); height: var(--fmodal-height, 100dvh); z-index: 50; display: flex; align-items: center; justify-content: center; padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); opacity: 0; transition: opacity 200ms ease; }
.fmodal.is-open { opacity: 1; }
.fmodal[hidden] { display: none; }
.fmodal__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5); touch-action: none; }
.fmodal__card {
  position: relative; width: 560px; max-width: 100%; max-height: 100%; min-height: 0; overflow: auto; overscroll-behavior: contain;
  background: #fff; border-radius: 20px; padding: 0; display: flex; flex-direction: column;
  font-family: 'Inter', system-ui, sans-serif; color: #222;
  transform: translateY(12px); transition: transform 200ms ease; scroll-padding-top: 80px;
}
.fmodal.is-open .fmodal__card { transform: translateY(0); }
.fmodal__head { position: sticky; top: 0; z-index: 1; display: flex; flex: none; align-items: center; justify-content: space-between; gap: 8px; min-height: 68px; padding: 12px 40px 0; background: var(--color-surface); }
.fmodal__brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fmodal__brand img { width: 38px; height: 20px; display: block; flex: none; }
.fmodal__brand span { font-size: 12px; line-height: 20px; font-weight: 500; color: #797979; white-space: nowrap; }
.fmodal__form, .fmodal__done { display: flex; flex: none; flex-direction: column; padding: 12px 40px 36px; }
.fmodal__form { gap: 20px; }
.fmodal__form[hidden], .fmodal__done[hidden] { display: none; }
.fmodal__card h2 { margin: 0; font-size: 24px; line-height: 29.05px; font-weight: 600; letter-spacing: -0.48px; }
.fmodal__card h2 + p, .fmodal__form > div > p { margin: 12px 0 0; font-size: 16px; line-height: 24px; color: #4F4F4F; }
.fmodal__fields { display: flex; flex-direction: column; gap: 12px; }
.fld { display: flex; flex-direction: column; gap: 6px; }
.fld__feedback { min-height: 44px; }
@media (min-width: 768px) {
  #f-wrap-mail .fld__feedback { min-height: 22px; }
}
.fld__hint { margin: 0; font-size: 14px; line-height: 22px; color: var(--color-text-body-alt); }
.fld.show-err .fld__hint { display: none; }
.fld label { font-size: 14px; line-height: 20px; font-weight: 500; color: #222; }
.fld input, .fld textarea { width: 100%; height: 56px; border: 1px solid #E6E6E6; border-radius: 8px; padding: 16px; font: 400 16px/24px 'Inter', sans-serif; letter-spacing: -0.32px; color: #000; background: #fff; }
.fld textarea { height: 112px; resize: none; }
.fld input::placeholder, .fld textarea::placeholder { color: #B6B6B6; }
.fld input:focus, .fld textarea:focus { outline: none; border-color: #222; box-shadow: 0 0 0 1px #222; }
.chk { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 22px; color: #4F4F4F; cursor: pointer; }
.chk input { width: 24px; height: 24px; margin: 0; flex: none; accent-color: #FF6800; }
.chk a { color: #4F4F4F; text-decoration: underline; text-decoration-color: #FF6800; }
.go { width: 100%; height: 56px; border: 0; border-radius: 8px; background: #FF6800; color: #fff; font: 700 16px/19.36px 'Inter', sans-serif; cursor: pointer; }
.go:hover { opacity: 0.7; }
.copy { height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: #F2F2F2; font: 600 12px/14.52px 'Inter', sans-serif; color: #000; cursor: pointer; }
.copy.ok { background: #FFE8D9; }
.fmodal__or { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 16px; line-height: 24px; color: #4F4F4F; }
.fmodal__or a { font-weight: 600; color: #222; text-decoration: none; }
.x { width: 44px; height: 44px; flex: none; border: 0; background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; border-radius: 8px; }
.x:hover svg { stroke: #FF6800; }
.fmodal__done { gap: 12px; }
.fmodal__done p { margin: 0; font-size: 16px; line-height: 24px; color: #4F4F4F; }
.fmodal__done b { color: #222; font-weight: 600; }
.fmodal__backwrap { margin-top: 20px; }
.back { display: inline-flex; align-items: center; justify-content: center; height: 48px; padding: 0 16px; border-radius: 8px; border: 1px solid #E6E6E6; background: #fff; font: 700 16px/19.36px 'Inter', sans-serif; color: #222; text-decoration: none; cursor: pointer; }
.back:hover { background: #F9F9F9; color: #222; }
/* Плашка выбранной категории (ТЗ 20.10, §8.4): текст без фото, над полями */
.fmodal__badge { display: flex; align-items: center; gap: 8px; width: fit-content; margin: 0; padding: 8px 12px; background: #FFF0E6; border-radius: 8px; font: 500 14px/20px 'Inter', sans-serif; color: #222; }
.fmodal__badge[hidden] { display: none; }
.fmodal__badge svg { flex: none; fill: #FF6800; }
/* Ошибки полей и согласия (ТЗ 20.10, §8.3) */
.err { display: flex; align-items: flex-start; gap: var(--space-field-gap); font-size: 14px; line-height: 20px; color: var(--color-text-tooltip); }
.err:empty { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.err:not(:empty)::before { content: ''; display: block; flex: none; width: 16px; height: 16px; margin-top: 2px; background: var(--color-error); mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0Zm-1 4h2v5H7Zm0 6h2v2H7Z'/%3E%3C/svg%3E") center / contain no-repeat; }
.fld.show-err .err { margin-top: 2px; }
@media (prefers-reduced-motion: no-preference) {
  #f-err-mail:not(:empty) { animation: email-error-appear 160ms ease-out; }
}
@keyframes email-error-appear { from { opacity: 0; } }
.fld.show-err input { border-color: var(--color-error); background: var(--color-error-tint); }
.fld.show-err input:focus { box-shadow: 0 0 0 1px var(--color-error); }
.chk input[aria-invalid="true"] { appearance: none; border: 2px solid var(--color-error); border-radius: var(--radius-xs); background: var(--color-error-tint); }
#f-err-consent:not(:empty) { margin: 0 0 4px; }
.fmodal .copy:focus-visible, .fmodal .go:focus-visible, .fmodal .x:focus-visible, .fmodal .back:focus-visible,
.fmodal a:focus-visible, .fmodal input[type="checkbox"]:focus-visible,
.lp a:focus-visible, .lp button:focus-visible { outline: 2px solid var(--color-ink); outline-offset: 2px; }

@media (max-width: 767px) {
  .fmodal { padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
  .fmodal__card { width: 100%; }
  .fmodal__head { min-height: 60px; padding: 8px 20px 0; }
  .fmodal__form, .fmodal__done { padding: 12px 20px 24px; }
}
@media (max-width: 359px) {
  .fmodal__head { padding-left: 12px; padding-right: 8px; gap: 4px; }
  .fmodal__brand { gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .fmodal, .fmodal__card { transition: none; }
  .fmodal__card { transform: none; }
}
