/* Форма заявки на сервис. Все классы с префиксом sf-, чтобы не пересекаться со стилями шаблона spektr. */
.sf-page {
  --sf-accent: #657b9b;
  --sf-accent-dark: #4f6682;
  --sf-text: #1f2933;
  --sf-muted: #6b7785;
  --sf-border: #cfd6df;
  --sf-bg: #ffffff;
  --sf-error: #b3261e;
  --sf-success: #0e8a5f;
  --sf-radius: 6px;
  max-width: 820px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  color: var(--sf-text);
  font: 15px/1.5 Arial, Helvetica, sans-serif;
  box-sizing: border-box;
}
.sf-page *, .sf-page *::before, .sf-page *::after { box-sizing: inherit; }

.sf { background: var(--sf-bg); border: 1px solid var(--sf-border); border-radius: var(--sf-radius); padding: 24px; }
.sf__header { margin-bottom: 8px; }
.sf__title { margin: 0 0 6px; font-size: 24px; line-height: 1.25; font-weight: bold; }
.sf__lead { margin: 0; color: var(--sf-muted); }

.sf__group { border: 0; margin: 20px 0 0; padding: 0; min-width: 0; }
.sf__legend { font-weight: bold; font-size: 17px; padding: 0; margin-bottom: 12px; }
/* Атрибут hidden должен скрывать и элементы с display: flex/grid, и сам блок .sf: сброс стилей
   шаблона spektr задаёт section { display: block } и перебивает браузерное [hidden]. */
.sf-page [hidden] { display: none !important; }

.sf__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
@media (max-width: 640px) { .sf__grid { grid-template-columns: 1fr; } }

.sf__field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.sf__grid > .sf__field { margin-bottom: 0; }
.sf__field--wide { grid-column: 1 / -1; }
.sf__label { font-weight: bold; font-size: 14px; }
.sf__input {
  width: 100%; padding: 10px 12px; font: inherit; color: inherit; background: #fff;
  border: 1px solid var(--sf-border); border-radius: var(--sf-radius);
  transition: border-color .15s, box-shadow .15s;
}
.sf__input:focus { outline: none; border-color: var(--sf-accent); box-shadow: 0 0 0 3px rgba(101, 123, 155, .2); }
.sf__textarea { resize: vertical; min-height: 90px; }
.sf__hint { margin: 0; font-size: 13px; color: var(--sf-muted); }
.sf__error { margin: 0; font-size: 13px; color: var(--sf-error); min-height: 0; display: none; }
.sf__field.is-invalid .sf__error { display: block; }
.sf__field.is-invalid .sf__input { border-color: var(--sf-error); }

.sf__checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px; }
.sf__check { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; font-weight: normal; }
.sf__check input { margin: 4px 0 0; flex: none; }
.sf__check a { color: var(--sf-accent-dark); }

