/* Вход — вид только из темы (--sf-*). Телефон: шторка снизу; ПК: окно по центру. Без окна — карточкой в потоке. */
[data-sf-template] .bs-veil { position: fixed; inset: 0; z-index: 95; display: flex; align-items: flex-end; justify-content: center; background: var(--sf-color-surface-scrim); }
[data-sf-template] .bs-sheet { position: relative; width: 100%; max-height: 94vh; max-height: 94dvh; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; box-sizing: border-box;
  padding-bottom: max(20px, env(safe-area-inset-bottom)); background: var(--sf-color-surface-default); color: var(--sf-color-text-primary);
  border-radius: var(--sf-radius-lg) var(--sf-radius-lg) 0 0; box-shadow: var(--sf-shadow-lg); outline: none; font-family: var(--sf-font-body); }
[data-sf-template] .bs-grab { align-self: center; flex: none; width: 40px; height: 5px; margin-top: 8px; border-radius: var(--sf-radius-pill); background: var(--sf-color-line-default); }
[data-sf-template] .bs-inline { box-sizing: border-box; padding: 4px 0 20px; border-radius: var(--sf-radius-lg); background: var(--sf-color-surface-default); color: var(--sf-color-text-primary); font-family: var(--sf-font-body); }

[data-sf-template] .bs-head { flex: none; display: flex; align-items: center; gap: 12px; padding: 10px 16px 0 20px; }
[data-sf-template] .bs-title { flex: 1; min-width: 0; margin: 0; font-family: var(--sf-font-heading); font-size: 24px; line-height: 1.2; font-weight: 700; overflow-wrap: anywhere; }
[data-sf-template] .bs-title-alone { margin-top: 6px; }
[data-sf-template] .bs-gap { flex: 1; }
[data-sf-template] .bs-close { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--sf-color-surface-sunken); color: var(--sf-color-text-primary);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
[data-sf-template] .bs-back { flex: none; height: 44px; padding: 0 16px 0 10px; display: inline-flex; align-items: center; gap: 2px; border: 0; border-radius: var(--sf-radius-pill);
  background: var(--sf-color-surface-sunken); color: var(--sf-color-text-primary); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }

[data-sf-template] .bs-body { display: flex; flex-direction: column; gap: 14px; padding: 6px 20px 4px; margin: 0; }
[data-sf-template] .bs-lead { margin: 0; font-size: 15px; line-height: 1.45; color: var(--sf-color-text-secondary); }
[data-sf-template] .bs-lead b { color: var(--sf-color-text-primary); font-weight: 600; white-space: nowrap; }
[data-sf-template] .bs-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Номер: «+7» в поле, цифры крупно */
[data-sf-template] .bs-field-wrap { display: flex; flex-direction: column; gap: 6px; }
[data-sf-template] .bs-label { padding-left: 4px; font-size: 14px; font-weight: 600; color: var(--sf-color-text-secondary); }
[data-sf-template] .bs-field { height: 60px; display: flex; align-items: center; gap: 10px; padding: 0 10px 0 16px; box-sizing: border-box; border-radius: var(--sf-radius-md);
  background: var(--sf-color-surface-raised); border: 2px solid var(--sf-color-line-default); }
[data-sf-template] .bs-field:focus-within { border-color: var(--sf-color-brand-default); }
[data-sf-template] .bs-field.is-bad { border-color: var(--sf-color-signal-danger); }
[data-sf-template] .bs-prefix { flex: none; padding-right: 10px; border-right: 1px solid var(--sf-color-line-default); font-size: 20px; font-weight: 600; line-height: 24px; }
[data-sf-template] .bs-field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; color: var(--sf-color-text-primary);
  font: inherit; font-size: 20px; font-weight: 600; letter-spacing: .01em; }
[data-sf-template] .bs-field input::placeholder { color: var(--sf-color-text-muted); font-weight: 400; }
[data-sf-template] .bs-clear { flex: none; width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--sf-color-surface-sunken); color: var(--sf-color-text-muted);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }

/* Согласия и документы — текстом, ссылки цветом текста с подчёркиванием */
[data-sf-template] .bs-legal { margin: 0; font-size: 13px; line-height: 1.45; color: var(--sf-color-text-muted); }
[data-sf-template] .bs-legal a, [data-sf-template] .bs-check a { color: var(--sf-color-text-primary); text-decoration: underline; text-underline-offset: 2px; }
[data-sf-template] .bs-check { position: relative; display: flex; align-items: flex-start; gap: 10px; min-height: 24px; font-size: 15px; line-height: 1.4; cursor: pointer; }
[data-sf-template] .bs-check input { position: absolute; inset: 0; width: 22px; height: 22px; margin: 0; opacity: 0; cursor: pointer; }
[data-sf-template] .bs-box { flex: none; width: 22px; height: 22px; box-sizing: border-box; border-radius: var(--sf-radius-sm); border: 2px solid var(--sf-color-line-strong); color: transparent;
  display: inline-flex; align-items: center; justify-content: center; }
