/* ЛК подписчика RAZU (docs/05-user-portal.md). Mobile-first: основной путь —
   QR с ТВ на телефон. Брендинг оператора, монохром-иконки. */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --ink: #1a1d21;
    --muted: #6b7280;
    --faint: #9ca3af;
    --line: #e8eaed;
    --line-strong: #d9dce1;
    --bg: #fff;
    --bg-soft: #f7f8fa;
    --hover: #f0f1f4;
    --accent: #2563eb;
    --ok: #15803d;
    --warn: #b45309;
    --bad: #b91c1c;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
body { color: var(--ink); background: var(--bg-soft); font-size: 15px; -webkit-font-smoothing: antialiased; }

.topbar { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); }
/* содержимое шапки — в той же колонке, что контент (780px), а не по краям экрана */
.topbar-inner { max-width: 780px; margin: 0 auto; display: flex; align-items: center; gap: 8px; padding: 12px 18px; }
/* Страница оплаты уже колонкой (.pay-wrap — 460px): шапка равняется по ней,
   иначе логотип висит заметно левее карточки, за которую платят. */
.topbar-inner.narrow { max-width: 460px; }
.topbar .logo { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.topbar .logo img { height: 22px; filter: brightness(0); }
.topbar .logo .lk { font-size: 13px; color: var(--muted); border-left: 1px solid var(--line-strong); padding-left: 10px; }
.topbar .spacer { flex: 1; }
.topbar .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: #fff; cursor: pointer; text-decoration: none;
                  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }

/* Меню ЛК: переносится второй строкой (и на десктопе, и на мобильном),
   без горизонтальной перемотки — все пункты видны сразу. */
.tabs { position: sticky; top: 57px; z-index: 9; background: var(--bg-soft); display: flex; flex-wrap: wrap;
        gap: 6px; row-gap: 8px; padding: 12px 18px; max-width: 780px; margin: 0 auto; }
/* Меню внутри шапки — один блок, а не две полосы разного цвета: плитки читаются
   как продолжение хедера, липнет всё вместе (сама .topbar уже sticky). */
.topbar .tabs { position: static; background: transparent; padding-top: 0; z-index: auto; }
.topbar .topbar-inner { padding-bottom: 10px; }
.tab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-strong); background: #fff; border-radius: 999px;
       padding: 8px 14px; font-size: 14px; cursor: pointer; color: var(--muted); white-space: nowrap; font-family: inherit; }
.tab [data-i] { display: inline-flex; }
/* .tab бывает и ссылкой (шапка воронки), а не только кнопкой: браузерное
   подчёркивание ломало вид плитки. */
a.tab { text-decoration: none; }
.tab svg { width: 15px; height: 15px; }
.tab.active { background: var(--ink); color: #fff; border-color: var(--ink); font-weight: 600; }

.wrap { max-width: 780px; margin: 0 auto; padding: 8px 18px 60px; }
.section { display: none; }
.section.active { display: block; }
h2.title { font-size: 22px; font-weight: 600; margin: 12px 0 4px; }
.section .sub { color: var(--muted); margin-bottom: 18px; }

.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 16px; overflow: hidden; }
.card-h { padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 600; display: flex; align-items: center; gap: 9px; }
.card-h svg { width: 18px; height: 18px; color: var(--muted); }
.card-b { padding: 18px; }
.card-b.tight { padding: 0; }