.sf__conditional { margin-bottom: 14px; animation: sf-fade .25s ease-out; }
.sf__grid + .sf__conditional, .sf__grid + .sf__grid { margin-top: 14px; }
@keyframes sf-fade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* Фото и документы: вся зона — подпись к полю файла, поэтому клик в любом её месте открывает проводник. */
.sf__drop {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 26px 16px; text-align: center; cursor: pointer;
  background: #f7f9fb; border: 2px dashed var(--sf-border); border-radius: var(--sf-radius);
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.sf__drop:hover, .sf__drop.is-dragover { background: #eef2f7; border-color: var(--sf-accent); }
.sf__drop.is-dragover { border-style: solid; }
.sf__drop:focus-within { border-color: var(--sf-accent); box-shadow: 0 0 0 3px rgba(101, 123, 155, .2); }
.sf__field.is-invalid .sf__drop { border-color: var(--sf-error); }
/* Само поле скрыто визуально, но доступно с клавиатуры: Tab, затем Enter или пробел открывают проводник. */
.sf__file { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.sf__drop-icon { width: 44px; height: 44px; color: var(--sf-accent); transition: transform .2s; }
.sf__drop:hover .sf__drop-icon, .sf__drop.is-dragover .sf__drop-icon { transform: translateY(-3px); }
.sf__drop-title { font-size: 15px; }
.sf__drop-link { font-weight: bold; color: var(--sf-accent-dark); text-decoration: underline; text-underline-offset: 3px; }
.sf__drop-hint { font-size: 13px; color: var(--sf-muted); }
/* На телефонах перетаскивать нечего. */
@media (hover: none) { .sf__drop-dnd { display: none; } }

.sf__filelist { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sf__filelist-item {
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 10px;
  background: #fff; border: 1px solid var(--sf-border); border-radius: var(--sf-radius);
  animation: sf-fade .2s ease-out;
}
.sf__filelist-thumb {
  flex: none; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  overflow: hidden; border-radius: 4px; background: #eef2f7; color: var(--sf-accent-dark);
  font-size: 10px; font-weight: bold; text-transform: uppercase; letter-spacing: .02em;
}
.sf__filelist-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sf__filelist-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sf__filelist-name { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf__filelist-size { font-size: 12px; color: var(--sf-muted); }
.sf__filelist-remove {
  flex: none; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0;
  color: var(--sf-muted); background: none; border: 0; border-radius: 50%; cursor: pointer; transition: background .15s, color .15s;
}
.sf__filelist-remove:hover, .sf__filelist-remove:focus-visible { color: var(--sf-error); background: #fdecea; outline: none; }
.sf__filelist-remove svg { width: 14px; height: 14px; }
.sf__filelist-total { margin: 0; font-size: 13px; color: var(--sf-muted); }
.sf__field[data-field="files"] .sf__error { white-space: pre-line; }

.sf__field--consent { margin-top: 8px; }
.sf__hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.sf__alert { margin: 12px 0; padding: 10px 12px; border-radius: var(--sf-radius); background: #fdecea; color: var(--sf-error); border: 1px solid #f3c2bd; }

.sf__actions { margin-top: 16px; }
.sf__submit {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 11px 22px; font: inherit; font-weight: bold; color: #fff;
  background: var(--sf-accent); border: 0; border-radius: var(--sf-radius);
  text-shadow: 0 1px 1px #465a77; transition: background .15s;
}
.sf__submit:hover { background: var(--sf-accent-dark); }
.sf__submit:disabled { opacity: .7; cursor: default; }
/* Иконка улетает за правый край кнопки, поэтому кнопка обрезает всё, что выходит за неё. */
.sf__submit { position: relative; overflow: hidden; }
.sf__submit-icon { flex: none; width: 24px; height: 24px; filter: drop-shadow(0 1px 1px #465a77); }
.sf__submit-label { display: inline-block; }
/* Без anime.js (скрипт не загрузился) иконка просто крутится, пока заявка отправляется. */
.sf__submit.is-busy:not(.is-animated) .sf__submit-icon { animation: sf-spin .8s linear infinite; }
/* С анимацией кнопка не бледнеет: занятость и так видна по вращению иконки. */
.sf__submit.is-busy.is-animated:disabled { opacity: 1; cursor: progress; }
@keyframes sf-spin { to { transform: rotate(360deg); } }

.sf--success { text-align: center; color: var(--sf-text); }
.sf__check-icon { width: 72px; height: 72px; color: var(--sf-success); margin-bottom: 8px; }
.sf__check-circle { stroke-dasharray: 176; stroke-dashoffset: 176; animation: sf-draw .6s ease-out forwards; }
.sf__check-mark { stroke-dasharray: 40; stroke-dashoffset: 40; animation: sf-draw .4s ease-out .5s forwards; }
@keyframes sf-draw { to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  .sf__conditional, .sf__check-circle, .sf__check-mark { animation-duration: 0.01s; animation-delay: 0s; }
  .sf__submit-icon { animation: none !important; }
}

.sf__alert--notice { background: #fff8e1; color: #6b5300; border-color: #f0dc9a; }

/* Подсказки организаций по ИНН (DaData) */
.sf__combo { position: relative; }
.sf__combo .sf__input { padding-right: 36px; }
.sf__combo-spinner {
  position: absolute; right: 10px; top: 50%; width: 18px; height: 18px; margin-top: -9px;
  color: var(--sf-accent); opacity: 0; pointer-events: none; transition: opacity .15s;
  animation: sf-spin .8s linear infinite;
}
.sf__combo.is-loading .sf__combo-spinner { opacity: 1; }

.sf__suggest {
  position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0;
  max-height: 320px; overflow-y: auto; margin: 0; padding: 4px 0; list-style: none;
  background: #fff; border: 1px solid var(--sf-border); border-radius: var(--sf-radius);
  box-shadow: 0 8px 24px rgba(31, 41, 51, .14);
  animation: sf-drop .14s ease-out;
}
@keyframes sf-drop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.sf__suggest-item { padding: 8px 12px; cursor: pointer; border-left: 3px solid transparent; }
.sf__suggest-item:hover, .sf__suggest-item[aria-selected="true"] { background: #eef2f7; border-left-color: var(--sf-accent); }
.sf__suggest-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: bold; font-size: 14px; }
.sf__suggest-meta { margin-top: 2px; font-size: 12px; color: var(--sf-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf__suggest-item mark { background: #fff2b3; color: inherit; padding: 0; font: inherit; } /* шаблон spektr делает mark курсивом и жирным */
.sf__suggest-address { font-size: 14px; line-height: 1.4; }
.sf__badge { font-size: 11px; font-weight: normal; padding: 1px 6px; border-radius: 10px; background: #eef2f7; color: var(--sf-muted); }
.sf__badge--danger { background: #fdecea; color: var(--sf-error); }
.sf__badge--warn { background: #fff8e1; color: #6b5300; }

.sf__hint.is-warn { color: #8a6100; }
.sf__hint.is-ok { color: var(--sf-success); }

.sf__input.is-autofilled { animation: sf-autofill 1.2s ease-out; }
@keyframes sf-autofill { from { background: #e3f4ea; } to { background: #fff; } }

@media (prefers-reduced-motion: reduce) {
  .sf__suggest, .sf__input.is-autofilled, .sf__combo-spinner { animation-duration: 0.01s; }
}

/* Выпадающие списки. Свой список вместо нативного: тот рисует браузер, в Chrome он растягивается
   по самой длинной методике и уходит за край экрана, а стилизовать его нельзя. См. enhanceSelect в form.js. */
.sf__select { position: relative; }
.sf__native { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.sf__select-btn { display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer; }
.sf__select-btn:hover:not(:disabled) { border-color: #aab5c3; }
.sf__select-btn:disabled { cursor: default; background: #f4f6f8; color: var(--sf-muted); }
.sf__select-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.sf__select-btn.is-placeholder .sf__select-text { color: var(--sf-muted); }
.sf__select-arrow { flex: none; width: 16px; height: 16px; color: var(--sf-muted); transition: transform .15s, color .15s; }
.sf__select.is-open .sf__select-btn { border-color: var(--sf-accent); box-shadow: 0 0 0 3px rgba(101, 123, 155, .2); }
.sf__select.is-open .sf__select-arrow { transform: rotate(180deg); color: var(--sf-accent); }

.sf__select-list {
  position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0;
  max-height: 320px; overflow-y: auto; overscroll-behavior: contain; margin: 0; padding: 4px 0; list-style: none;
  background: #fff; border: 1px solid var(--sf-border); border-radius: var(--sf-radius);
  box-shadow: 0 8px 24px rgba(31, 41, 51, .14);
  animation: sf-drop .14s ease-out;
}
.sf__select.is-up .sf__select-list { top: auto; bottom: calc(100% + 4px); box-shadow: 0 -8px 24px rgba(31, 41, 51, .14); }
.sf__select-option {
  position: relative; padding: 8px 36px 8px 12px; cursor: pointer;
  font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; border-left: 3px solid transparent;
}
.sf__select-option + .sf__select-option { border-top: 1px solid #f0f2f5; }
.sf__select-option.is-active { background: #eef2f7; border-left-color: var(--sf-accent); }
.sf__select-option[aria-selected="true"] { font-weight: bold; color: var(--sf-accent-dark); }
.sf__select-option[aria-selected="true"]::after {
  content: ''; position: absolute; right: 15px; top: 50%; width: 5px; height: 10px; margin-top: -7px;
  border: solid var(--sf-accent); border-width: 0 2px 2px 0; transform: rotate(45deg);
}

/* Кнопки выбора «Да / Нет». Радиокнопка прозрачная и лежит поверх кнопки: клик и клавиатура работают как у обычной. */
.sf__choices { display: flex; flex-wrap: wrap; gap: 10px; }
.sf__choice { position: relative; display: inline-flex; }
.sf__choice input { position: absolute; top: 0; left: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.sf__choice span {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 112px;
  padding: 10px 20px; font-weight: bold; background: #fff;
  border: 1px solid var(--sf-border); border-radius: var(--sf-radius);
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.sf__choice span::before {
  content: ''; width: 14px; height: 14px; border-radius: 50%; flex: none;
  border: 2px solid #aab5c3; background: #fff; transition: border-color .15s, box-shadow .15s;
}
.sf__choice:hover span { border-color: var(--sf-accent); }
.sf__choice input:checked + span { background: var(--sf-accent); border-color: var(--sf-accent); color: #fff; }
.sf__choice input:checked + span::before { border-color: #fff; box-shadow: inset 0 0 0 3px var(--sf-accent); }
.sf__choice input:focus-visible + span { box-shadow: 0 0 0 3px rgba(101, 123, 155, .35); }
.sf__field.is-invalid .sf__choice span { border-color: var(--sf-error); }

@media (prefers-reduced-motion: reduce) {
  .sf__select-list, .sf__filelist-item { animation-duration: 0.01s; }
}

/* Yandex SmartCaptcha: виджет задаёт высоту сам, резервируем место, чтобы форма не прыгала при загрузке. */
.sf__field--captcha { margin-top: 8px; }
.sf__captcha { min-height: 102px; max-width: 400px; }
.sf__captcha[data-invisible="1"] { min-height: 0; }
