/* Пульт в руках гостя: /r/{ключ}. Открывается по скану QR с большого экрана.

   ⚠ СТИЛЬ ЗДЕСЬ - ИЗ ПРИЛОЖЕНИЯ, А НЕ СВОЙ. Гость только что видел приложение на
   экране ресепшн, и пульт должен выглядеть его продолжением. Токены - css/theme.css
   (копия файла приложения), компоненты - те же, что на экране «Сервис»:
     .ah-top      - верхняя панель (DESIGN-SYSTEM.md, раздел 2);
     .asvc        - контейнер страницы с заголовком и сеткой;
     .asvc-tile--photo - плитка раздела: фото сверху, круглый значок на стыке,
                    название, подпись, стрелка в углу, чип состояния (раздел 8).
   ⚠ ПРАВИЛА НИЖЕ СНЯТЫ С src/css/app-hotel.css. Лендинг и приложение - разные
   сайты, общего каталога у них нет. Меняете компонент в приложении - перенесите
   и сюда, иначе пульт разойдётся с ним по виду. */

/* ⚠ СТРАНИЦА ЗАНИМАЕТ РОВНО ОКНО И НЕ ПРОКРУЧИВАЕТСЯ. Шесть плиток должны
   помещаться на любом телефоне, поэтому высоты не задаются числом: сетка делит
   остаток окна на три равных ряда, а фото в плитке забирает то, что осталось
   после названия и подписи. Проверено на 320x568, 375x667 и 390x844. */
body.remote {
    margin: 0;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--qr-bg);
    color: var(--qr-ink-2);
    font-family: var(--qr-font);
    -webkit-font-smoothing: antialiased;
    touch-action: manipulation;
}

/* Общая шапка и подвал сайта приходят из parts - пульту они не нужны. */
body.remote .header,
body.remote .nav-mobile,
body.remote footer { display: none; }

body.remote main { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* ── верхняя панель (как .ah-top в приложении) ── */

/* ⚠ ЛОГОТИП СЛЕВА, как в шапке сайта и приложения. */
.rc-top {
    flex: 0 0 auto;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 56px;
    padding: 0 16px;
    background: #faf9f7;
    box-shadow: 0 6px 26px rgba(45, 38, 30, .07);
}

.rc-top__logo {
    display: block;
    width: 118px;
    height: auto;
    /* логотип нарисован белым - на светлой панели выворачиваем его в тёмный */
    filter: invert(1);
    /* ⚠ font-size: 0 ОБЯЗАТЕЛЕН: пока картинка не пришла, браузер рисует в её
       коробке текст alt, и на загрузке вспыхивает слово «Rush delivery». */
    font-size: 0;
    color: transparent;
}

/* ── страница ── */

.rc {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    box-sizing: border-box;
    /* ⚠ Отступ снизу с запасом под системную полосу телефона: без него нижний ряд
       плиток упирался в индикатор. */
    padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
}

.rc__head { flex: 0 0 auto; }

.rc__head h1 {
    margin: 0;
    /* кегль плавает с шириной: на узком телефоне крупный заголовок съедал ряд плиток */
    font-size: clamp(20px, 6.4vw, 27px);
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--qr-ink);
    line-height: 1.05;
}

.rc__head p {
    margin: 6px 0 0;
    color: var(--qr-muted);
    font-size: clamp(12px, 3.6vw, 14px);
    line-height: 1.3;
}

.rc__grid {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* три равных ряда: шесть плиток делят остаток окна поровну */
    grid-template-rows: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

/* ── плитка раздела (.asvc-tile--photo из приложения) ── */
/* одна из плиток - ссылка <a>, а не <button>: у неё обычный переход, не команда */

/* flex-колонка, а не block: у <button> содержимое центрируется по вертикали
   средствами браузера, и растянутая в ряду плитка отодвигала фото от верха. */
.rc-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    text-align: left;
    font-family: inherit;
    cursor: pointer;
    background: var(--qr-surface);
    border: 0;
    border-radius: 20px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(60, 50, 40, .05);
    transition: transform .12s ease, box-shadow .15s;
    -webkit-tap-highlight-color: transparent;
    appearance: none;
    -webkit-appearance: none;
    text-decoration: none;
    min-height: 0;
}

.rc-tile:active { transform: scale(.975); }