.hero { background: linear-gradient(160deg, #eef2ff, #e0f2fe 55%, #d1fae5); border: none; }
.hero .card-b { padding: 22px; }
.plan-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.plan-name { font-size: 20px; font-weight: 700; }
.plan-price { font-size: 20px; font-weight: 700; }
.plan-meta { color: var(--muted); font-size: 14px; margin-top: 6px; }

.krow { display: flex; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.krow:last-child { border-bottom: none; }
.krow .kk { color: var(--muted); } .krow .vv { text-align: right; font-weight: 500; }

.big-balance { font-size: 34px; font-weight: 700; }
.mono { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px;
       border-radius: 11px; font-size: 15px; font-weight: 600; cursor: pointer; border: 1px solid var(--line-strong);
       background: #fff; color: var(--ink); font-family: inherit; text-decoration: none; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.primary:hover { background: #000; }
.btn.block { width: 100%; }
.btn.sm { height: 38px; padding: 0 14px; font-size: 14px; font-weight: 500; }
.btn.danger { color: var(--bad); border-color: #f0c9c9; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

.badge { font-size: 12px; padding: 3px 10px; border-radius: 999px; font-weight: 600; }
.b-active { background: #e7f6ec; color: var(--ok); }
.b-warn { background: #fdf0e0; color: var(--warn); }
.b-off { background: #fbe9e9; color: var(--bad); }

.list-row { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: none; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .name { font-weight: 500; }
.list-row .desc { color: var(--muted); font-size: 13px; margin-top: 2px; }
.list-row .amt { font-weight: 600; font-variant-numeric: tabular-nums; }
.list-row .amt.plus { color: var(--ok); } .list-row .amt.minus { color: var(--ink); }
.ico-box { width: 34px; height: 34px; border-radius: 9px; background: var(--bg-soft); border: 1px solid var(--line);
           display: flex; align-items: center; justify-content: center; color: var(--muted); flex-shrink: 0; }
.ico-box svg { width: 17px; height: 17px; }

.provider { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.provider:last-child { border-bottom: none; }
.provider .p-badge { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
                     border: 1px solid var(--line); font-weight: 700; font-size: 13px; flex-shrink: 0; }
.p-ya { background: #FC3F1D; color: #fff; border-color: #FC3F1D; }
.p-vk { background: #0077FF; color: #fff; border-color: #0077FF; font-size: 11px; }

.toggle { position: relative; display: inline-block; width: 44px; height: 26px; flex-shrink: 0; vertical-align: middle; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle .track { position: absolute; inset: 0; background: var(--line-strong); border-radius: 999px; transition: .15s; cursor: pointer; }
.toggle .track::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.toggle input:checked + .track { background: var(--ink); }
.toggle input:checked + .track::before { transform: translateX(18px); }

.field { width: 100%; height: 48px; border: 1px solid var(--line-strong); border-radius: 11px; padding: 0 14px;
         font-size: 15px; outline: none; font-family: inherit; }
.field:focus { border-color: var(--ink); }
textarea.field { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; }

/* Справочная: аккордеон тем с картинками */
.help-acc { background: #fff; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; overflow: hidden; }
.help-acc summary { display: flex; align-items: center; gap: 12px; padding: 13px 16px; cursor: pointer;
                    font-weight: 600; font-size: 14.5px; list-style: none; }
.help-acc summary::-webkit-details-marker { display: none; }
.help-acc .help-t { flex: 1; }
.help-acc .chev { color: var(--muted); font-size: 20px; line-height: 1; transition: transform .15s; }
.help-acc[open] .chev { transform: rotate(90deg); }
.help-body { padding: 0 16px 16px; border-top: 1px solid var(--line); }
.help-pic { display: flex; justify-content: center; padding: 18px 0 4px; color: var(--muted); }
.help-pic svg { width: 150px; height: 115px; }
.help-steps { margin: 10px 0 0 20px; padding: 0; font-size: 14px; line-height: 1.55; }
.help-steps li { margin-bottom: 6px; }
.help-steps li::marker { color: var(--muted); font-weight: 600; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); margin-top: 14px; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--ink); }

.geo { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 13px; }
.geo svg { width: 13px; height: 13px; }
.hint { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 11px; padding: 12px 15px; color: var(--muted); font-size: 13px; }
.this-device { font-size: 12px; color: var(--ok); font-weight: 600; }
.flag-region { font-size: 12px; color: var(--bad); font-weight: 600; }

/* --- Страница оплаты --- */
.pay-wrap { max-width: 460px; margin: 0 auto; padding: 20px 18px 60px; }
.pay-plan { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.pay-plan .pn { font-size: 20px; font-weight: 700; }
.pay-plan .pp { font-size: 20px; font-weight: 700; white-space: nowrap; }
.feat { display: flex; align-items: center; gap: 9px; padding: 7px 0; color: var(--muted); font-size: 14px; }
/* скидка на странице оплаты: размер выгоды + зачёркнутая прайсовая цена */
.badge-sale { background: #e8f6ee; color: #188544; font-weight: 700; font-size: 13px; padding: 3px 9px; border-radius: 999px; flex-shrink: 0; }
/* Строка скидки/промокода: в .feat место слева занимает галочка, у скидки её
   нет — поэтому выравниваем по той же сетке и не городим inline-отступы. */
.feat-sale { align-items: center; }
.feat-sale .sale-name { color: var(--muted); }
.price-was { opacity: .55; }
.feat svg { width: 16px; height: 16px; color: var(--ok); flex-shrink: 0; }
.opt { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line-strong);
       border-radius: 12px; cursor: pointer; margin-bottom: 10px; transition: border-color .12s, background .12s; }
.opt:hover { background: var(--bg-soft); }
.opt.sel { border-color: var(--ink); background: var(--bg-soft); }
.opt .radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-strong); flex-shrink: 0; position: relative; }
.opt.sel .radio { border-color: var(--ink); }
.opt.sel .radio::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--ink); }
.opt .grow { flex: 1; }
.opt .o-name { font-weight: 500; }
.opt .o-desc { color: var(--muted); font-size: 13px; margin-top: 2px; }
.opt.disabled { opacity: .55; cursor: not-allowed; }

/* Выбор платёжной системы плитками (шаг 1 оплаты): крупная марка партнёра,
   чтобы клиент узнавал её глазами, а не читал строку радиокнопки. */
.pay-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.pay-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    min-height: 128px; padding: 18px 14px; border: 1px solid var(--line-strong); border-radius: 14px;
    background: #fff; cursor: pointer; font-family: inherit; text-align: center;
    transition: border-color .12s, box-shadow .12s, transform .08s; }
.pay-tile:hover { border-color: var(--ink); box-shadow: 0 2px 14px rgba(0,0,0,.07); }
.pay-tile:active { transform: scale(.99); }
.pay-tile .pt-logo { display: inline-flex; align-items: center; justify-content: center;
    height: 40px; margin-bottom: 8px; }
.pay-tile .pt-logo svg { width: 30px; height: 30px; }
/* официальная марка партнёра: вписываем по высоте, пропорции не трогаем */
.pay-tile img.pt-img { height: 30px; width: auto; max-width: 100%; object-fit: contain; }
.pt-mark-sm { display: inline-flex; align-items: center; }
img.pt-mark-sm { height: 20px; width: auto; }
span.pt-mark-sm { font-weight: 750; font-size: 15px; }
/* где ассета нет — марка словом в фирменном цвете */
.pt-word { font-weight: 750; font-size: 22px; letter-spacing: -.5px; }
.pay-tile .pt-name { font-weight: 600; font-size: 14px; }
.pay-tile .pt-note { color: var(--muted); font-size: 12px; line-height: 1.35; }
/* Карточные сети — принимаем Visa/Mastercard (марки из их брендбуков) */
.pay-networks { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 10px; }
.pay-networks img { height: 22px; width: auto; opacity: .85; }

/* «← Другой способ» на шаге формы */
.link-btn { background: none; border: 0; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.link-btn:hover { color: var(--ink); }
.total { display: flex; justify-content: space-between; align-items: center; padding: 16px 0 4px; font-size: 17px; }
.total b { font-size: 20px; }
.fineprint { color: var(--faint); font-size: 12px; margin-top: 14px; line-height: 1.5; text-align: center; }
.whoami { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.whoami .avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; }
.success { text-align: center; padding: 30px 10px; }
.success .ok-circle { width: 64px; height: 64px; border-radius: 50%; background: #e7f6ec; color: var(--ok); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.success .ok-circle svg { width: 32px; height: 32px; }
.success h2 { font-size: 22px; font-weight: 600; margin-bottom: 6px; }
