/* ============================================================================
   Клиентский путь «Перемены» — общий модуль экранов онбординга
   (REQ-2026-11-25-client-ux; структура и компоненты — ui/components.css пакета
   Peremena_Agent_Pack_v1.1; иллюстрации — комплект автора
   Peremena_Onboarding_Transparent_Final, /assets/onboarding/<дата>/).

   Подключается в /booking/ и /reg/ ПОСЛЕ собственных стилей приложения.
   Правила — только с уникальным префиксом onb- (и класс .screen-illustration):
   шапку, панель поддержки и остальные экраны не затрагивают.
   Токены пакета отображены на тему приложения: фон #fffbf3, сиреневый акцент
   #a8a5f2, заголовки — Rubik, текст — Manrope; границы полей — как в пакете
   (контрастная, #a39bbd). Тяжёлых теней нет.
   ========================================================================== */

/* --- типографика --- */
.onb { color: #262626; }
.onb h1, .onb h2, .onb p { margin: 0; overflow-wrap: anywhere; }
.onb-title { font: 700 clamp(23px, 5.8vw, 28px) / 1.2 'Rubik', sans-serif; letter-spacing: -.3px; color: #262626; margin-bottom: 6px; }
.onb-subtitle { font: 700 18px / 1.25 'Rubik', sans-serif; color: #262626; }
.onb-muted { font-size: 15px; line-height: 1.45; color: rgba(38,38,38,0.7); }
.onb-lead { margin-bottom: 16px; }
.onb-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 12px; color: rgba(38,38,38,0.6); font-size: 13px; }
.onb-hint { font-size: 13px; line-height: 1.4; color: rgba(38,38,38,0.6); }
.onb-hint--center { text-align: center; }

/* --- раскладка --- */
.onb-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; width: 100%; max-width: 340px; margin: 0 auto; }
#screen-time-filter > :is(h2, .onb-lead), #familyContent > h2 { text-align: center; }
.screen > .family-entry:not([hidden]) { display: block; margin: 12px auto; }
.onb-stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.onb-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.onb-between { justify-content: space-between; }
.onb-card { display: flex; flex-direction: column; gap: 12px; min-width: 0; background: #fff; border: 1px solid rgba(168,165,242,0.3); border-radius: 24px; padding: 16px; box-shadow: 0 4px 16px rgba(61,43,110,0.055); margin-bottom: 16px; }
.onb-card p { font-size: 15px; line-height: 1.5; color: #494949; }
.onb-card--center { text-align: center; }
.onb-price-row { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.onb-price { font: 600 24px / 1.15 'Rubik', sans-serif; color: #7b78d9; overflow-wrap: anywhere; }
.onb-price--text { font-size: 16px; color: #262626; }
.onb-price-row small { font-size: 13px; font-weight: 600; color: rgba(38,38,38,0.6); }
.onb-rule { border: 0; border-top: 1px solid rgba(168,165,242,0.3); margin: 0; width: 100%; }
.onb-status { display: inline-flex; align-items: center; gap: 6px; background: #eee9fa; color: #5551b9; border-radius: 999px; padding: 5px 9px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.onb-status i { display: inline-block; flex: none; width: 7px; height: 7px; background: currentColor; border-radius: 50%; }

/* --- кнопки: без тени, цель нажатия ≥44px --- */
.onb-button { display: flex; align-items: center; justify-content: center; width: 100%; gap: 8px; min-height: 46px; padding: 12px 16px; border: 1px solid transparent; border-radius: 999px; background: #a8a5f2; color: #262626; font: 600 15px / 1.3 'Rubik', sans-serif; text-align: center; text-decoration: none; cursor: pointer; overflow-wrap: anywhere; white-space: normal; -webkit-tap-highlight-color: transparent; }
.onb-button:hover { background: #9692ea; }
.onb-button:active:not(:disabled) { filter: brightness(.96); }
.onb-button:disabled { opacity: .45; cursor: not-allowed; }
.onb-button--secondary { background: transparent; border: 1.5px solid #a39bbd; }
.onb-button--secondary:hover { background: rgba(168,165,242,0.12); }

/* --- иллюстрации комплекта: прозрачный рисунок прямо на фоне приложения —
       без подложек, рамок, кругов и теней; пропорции исходника сохранены --- */
/* The common box follows the visible height of the approved administrator scene.
   Each asset has a different amount of blank space around the drawing. */
.screen-illustration, #screen-family .family-portrait {
    --scene-height: 128px;
    --scene-height: clamp(110px, 19svh, 128px);
    display: block;
    width: min(100%, calc(var(--scene-height) * var(--scene-aspect)));
    height: var(--scene-height);
    margin-inline: auto;
    object-fit: cover;
    object-position: center var(--scene-y);
    background: transparent;
    flex-shrink: 0;
    pointer-events: none;
    user-select: none;
}
.screen-illustration--s01 { --scene-aspect: 1.3196; --scene-y: 44.1%; }
.screen-illustration--s03 { --scene-aspect: 1.0751; --scene-y: 53.2%; }
.screen-illustration--s04 { --scene-aspect: 1.0532; --scene-y: 32.4%; }
.screen-illustration--s05 { --scene-aspect: 1.3318; --scene-y: 45.5%; }
.screen-illustration--s06 { --scene-aspect: 1.0144; --scene-y: 57.8%; }
.screen-illustration--s07 { --scene-aspect: 1.3716; --scene-y: 70.9%; }
.screen-illustration--s08 { --scene-aspect: 1.3736; --scene-y: 50.0%; }
#screen-family .family-portrait { --scene-aspect: 1.8689; --scene-y: 59.4%; }
/* на всех экранах с картинкой она стоит ПЕРВОЙ — над заголовком, затем текст
   (правка автора 2026-11-26: «вообще всегда должна быть картинка сверху, а потом
   текст»); на экранах-«героях» (приветствие, заявка принята, ожидание) картинка
   и так первая внутри .onb-hero */
.onb > .screen-illustration:first-child { margin-bottom: 12px; }

/* --- S01 «Приветствие» (пакет UX v2.6): заголовок, текст, строка формата, CTA и
       подпись — с умеренными промежутками, композиция по центру высоты --- */
.onb-s01 .onb-hero { gap: 14px; }
.onb-s01 .onb-muted { font-size: 16px; }
.onb-s01 .onb-meta { font-size: 15px; }
.onb-s01 .onb-button { min-height: 48px; font-size: 17px; }
.onb-s01 .onb-hint { font-size: 15px; }

/* --- S03 «Выберите формат консультации» — локальные стили экрана (пакет UX v2.6;
       токены — тема приложения). Действует только внутри .onb-s03. Экран должен
       показать обе карточки целиком на 390×844 (цель пакета), а в полном экране
       Telegram на это уходят ещё insets телефона (сверху ~47–59, снизу 34 px),
       которых в макете не было: поэтому отступы здесь близко к нижнему краю
       диапазонов пакета (паддинг карточек 12–14, между ними 10–12 — ужаты до 10 и
       8), шрифты — как в пакете, не мельче. --- */
.onb-s03, .onb-s04 { margin-top: -10px; }
.onb-s03 .onb-title { text-align: center; margin-bottom: 2px; }
.onb-s03 .screen-illustration--s03 { margin-bottom: 6px; }
/* строка формата: «Видеовстреча · N минут» */
.onb-format { margin-bottom: 10px; font-size: 15px; line-height: 1.4; color: rgba(38,38,38,0.7); text-align: center; }
/* два формата — переключатели: тап в любом месте карточки выбирает её (невидимый
   радио-инпут лежит поверх карточки, её содержимое не перехватывает касания);
   выбранный вариант — сиреневая заливка, сиреневая рамка и заполненный кружок */
.onb-picks { display: flex; flex-direction: column; gap: 8px; }
.onb-pick {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    padding: 11px 14px;
    border: 1px solid #ded8f2;
    border-radius: 20px;
    background: #fff;
    transition: background-color .15s ease, border-color .15s ease;
}
.onb-pick * { pointer-events: none; }
.onb-pick.selected { background: #eeeafc; border-color: #a8a5f2; }
.onb-pick-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    opacity: 0;
    -webkit-appearance: none;
    appearance: none;
    pointer-events: auto;
    cursor: pointer;
}
/* контур фокуса — вокруг карточки (клавиатура); после тапа его нет */
.onb-pick:has(.onb-pick-input:focus-visible) { outline: 3px solid #6252b4; outline-offset: 3px; }
.onb-pick-head { display: flex; align-items: center; gap: 12px; }
.onb-pick-name { font: 700 18px / 1.25 'Rubik', sans-serif; color: #262626; }
.onb h3 { margin: 0; overflow-wrap: anywhere; }
.onb-pick-radio {
    position: relative;
    flex: none;
    box-sizing: border-box;
    width: 22px;
    height: 22px;
    border: 2px solid rgba(38,38,38,0.28);
    border-radius: 50%;
    background: #fff;
}
.onb-pick.selected .onb-pick-radio { border-color: #8a86e4; }
.onb-pick.selected .onb-pick-radio::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #5533a6;
}
.onb-pick .onb-price-row[hidden] { display: none; }
.onb-pick .onb-price { font-size: 23px; font-weight: 700; color: #6153a6; }
.onb-pick .onb-price-row small { font-size: 15px; }
.onb-pick-text { margin: 0; color: rgba(38,38,38,0.75); font-size: 14px; line-height: 1.35; }
.onb-pick-text + .onb-benefits { border-top: 1px solid rgba(38,38,38,0.12); padding-top: 7px; margin-top: 2px; }
.onb-pick.selected .onb-pick-text + .onb-benefits { border-top-color: rgba(85,81,185,0.24); }
.onb-benefits { list-style: none; padding: 0; margin: 0; display: grid; gap: 3px; font-size: 14px; line-height: 1.3; color: #262626; }
.onb-benefits li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 6px; align-items: start; }
.onb-benefits li::before { content: "✓"; color: #6153a6; font-weight: 700; }
/* пометка «заявка уже рассматривается» внутри карточки начинающего */
.onb-pick .result-message { margin-top: 6px; border-radius: 12px; }

/* --- S04 «С чем вам хотелось бы поработать?» (пакет UX v2.6): заголовок и
       пояснение по центру, карточка только с полем и двумя подсказками; действие —
       в нижней зоне приложения (#dockJunior) --- */
.onb-s04 .onb-title { text-align: center; margin-bottom: 8px; }
.onb-s04 .onb-lead { text-align: center; margin-bottom: 14px; }
.onb-s04 .onb-card { gap: 10px; padding: 16px 16px 18px; }
.onb-s04 .onb-label { font-size: 15px; }
.onb-s04 textarea.onb-input { min-height: 104px; padding: 13px 16px; border-radius: 18px; }
.onb-s04 .onb-hint { font-size: 14px; line-height: 1.4; color: rgba(38,38,38,0.7); }

/* --- S08 «Ожидание подбора» (пакет S08 v2.8): спокойное подтверждение статуса —
       сценка с картотекой, заголовок, пояснение и одна строка «Ваша заявка · Идёт
       подбор»; без категории, цены, формата и призыва закрыть приложение.
       Композиция — по центру области между шапкой и поддержкой: минимальная высота
       экрана = окно минус всё, что не экран (--chrome-h: отступ под шапку, поля
       контейнера и резерв под нижнюю зону — считает syncViewportChrome в booking).
       При нехватке высоты (маленький экран, крупный текст) контент прокручивается,
       поддержка остаётся внизу; без overflow:hidden --- */
.onb-s08.active, #screen-done.active { /* два класса: перекрыть «.screen.active { display: block }» приложения */
    display: flex; flex-direction: column; justify-content: center;
    min-height: calc(100vh - var(--chrome-h, 0px));
    min-height: calc(100dvh - var(--chrome-h, 0px));
}
/* блок лежит в полях контейнера — сверху 24 px, снизу 12 px до нижней зоны, — и его
   середина получается на 12 px ниже середины области между шапкой и поддержкой.
   Сдвигаем композицию на эти 12 px transform'ом: высоту страницы он не меняет, на
   маленьком экране без прокрутки остаётся без прокрутки (правка автора 2026-11-27:
   «расположение чуть выше, а то как смещено вниз слегка; поддержка — в самом низу») */
.onb-s08 .onb-hero { max-width: none; gap: 16px; transform: translateY(-12px); }
.onb-s08 .onb-title { margin-bottom: 0; font-size: clamp(24px, 6.6vw, 26px); letter-spacing: -.4px; }
.onb-s08 .onb-muted { font-size: 16px; line-height: 1.45; }
.onb-s08-status {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 8px 12px; box-sizing: border-box; width: 100%;
    padding: 16px; border: 1px solid #ded8f2; border-radius: 20px;
    background: #fff; text-align: left;
}
.onb-s08-label { font-size: 16px; font-weight: 600; color: #262626; }
.onb-s08 .onb-status { padding: 7px 11px; font-size: 14px; font-weight: 500; color: #6153a6; }
.onb-s08 #pendingSessions:not(:empty) { margin-top: 16px; } /* пустой блока нет — середина не сбивается */
@media (max-height: 720px) {
    .onb-s08 .onb-hero { gap: 12px; }
}

/* пояснение-подсказка внутри карточки остаётся мелким и приглушённым: без этой
   строки его перебивает правило основного текста карточки (.onb-card p) */
.onb-card .onb-hint { font-size: 13px; line-height: 1.4; color: rgba(38,38,38,0.6); }

/* --- поля --- */
.onb-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.onb .field-group { margin-bottom: 0; }
.onb-label { display: block; margin: 0; font: 600 14px / 1.3 'Manrope', sans-serif; color: #262626; }
.onb-label .opt { font-weight: 500; color: rgba(38,38,38,0.55); }
.onb-input { display: block; width: 100%; min-height: 46px; padding: 11px 14px; border: 1px solid #a39bbd; border-radius: 14px; background-color: #fffbf3; color: #262626; font: 400 16px / 1.3 'Manrope', sans-serif; outline: none; transition: none; }
.onb-input::placeholder { color: #a39fc9; opacity: 1; text-indent: 0; }
.onb-input:focus { border-color: #a8a5f2; background-color: #fff; box-shadow: none; }
.onb-input.invalid, .onb-input.invalid:focus { border-color: rgba(192,57,43,0.6); }
select.onb-input { padding-right: 44px; }
textarea.onb-input { min-height: 106px; resize: vertical; }
.onb-check { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 0; font: 500 15px / 1.3 'Manrope', sans-serif; color: #262626; cursor: pointer; }
.onb-check input { flex: none; width: 22px; height: 22px; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; accent-color: #6252b4; }
.onb-check.invalid { color: #c0392b; }
/* ссылки на документы: одинаковый отступ от текста до текста (правка автора
   2026-11-25 — «чуть ближе и на равном расстоянии»): интервал задаёт padding
   ссылки, а не min-height, поэтому двухстрочная ссылка не сбивает ритм */
.onb-links { display: flex; flex-direction: column; gap: 2px; }
.onb-link { display: block; padding: 9px 0; color: #5551b9; font-size: 14px; font-weight: 600; line-height: 1.35; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }

/* --- выбор части дня --- */
.onb-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.onb-option { min-height: 46px; padding: 8px 3px; background: #fffbf3; color: #262626; border: 1px solid #a39bbd; border-radius: 14px; font: 600 14px / 1.3 'Rubik', sans-serif; text-align: center; cursor: pointer; overflow-wrap: anywhere; -webkit-appearance: none; appearance: none; -webkit-tap-highlight-color: transparent; }
.onb-option small { display: block; font: 500 11px / 1.3 'Manrope', sans-serif; color: rgba(38,38,38,0.7); }
.onb-option[aria-pressed="true"] { background: #a8a5f2; border-color: #6252b4; }

/* --- S05 каталог (пакет UX v2.6): заголовок по центру; один специалист — карточка
       на всю ширину колонки; несколько — карусель с активной карточкой по центру
       (поля трека 7% ширины дают равные края и видные края соседей), стрелки и
       «N / M». Трек шире колонки — до краёв экрана. Вертикальная прокрутка страницы
       над ним не блокируется; горизонтальный жест не уводит назад в системе --- */
.onb-s05 .onb-title { text-align: center; margin-bottom: 4px; }
.onb-s05 .onb-lead { text-align: center; margin-bottom: 6px; }
.onb-carousel {
    display: flex; align-items: flex-start; gap: 10px;
    overflow-x: auto; scroll-snap-type: x mandatory;
    padding: 3px 7% 8px; margin: 0 -20px 2px;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
    overscroll-behavior-x: contain;
}
.onb-carousel::-webkit-scrollbar { display: none; }
.onb-psy-card { flex: 0 0 100%; scroll-snap-align: center; margin-bottom: 0; padding: 20px 18px 22px; border-radius: 28px; }
.onb-carousel[data-count="1"] { padding-left: 20px; padding-right: 20px; overflow: visible; scroll-snap-type: none; }
.onb-psy-top { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.onb-psy-name { font: 700 21px / 1.25 'Rubik', sans-serif; color: #262626; }
.onb-avatar { display: grid; place-items: center; width: 96px; height: 96px; overflow: hidden; border-radius: 50%; background: #eee9fa; color: #5551b9; font: 700 32px / 1 'Rubik', sans-serif; }
.onb-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.onb-psy-card > p { text-align: center; }
.onb-carousel-nav { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 2px 0 12px; }
.onb-carousel-nav[hidden] { display: none; }
.onb-carousel-btn { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #6153a6; font: 400 26px / 1 'Rubik', sans-serif; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.onb-carousel-btn:active:not(:disabled) { background: rgba(168,165,242,0.12); }
.onb-carousel-btn:disabled { opacity: .35; cursor: default; }
.onb-carousel-pos { min-width: 48px; text-align: center; font-size: 15px; line-height: 1.3; color: #262626; }
.onb-s05 .onb-button--secondary { min-height: 48px; font-size: 16px; }
.onb-s05 .onb-button--secondary[hidden] { display: none; }

/* --- сообщения о результате/состоянии внутри карточек --- */
.onb .result-message { margin-top: 0; border-radius: 14px; padding: 10px 14px; text-align: left; font-weight: 500; line-height: 1.4; }

/* --- фокус с клавиатуры — видимый; после тапа контура нет --- */
.onb :is(button, a, input, textarea, select):focus-visible { outline: 3px solid #6252b4; outline-offset: 3px; }
.onb :is(button, a, input, textarea, select):not(:focus-visible):focus { outline: none; }

@media (max-width: 340px) {
    .onb-card { padding: 12px; }
    .onb-options { gap: 5px; }
}
@media (prefers-reduced-motion: reduce) {
    .onb *, .onb *::before, .onb *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