/* ⚠ ФОТО ЗАБИРАЕТ ОСТАТОК ПЛИТКИ, а не фиксированную высоту: ряды на разных
   телефонах разной высоты, и фикс либо вылезал за окно, либо оставлял дыру.
   min-height держит фото узнаваемым на самых низких экранах. */
.rc-tile__photo {
    position: relative;
    display: block;
    width: 100%;
    flex: 1 1 auto;
    min-height: 44px;
    background: var(--qr-bg-2) center/cover no-repeat;
}

/* ⚠ ЗНАЧОК ПРИВЯЗАН К ВЕРХУ ТЕЛА, а не к низу фото. На появлении фото едет
   навстречу карточке, и значок внутри фото уезжал бы вместе с ним. */
.rc-tile__ic {
    position: absolute;
    top: -17px;
    left: 12px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(246, 239, 230, .9);
    color: var(--qr-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    box-shadow: 0 2px 8px rgba(60, 45, 25, .12);
}

.rc-tile__body { position: relative; flex: 0 0 auto; display: block; min-width: 0; padding: 22px 10px 11px; }

/* ⚠ НАЗВАНИЕ ВСЕГДА ЗАНИМАЕТ ДВЕ СТРОКИ, даже если слово одно. Иначе у плитки с
   коротким названием тело ниже, а фото выше, и в ряду фотографии оказываются
   разной высоты (заметил заказчик). Две строки - потолок и одновременно мерка. */
.rc-tile__name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(2 * 1.2em);
    font-size: 14.5px;
    font-weight: 800;
    color: var(--qr-ink);
    letter-spacing: -.01em;
    line-height: 1.2;
    padding-right: 24px;
}

/* ⚠ Поле справа держит подпись подальше от стрелки в углу: она абсолютная, места
   в потоке не занимает, и длинная подпись подходила к ней вплотную.
   ⚠ ДВЕ СТРОКИ И МНОГОТОЧИЕ. Без ограничения третья строка обрезалась коробкой
   плитки на полуслове - на 320x568 это было видно во всех шести.
   ⚠ Минимум тоже две строки - по той же причине, что у названия: тела плиток
   должны быть одинаковой высоты, иначе разъезжаются фотографии. */
.rc-tile__sub {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(2 * 1.25em);
    font-size: 11.5px;
    color: var(--qr-muted);
    margin-top: 5px;
    line-height: 1.25;
    padding-right: 26px;
}

/* ⚠ НА НИЗКИХ ЭКРАНАХ ПОДПИСЬ УБИРАЕМ СОВСЕМ. Шесть плиток должны поместиться без
   прокрутки, и на 568-667 точках подпись отнимала высоту у фото: оно схлопывалось
   до полоски, а сама подпись всё равно резалась. Название остаётся. */
@media (max-height: 720px) {
    .rc-tile__sub { display: none; }
    .rc-tile__body { padding: 20px 10px 10px; }
}

.rc-tile__chev {
    position: absolute;
    right: 12px;
    bottom: 13px;
    color: var(--qr-gold);
    font-size: 14px;
}

/* чип «сейчас на экране» - стоит НАВЕРХУ, на фото: снизу он наезжал бы на подпись */
.rc-tile__st {
    position: absolute;
    right: 10px;
    top: 10px;
    display: none;
    align-items: center;
    gap: 6px;
    width: max-content;
    background: rgba(255, 255, 255, .92);
    border-radius: 999px;
    padding: 5px 11px;
    font-size: 11px;
    font-weight: 700;
    color: var(--qr-gold-2);
    box-shadow: 0 2px 8px rgba(60, 45, 25, .12);
}

.rc-tile__st i { font-size: 9px; }

/* ⚠ СТРЕЛКА ОСТАЁТСЯ И У ВЫБРАННОЙ ПЛИТКИ. В приложении чип её заменяет, но здесь
   плитку нажимают по многу раз подряд, и пропавшая стрелка читалась как «у еды
   стрелки нет» (слово заказчика). Чип стоит на фото и стрелке не мешает. */
.rc-tile.is-on .rc-tile__st { display: inline-flex; }

/* ── подпись-ответ снизу ── */

.rc-note {
    position: fixed;
    left: 50%;
    bottom: calc(18px + env(safe-area-inset-bottom));
    transform: translateX(-50%) translateY(10px);
    z-index: 6;
    max-width: calc(100% - 32px);
    padding: 11px 18px;
    border-radius: var(--qr-r-pill);
    background: var(--qr-ink);
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--qr-mid) var(--qr-ease), transform var(--qr-mid) var(--qr-ease);
}