[data-sf-template] .bs-check input:checked + .bs-box { background: var(--sf-color-brand-default); border-color: var(--sf-color-brand-default); color: var(--sf-color-text-inverse); }
[data-sf-template] .bs-check input:focus-visible + .bs-box { outline: 2px solid var(--sf-color-line-focus); outline-offset: 2px; }

/* Кнопка: белый на голубом Wolt — 3,0, проходит только крупный жирный текст, поэтому 19px */
[data-sf-template] .bs-go { min-height: 56px; display: flex; align-items: center; justify-content: center; padding: 6px 20px; border: 0; border-radius: var(--sf-radius-pill);
  background: var(--sf-color-brand-default); color: var(--sf-color-text-inverse); font: inherit; font-size: 19px; font-weight: 700; cursor: pointer; }
@media (hover: hover) and (pointer: fine) { [data-sf-template] .bs-go:hover { background: var(--sf-color-brand-hover); } }
[data-sf-template] .bs-go:disabled { background: var(--sf-color-brand-disabled); cursor: default; }
[data-sf-template] .bs-go[aria-busy="true"] { background: var(--sf-color-brand-default); }

[data-sf-template] .bs-error { margin: 0; display: flex; align-items: flex-start; gap: 8px; font-size: 15px; line-height: 1.4; color: var(--sf-color-signal-danger); }
[data-sf-template] .bs-error svg { flex: none; margin-top: 1px; }
[data-sf-template] .bs-note { margin: 0; font-size: 14px; color: var(--sf-color-text-secondary); }

/* Другие способы входа — только если ресторан их включил */
[data-sf-template] .bs-providers { display: flex; flex-direction: column; gap: 12px; }
[data-sf-template] .bs-or { margin: 4px 0 0; display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--sf-color-text-muted); }
[data-sf-template] .bs-or::before, [data-sf-template] .bs-or::after { content: ""; flex: 1; height: 1px; background: var(--sf-color-line-default); }
[data-sf-template] .bs-provider-list { display: flex; flex-wrap: wrap; gap: 8px; }
[data-sf-template] .bs-provider { flex: 1 1 140px; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border: 1px solid var(--sf-color-line-default);
  border-radius: var(--sf-radius-pill); background: var(--sf-color-surface-raised); color: var(--sf-color-text-primary); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
[data-sf-template] .bs-provider[aria-pressed="true"] { border-color: var(--sf-color-brand-default); }
[data-sf-template] .bs-mark { width: 24px; height: 24px; border-radius: 50%; background: var(--sf-color-surface-sunken); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; }

/* Код: четыре клетки над одним полем */
[data-sf-template] .bs-code { position: relative; display: block; width: max-content; margin-top: 6px; }
[data-sf-template] .bs-code input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; font-size: 16px; color: transparent; caret-color: transparent; }
[data-sf-template] .bs-cells { display: flex; gap: 12px; pointer-events: none; transition: transform 70ms ease-out; }
[data-sf-template] .bs-cell { width: 64px; height: 72px; box-sizing: border-box; border-radius: var(--sf-radius-md); border: 2px solid transparent; background: var(--sf-color-surface-sunken);
  display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; transition: color .2s, border-color .2s; }
[data-sf-template] .bs-code:focus-within .bs-cell.is-active { border-color: var(--sf-color-brand-default); }
[data-sf-template] .bs-code:focus-within .bs-cell.is-active:empty::after { content: ""; width: 2px; height: 28px; background: var(--sf-color-brand-default); }
[data-sf-template] .bs-code.is-bad .bs-cell { border-color: var(--sf-color-signal-danger); color: var(--sf-color-signal-danger); }
/* Неверный код: вздрогнуть влево-вправо, замереть, цифры гаснут — блок их стирает сам */
[data-sf-template] .bs-code.is-step-1 .bs-cells { transform: translateX(-10px); }
[data-sf-template] .bs-code.is-step-2 .bs-cells { transform: translateX(10px); }
[data-sf-template] .bs-code.is-step-3 .bs-cells { transform: translateX(-6px); }
[data-sf-template] .bs-code.is-step-4 .bs-cells { transform: translateX(6px); }
[data-sf-template] .bs-code.is-step-6 .bs-cell { color: transparent; }
@media (prefers-reduced-motion: reduce) {
  [data-sf-template] .bs-cells, [data-sf-template] .bs-cell { transition: none; }
  [data-sf-template] .bs-code .bs-cells { transform: none; }
}
[data-sf-template] .bs-wait { margin: 4px 0 0; display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--sf-color-text-secondary); font-variant-numeric: tabular-nums; }
[data-sf-template] .bs-again { align-self: flex-start; min-height: 44px; margin-top: 2px; padding: 0; display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent;
  color: var(--sf-color-text-primary); font: inherit; font-size: 16px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
[data-sf-template] .bs-again svg { color: var(--sf-color-brand-default); }
[data-sf-template] .bs-again:disabled { color: var(--sf-color-text-muted); text-decoration: none; cursor: default; }

/* Готово и «вы вошли» в потоке */
[data-sf-template] .bs-done { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 36px 24px 28px; text-align: center; }
[data-sf-template] .bs-done-mark { width: 72px; height: 72px; border-radius: 50%; background: var(--sf-color-brand-default); color: var(--sf-color-text-inverse); display: flex; align-items: center; justify-content: center; }
[data-sf-template] .bs-done b { font-family: var(--sf-font-heading); font-size: 24px; }
[data-sf-template] .bs-done span:last-child { font-size: 15px; color: var(--sf-color-text-secondary); }
[data-sf-template] .bs-signed { display: flex; align-items: center; gap: 12px; padding: 12px 20px; }
[data-sf-template] .bs-signed-icon { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--sf-color-surface-sunken); display: inline-flex; align-items: center; justify-content: center; }
[data-sf-template] .bs-signed p { flex: 1; min-width: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
[data-sf-template] .bs-signed small { font-size: 13px; color: var(--sf-color-text-secondary); }
[data-sf-template] .bs-signed span { font-size: 16px; font-weight: 600; }
[data-sf-template] .bs-link { min-height: 44px; padding: 0 4px; border: 0; background: transparent; color: var(--sf-color-text-primary); font: inherit; font-size: 15px; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

[data-sf-template] .bs-sheet button:focus-visible, [data-sf-template] .bs-inline button:focus-visible { outline: 2px solid var(--sf-color-line-focus); outline-offset: 2px; }
/* ПК: каркас открывает для входа боковую панель с заголовком «Вход» и крестиком. Раньше блок рисовал своё окно по
   центру, а панель за ним оставалась пустой (проверка вёрстки 16.11). В панели стоим карточкой, как блоки корзины, без
   своей подложки, заголовка и крестика. Вне панели — прежнее окно. */
@media (min-width: 900px) {
  [data-sf-template] .d-panel-body .bs-veil { position: static; display: block; width: 100%; min-width: 0; box-sizing: border-box; padding: 0 12px; background: transparent; }
  [data-sf-template] .d-panel-body .bs-sheet { width: auto; min-width: 0; max-height: none; padding-bottom: 24px; border-radius: var(--sf-radius-lg); box-shadow: none; }
  [data-sf-template] .d-panel-body .bs-grab { display: none; }
  [data-sf-template] .d-panel-body .bs-title:not(.bs-title-alone), [data-sf-template] .d-panel-body .bs-close { display: none; }
}

@media (min-width: 900px) {
  [data-sf-template] .bs-veil { align-items: center; }
  [data-sf-template] .bs-sheet { width: 440px; max-height: 86vh; max-height: 86dvh; padding-bottom: 24px; border-radius: var(--sf-radius-lg); }
  [data-sf-template] .bs-grab { display: none; }
  [data-sf-template] .bs-head { padding: 20px 20px 0 24px; }
  [data-sf-template] .bs-body { padding: 8px 24px 4px; }
}

/* Телефон (навык mobile-native, 16.11.2026): отклик на нажатие, подпись кнопки не выделяется долгим нажатием. */
[data-sf-template] :is(.bs-go, .bs-provider, .bs-again) { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
[data-sf-template] :is(.bs-go, .bs-provider, .bs-again):active:not(:disabled) { transform: scale(.97); }
/* Нажатие, проход 2 (16.11): отклик у всего, что нажимается; при prefers-reduced-motion переходов нет. */
[data-sf-template] :is(.bs-back, .bs-clear, .bs-close):active:not(:disabled) { transform: scale(.97); }
[data-sf-template] :is(.bs-link):active { opacity: .7; }
@media (prefers-reduced-motion: no-preference) {
  [data-sf-template] :is(.bs-back, .bs-clear, .bs-close) { transition: transform 120ms cubic-bezier(.23, 1, .32, 1); }
  [data-sf-template] :is(.bs-link) { transition: opacity 120ms cubic-bezier(.23, 1, .32, 1); }
}
@media (prefers-reduced-motion: no-preference) {
  [data-sf-template] :is(.bs-go, .bs-provider, .bs-again) { transition: transform 120ms cubic-bezier(.23, 1, .32, 1); }
}