.rc-note.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }
.rc-note.is-bad { background: var(--qr-danger); }

/* ── ключ протух ── */

.rc-dead {
    max-width: 420px;
    margin: 18vh auto 0;
    padding: 0 24px;
    text-align: center;
}

.rc-dead__ic {
    width: 54px;
    height: 54px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--qr-gold-soft);
    color: var(--qr-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
}

.rc-dead p {
    margin: 0;
    color: var(--qr-muted);
    font-size: 14.5px;
    line-height: 1.45;
}


/* ---- появление плиток: то же движение, что у гостя в приложении ---- */

/* ⚠ ДВИЖЕНИЕ ОДНО НА ВЕСЬ ПРОДУКТ. Кадры и темп сняты с app-hotel.css (раздел
   «Появление списков»): карточка всплывает снизу, а фото внутри неё едет НАВСТРЕЧУ
   карточке - в этом весь эффект. Числа держим переменными, как там.
   ⚠ Только transform и opacity: всё остальное браузер считает на каждом кадре и
   на телефоне появление начинает дёргаться. */
.rc {
    --qap-dur: 1.8s;
    --qap-ease: cubic-bezier(.22, .9, .3, 1);
    --qap-d1: .04s; --qap-d2: .22s; --qap-d3: .4s;
    --qap-d4: .58s; --qap-d5: .76s; --qap-d6: .94s;
}

@media (prefers-reduced-motion: no-preference) {
    @keyframes rcCard  { from { opacity: 0; transform: translateY(34px); } to { opacity: 1; transform: none; } }
    @keyframes rcPhoto { from { transform: translateY(-26px) scale(1.14); } to { transform: none; } }
    @keyframes rcHead  { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

    .rc__head > * { animation: rcHead .9s var(--qap-ease) both; }
    .rc__head p { animation-delay: .1s; }

    /* ⚠ ДО ЗАГРУЗКИ ФОТОГРАФИЙ ПЛИТКИ НЕ ПОКАЗЫВАЕМ. Иначе въезжают серые коробки,
       а снимки проявляются уже в прилетевшей плитке - смазанно и дёшево.
       Страховка: не дождались за шесть секунд - проявляем как есть, пустого экрана
       быть не может. Снимает держатель js/remote.js. */
    @keyframes rcSafe { to { opacity: 1; } }
    .rc.is-hold .rc__grid > * { opacity: 0; animation: rcSafe 0s linear 6s forwards; }

    .rc.is-in .rc__grid > * { animation: rcCard var(--qap-dur) var(--qap-ease) both; animation-delay: var(--qap-d1); }
    .rc.is-in .rc__grid > * .rc-tile__photo { animation: rcPhoto var(--qap-dur) var(--qap-ease) both; animation-delay: var(--qap-d1); }

    .rc.is-in .rc__grid > :nth-child(2), .rc.is-in .rc__grid > :nth-child(2) .rc-tile__photo { animation-delay: var(--qap-d2); }
    .rc.is-in .rc__grid > :nth-child(3), .rc.is-in .rc__grid > :nth-child(3) .rc-tile__photo { animation-delay: var(--qap-d3); }
    .rc.is-in .rc__grid > :nth-child(4), .rc.is-in .rc__grid > :nth-child(4) .rc-tile__photo { animation-delay: var(--qap-d4); }
    .rc.is-in .rc__grid > :nth-child(5), .rc.is-in .rc__grid > :nth-child(5) .rc-tile__photo { animation-delay: var(--qap-d5); }
    .rc.is-in .rc__grid > :nth-child(6), .rc.is-in .rc__grid > :nth-child(6) .rc-tile__photo { animation-delay: var(--qap-d6); }
}

/* ===== шторка заказа ==============================================

   Два состояния в одной шторке: «заказ в пути» с обратным отсчётом, пока на
   большом экране идёт ролик, и «принесли» - портрет, оценка, чаевые.

   ⚠ ВИД ВЗЯТ С КОРЗИНЫ ПРИЛОЖЕНИЯ (DESIGN-SYSTEM.md, «Шторка оформления заказа»):
     полотно #faf9f7, радиус 24 сверху, хват 38x5, чипы чаевых 55/14, выбранный
     чип #f9f1e4 с золотой рамкой. Гость только что видел это приложение на экране
     ресепшн, своя вёрстка тут выглядела бы чужой.
   ⚠ ВЫСОТА НЕ ЗАДАНА ЧИСЛОМ. Содержимое меняется (появляются чаевые, потом
     «спасибо»), и шторка должна расти под него, а на маленьком экране - прокручиваться
     внутри себя, не растягивая страницу: у неё overflow:hidden. */

.rc-sheet { position: fixed; inset: 0; z-index: 60; }
.rc-sheet[hidden] { display: none; }

.rc-sheet__fade {
    position: absolute; inset: 0;
    background: rgba(18, 16, 14, .46);
    opacity: 0;
    transition: opacity .28s ease;
}
.rc-sheet.is-in .rc-sheet__fade { opacity: 1; }

.rc-sheet__box {
    position: absolute; left: 0; right: 0; bottom: 0;
    max-height: 92%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #faf9f7;
    border-radius: 24px 24px 0 0;
    padding: 12px 18px calc(20px + env(safe-area-inset-bottom));
    text-align: center;
    transform: translateY(102%);
    transition: transform .34s cubic-bezier(.22, .9, .3, 1);
}
.rc-sheet.is-in .rc-sheet__box { transform: translateY(0); }

.rc-sheet__grip {
    display: block; width: 38px; height: 5px; margin: 0 auto 10px;
    border-radius: 3px; background: #d5d1cb;
}
.rc-sheet__x {
    position: absolute; top: 14px; right: 16px;
    width: 35px; height: 35px; border: 0; padding: 0;
    border-radius: 50%; background: var(--qr-gold-soft);
    color: #4a4e58; font-size: 16px; line-height: 1; cursor: pointer;
}

.rc-sheet h2 { margin: 0 0 4px; font-size: 21px; font-weight: 800; color: var(--qr-ink); }
.rc-sheet p  { margin: 0; font-size: 13px; color: var(--qr-muted); }

/* ---- заказ в пути ---- */

.rc-wait { padding: 10px 0 6px; }
.rc-wait[hidden], .rc-done[hidden], .rc-tip[hidden], .rc-thanks[hidden] { display: none; }

.rc-wait__ring {
    width: 74px; height: 74px; margin: 0 auto 14px;
    border-radius: 50%;
    background: var(--qr-gold-soft);
    color: var(--qr-gold);
    font-size: 27px;
    display: flex; align-items: center; justify-content: center;
    position: relative;
}
/* ⚠ Бегущий ободок, а не вращение значка: значок внутри должен стоять ровно,
   крутящаяся сумка читается как ошибка загрузки. */
.rc-wait__ring::after {
    content: '';
    position: absolute; inset: -5px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--qr-gold);
    animation: rcSpin 1.1s linear infinite;
}
@keyframes rcSpin { to { transform: rotate(360deg); } }

.rc-wait__time {
    margin-top: 14px;
    font-size: 30px; font-weight: 800; color: var(--qr-gold);
    font-variant-numeric: tabular-nums;
}

/* ---- принесли ---- */

.rc-done { padding: 4px 0 2px; }

.rc-done__ava {
    width: 104px; height: 104px; margin: 0 auto 12px;
    border-radius: 50%; overflow: hidden;
    background: var(--qr-bg-2);
    box-shadow: 0 0 0 3px #fff, 0 6px 18px rgba(45, 38, 30, .16);
}
.rc-ava[hidden] { display: none; }
.rc-ava img { display: block; width: 100%; height: 100%; object-fit: cover; }

.rc-stars { display: flex; justify-content: center; gap: 6px; margin: 14px 0 6px; }
.rc-star {
    border: 0; padding: 4px; background: none; cursor: pointer;
    font-size: 29px; line-height: 1;
    color: #ddd7cd;
    transition: color .15s ease, transform .15s ease;
}
.rc-star.is-on { color: #e8a51c; }
.rc-star:active { transform: scale(.88); }

.rc-done__hint { font-size: 13px; color: var(--qr-muted); }

/* ---- чаевые ---- */

.rc-tip { margin-top: 18px; border-top: 1px solid var(--qr-line); padding-top: 16px; }
.rc-tip__ttl { font-size: 15px; font-weight: 700; color: var(--qr-ink-2); margin-bottom: 10px; }
.rc-tip__row { display: flex; gap: 8px; }
.rc-tip__chip {
    flex: 1 1 0; min-width: 0;
    height: 55px; border-radius: 14px;
    border: 1px solid var(--qr-line); background: #fff;
    font-size: 16px; font-weight: 800; color: var(--qr-ink-2);
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.rc-tip__chip.is-on { background: #f9f1e4; border-color: #c8922f; color: var(--qr-gold); }
.rc-tip__skip {
    margin-top: 12px; border: 0; background: none;
    font-size: 13.5px; color: var(--qr-muted); text-decoration: underline;
    cursor: pointer; padding: 6px 10px;
}

/* ---- спасибо ---- */

.rc-thanks { padding: 10px 0 4px; }
.rc-thanks__ic {
    width: 58px; height: 58px; margin: 0 auto 10px;
    border-radius: 50%; background: var(--qr-green-soft); color: var(--qr-green);
    font-size: 24px; display: flex; align-items: center; justify-content: center;
}
.rc-thanks p { font-size: 15px; font-weight: 700; color: var(--qr-ink-2); }

/* ⚠ НИЗКИЕ ЭКРАНЫ. На 320x568 шторка с чаевыми упиралась в верх окна, поэтому
   поджимаем отступы и размеры - так же, как у плиток скрывается подпись. */
@media (max-height: 640px) {
    .rc-wait__ring { width: 60px; height: 60px; font-size: 22px; margin-bottom: 10px; }
    .rc-wait__time { font-size: 25px; margin-top: 10px; }
    .rc-done__ava  { width: 84px; height: 84px; }
    .rc-star       { font-size: 25px; }
    .rc-tip        { margin-top: 12px; padding-top: 12px; }
}

/* ===== шторка «Связаться»: заявка с телефона (05.10.2026) =====
   Каркас - та же шторка, что у заказа (.rc-sheet). Поля - как в приложении: светлое
   поле с рамкой, радиус 14, шрифт 16px (меньше - iPhone увеличивает страницу при фокусе). */
.rc-form[hidden], .rc-form__ok[hidden], .rc-form__err[hidden] { display: none; }
.rc-form { display: flex; flex-direction: column; gap: 12px; padding: 6px 0 2px; text-align: left; }
.rc-form h2, .rc-form > p { text-align: center; }
.rc-form > p { margin-bottom: 4px; }
.rc-form__ic {
    width: 58px; height: 58px; margin: 0 auto 2px;
    border-radius: 50%; background: var(--qr-gold-soft); color: var(--qr-gold);
    font-size: 22px; display: flex; align-items: center; justify-content: center;
}
.rc-form__trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.rc-field { display: flex; flex-direction: column; gap: 6px; }
.rc-agree { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; font-weight: 500; line-height: 1.45; color: var(--qr-muted); text-align: left; cursor: pointer; }
.rc-agree input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: #c8922f; cursor: pointer; }
.rc-agree a { color: #c8922f; text-decoration: underline; }
.rc-agree.is-bad { color: var(--qr-danger); }
.rc-field > span { font-size: 13px; font-weight: 700; color: var(--qr-ink-2); }
.rc-field > span i { font-style: normal; font-weight: 500; color: var(--qr-muted); }
.rc-field input, .rc-field textarea {
    width: 100%; box-sizing: border-box; min-height: 50px;
    padding: 13px 14px; border: 1px solid var(--qr-line); border-radius: 14px;
    background: #fff; color: var(--qr-ink); font: inherit; font-size: 16px; line-height: 1.4;
    outline: none; -webkit-appearance: none; appearance: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.rc-field textarea { min-height: 76px; resize: none; overflow: hidden; }
.rc-field input::placeholder, .rc-field textarea::placeholder { color: #a5a29c; }
.rc-field input:focus, .rc-field textarea:focus { border-color: #c8922f; box-shadow: 0 0 0 3px rgba(200, 146, 47, .14); }
.rc-field.is-bad input, .rc-field.is-bad textarea { border-color: var(--qr-danger); }
.rc-sheet .rc-form__err { margin: 0; font-size: 13px; font-weight: 600; color: var(--qr-danger); text-align: center; } /* вес .rc-sheet: общее «.rc-sheet p» красило её серым */
.rc-form__go {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    height: 54px; margin-top: 4px; border: 0; border-radius: 999px;
    background: var(--qr-gold); color: #fff; font: inherit; font-size: 16px; font-weight: 800;
    box-shadow: 0 10px 24px rgba(154, 109, 57, .28); cursor: pointer;
}
.rc-form__go:disabled { opacity: .7; }
.rc-form__go:active { transform: scale(.98); }
.rc-form__ok p { font-size: 16px; }
