/* ═══════════════════════════════════════════════════════════════════════════
   Scale VPN Mini App — Neo-Minimalist Fintech UI
   Apple HIG · Soft Glassmorphism · Liquid Glass · лёгкий Claymorphism
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Токены ── */
:root {
  --r-xl: 34px;
  --r-lg: 28px;
  --r-md: 22px;
  --r-sm: 16px;

  --acc-1: #0990DE;               /* лазурный, глубже */
  --acc-2: #045FA6;               /* тёмно-голубой */
  --grad-acc: linear-gradient(160deg, #1FA9F0 0%, #0A8CD8 48%, #045A9E 100%);
  --grad-acc-soft: linear-gradient(135deg, rgba(9,144,222,.13), rgba(4,95,166,.13));

  --gold-grad: linear-gradient(135deg, #FFDF97 0%, #F7BE45 100%);
  --silver-grad: linear-gradient(135deg, #F0F3F9 0%, #C4CEDD 100%);
  --bronze-grad: linear-gradient(135deg, #F2C9A0 0%, #D99A5B 100%);

  --ok: #2EBD85;
  --warn: #F5A623;
  --bad: #F0506E;

  --bg: #F4F5FA;
  --surface: #FFFFFF;
  --surface-2: #F7F8FC;
  --text: #0C0E1A;
  --text-2: #6A7085;
  --text-3: #9AA0B4;
  --line: rgba(20, 28, 66, .07);

  --shadow-soft: 0 10px 34px rgba(24, 34, 84, .09), 0 2px 8px rgba(24, 34, 84, .05);
  --shadow-float: 0 18px 48px rgba(24, 34, 84, .16), 0 4px 12px rgba(24, 34, 84, .07);

  --glass-tint: rgba(255, 255, 255, .52);
  --glass-line: rgba(255, 255, 255, .65);
  --glass-hi: rgba(255, 255, 255, .8);

  --tabbar-h: 72px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* ── База ── */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: var(--tg-viewport-stable-height, 100vh);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  user-select: none;
  transition: background .35s ease, color .35s ease;
}

.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  width: 24px; height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; color: inherit; }

/* ── Фоновые сферы (то, что преломляет стекло) ── */
.orbs { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(46px);
  opacity: .55;
  animation: orb-float 26s ease-in-out infinite alternate;
}
.orb-1 { width: 380px; height: 380px; top: -120px; right: -110px; background: radial-gradient(circle at 35% 35%, #7CCEF8, #2FA7EC 60%, transparent 72%); }
.orb-2 { width: 300px; height: 300px; top: 34%; left: -140px; background: radial-gradient(circle at 40% 40%, #A8DFF9, #5FBBEF 60%, transparent 72%); animation-delay: -9s; }
.orb-3 { width: 340px; height: 340px; bottom: -140px; right: -60px; background: radial-gradient(circle at 40% 40%, #9BE3E0, #4BBDD0 60%, transparent 72%); animation-delay: -17s; }
@keyframes orb-float {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-34px, 30px, 0) scale(1.08); }
}
@media (prefers-reduced-motion: reduce) { .orb { animation: none; } }

/* ═══ LIQUID GLASS ═══
   База — премиальный glassmorphism (blur+saturate, блики, внутренние грани).
   На Chromium JS добавляет backdrop-filter: url(#lgf-N) — преломление кромок. */
.liquid-glass {
  position: relative;
  isolation: isolate;
  background: var(--glass-tint);
  -webkit-backdrop-filter: blur(22px) saturate(1.65);
  backdrop-filter: blur(22px) saturate(1.65);
  border-radius: var(--r-xl);
  box-shadow:
    inset 0 1px 1px var(--glass-hi),
    inset 0 -1px 1px rgba(255, 255, 255, .1),
    inset 1.5px 3px 8px -3px rgba(255, 255, 255, .55),
    inset -1.5px -3px 8px -3px rgba(255, 255, 255, .25),
    0 14px 38px rgba(22, 32, 80, .16);
}
/* Стеклянная кромка поверх преломления */
.liquid-glass::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--glass-line), rgba(255,255,255,.06) 40%, rgba(255,255,255,.02) 60%, var(--glass-line));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}
/* Скользящий блик */
.liquid-glass::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.18) 44%, rgba(255,255,255,.05) 52%, transparent 62%);
  pointer-events: none;
  z-index: 2;
}
/* ── Каркас ── */
#app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  min-height: var(--tg-viewport-stable-height, 100vh);
  display: flex;
  flex-direction: column;
}

/* ── Топбар ── */
.topbar {
  position: sticky;
  top: 10px;
  z-index: 40;
  margin: 10px 14px 4px;
  padding: 10px 12px 10px 14px;
  border-radius: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark {
  width: 42px; height: 42px;
  border-radius: 15px;
  display: grid; place-items: center;
  color: #fff;
  background: var(--grad-acc);
  box-shadow: 0 8px 18px rgba(10, 155, 220, .38), inset 0 1px 1.5px rgba(255,255,255,.55);
}
.brand-mark .icon { width: 22px; height: 22px; stroke-width: 2; }
.brand-text { display: flex; flex-direction: column; line-height: 1.22; }
.brand-text b { font-size: 16px; letter-spacing: -.2px; }
.brand-text span { font-size: 12.5px; color: var(--text-2); }
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: 16px; color: #fff;
  background: var(--grad-acc);
  box-shadow: 0 6px 16px rgba(10, 155, 220, .32), inset 0 1px 1.5px rgba(255,255,255,.5);
}

/* ── Экраны ── */
#view { flex: 1; padding: 14px 16px calc(var(--tabbar-h) + var(--safe-b) + 42px); }
.screen { display: flex; flex-direction: column; gap: 14px; animation: screen-in .32s cubic-bezier(.22,.9,.3,1); }
.screen[hidden] { display: none; }
@keyframes screen-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

.section-title {
  font-size: 14px; font-weight: 700;
  color: var(--text-2);
  letter-spacing: .2px;
  margin: 8px 4px 0;
  display: flex; align-items: center; gap: 7px;
}
.section-title .icon { width: 17px; height: 17px; stroke-width: 2; }

/* ── Карточки ── */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

/* Hero-карта тарифа (Apple Wallet-стиль) */
.hero-card {
  border-radius: var(--r-xl);
  padding: 20px;
  color: #fff;
  background: var(--grad-acc);
  box-shadow: 0 20px 44px rgba(5, 105, 170, .4), inset 0 1px 1.5px rgba(255,255,255,.45);
  position: relative;
  overflow: hidden;
}
.hero-card::before {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  top: -150px; right: -90px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,.34), rgba(255,255,255,.05) 62%, transparent 70%);
  filter: blur(2px);
}
.hero-card::after {
  content: '';
  position: absolute;
  width: 210px; height: 210px;
  bottom: -120px; left: -70px;
  border-radius: 50%;
  background: radial-gradient(circle at 60% 40%, rgba(255,255,255,.16), transparent 65%);
}
.hero-top { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.hero-plan { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15.5px; letter-spacing: -.1px; }
.hero-plan .icon { width: 19px; height: 19px; stroke-width: 2; }
.hero-days { position: relative; z-index: 1; margin-top: 20px; font-size: 40px; font-weight: 800; letter-spacing: -1.4px; line-height: 1; }
.hero-days small { font-size: 17px; font-weight: 600; letter-spacing: 0; opacity: .82; margin-left: 6px; }
.hero-sub { position: relative; z-index: 1; margin-top: 7px; font-size: 13.5px; opacity: .86; font-weight: 500; }
.hero-foot {
  position: relative; z-index: 1;
  margin-top: 18px; padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .22);
  display: flex; gap: 16px;
  font-size: 12.5px; font-weight: 600; opacity: .92;
}
.hero-foot span { display: flex; align-items: center; gap: 6px; }
.hero-foot .icon { width: 15px; height: 15px; stroke-width: 2.1; }
.hero-shield {
  position: absolute; right: 14px; bottom: -26px; z-index: 0;
  width: 120px; height: 120px;
  color: rgba(255, 255, 255, .13);
}
.hero-shield .icon { width: 100%; height: 100%; stroke-width: 1.1; }

/* Чипы */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px;
  border-radius: 100px;
  font-size: 12px; font-weight: 700;
  letter-spacing: .2px;
}
.chip .icon { width: 13px; height: 13px; stroke-width: 2.4; }
.chip-glass {
  color: #fff;
  background: rgba(255, 255, 255, .2);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.35);
}
.chip-ok   { color: var(--ok);   background: color-mix(in srgb, var(--ok) 13%, transparent); }
.chip-warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.chip-bad  { color: var(--bad);  background: color-mix(in srgb, var(--bad) 12%, transparent); }
.chip-acc  { color: var(--acc-1); background: color-mix(in srgb, var(--acc-1) 11%, transparent); }

/* Карточка тарифа «Трафик» */
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.plan-name { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15.5px; }
.plan-ico {
  width: 40px; height: 40px;
  border-radius: 14px;
  display: grid; place-items: center;
  color: var(--acc-1);
  background: var(--grad-acc-soft);
}
.plan-ico .icon { width: 21px; height: 21px; }
.plan-sub { font-size: 12.5px; color: var(--text-2); font-weight: 500; margin-top: 2px; }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 18px;
  border-radius: var(--r-sm);
  font-weight: 700; font-size: 14.5px;
  transition: transform .16s ease, box-shadow .2s ease, opacity .2s ease;
}
.btn:active { transform: scale(.965); }
.btn .icon { width: 18px; height: 18px; stroke-width: 2.1; }
.btn-primary {
  color: #fff;
  background: var(--grad-acc);
  box-shadow: 0 10px 24px rgba(10, 155, 220, .36), inset 0 1px 1.5px rgba(255,255,255,.45);
}
/* Стеклянная кнопка внутри hero-карты (на градиенте) */
.btn-hero {
  position: relative; z-index: 1;
  margin-top: 16px;
  color: #fff;
  background: rgba(255, 255, 255, .2);
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
  backdrop-filter: blur(10px) saturate(1.4);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.42), inset 0 -1px 1px rgba(255,255,255,.12), 0 6px 16px rgba(3, 56, 96, .18);
}
.btn-soft { color: var(--acc-1); background: color-mix(in srgb, var(--acc-1) 9%, transparent); }
.btn-ghost { color: var(--text-2); background: var(--surface-2); }
.btn-danger { color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.btn-block { width: 100%; }
.btn-sm { padding: 10px 14px; font-size: 13.5px; border-radius: 13px; }

.icon-btn {
  width: 42px; height: 42px; flex: none;
  border-radius: 14px;
  display: grid; place-items: center;
  color: var(--acc-1);
  background: color-mix(in srgb, var(--acc-1) 9%, transparent);
  transition: transform .16s ease;
}
.icon-btn:active { transform: scale(.92); }
.icon-btn .icon { width: 19px; height: 19px; stroke-width: 2; }

/* Ключ доступа */
.key-link {
  display: flex; align-items: center; gap: 10px;
  margin-top: 14px;
  padding: 12px 12px 12px 15px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  box-shadow: inset 0 1px 2px rgba(20,28,66,.05);
}
.key-link code {
  flex: 1; min-width: 0;
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.action-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 13px; }
.action-tile {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 13px 6px 11px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: 12px; font-weight: 650; color: var(--text-2);
  transition: transform .16s ease;
}
.action-tile:active { transform: scale(.95); }
.action-tile .icon { width: 21px; height: 21px; color: var(--acc-1); }

/* Широкая CTA-кнопка (Поддержка) */
.support-cta {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  text-align: left;
  padding: 16px 18px;
  transition: transform .16s ease;
}
.support-cta:active { transform: scale(.98); }
.cta-ico {
  width: 48px; height: 48px; flex: none;
  border-radius: 17px;
  display: grid; place-items: center;
  color: #fff;
  background: var(--grad-acc);
  box-shadow: 0 8px 18px rgba(7, 122, 192, .35), inset 0 1px 1.5px rgba(255,255,255,.45);
}
.cta-ico .icon { width: 23px; height: 23px; }
.cta-text { flex: 1; min-width: 0; }
.cta-text b { display: block; font-size: 15px; letter-spacing: -.15px; }
.cta-text span { font-size: 12.5px; color: var(--text-2); font-weight: 500; margin-top: 2px; display: block; }
.support-cta .chev { color: var(--text-3); width: 19px; height: 19px; }

/* Списки-строки */
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 4px;
}
.row + .row { border-top: 1px solid var(--line); }
.row-ico {
  width: 40px; height: 40px; flex: none;
  border-radius: 13px;
  display: grid; place-items: center;
  color: var(--acc-1);
  background: var(--grad-acc-soft);
}
.row-ico .icon { width: 20px; height: 20px; }
.row-main { flex: 1; min-width: 0; }
.row-main b { display: block; font-size: 14px; letter-spacing: -.1px; }
.row-main span { font-size: 12px; color: var(--text-3); font-weight: 500; }
.row-side { font-size: 13px; font-weight: 700; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.row-side .icon { width: 16px; height: 16px; color: var(--text-3); }
.row.selectable { border-radius: var(--r-sm); padding: 13px 10px; transition: background .15s ease; }
.row.selectable:active { background: var(--surface-2); }
.row.selected { background: color-mix(in srgb, var(--acc-1) 7%, transparent); }
.row.selected .row-ico { color: #fff; background: var(--grad-acc); box-shadow: 0 6px 14px rgba(10,155,220,.3); }

.radio-dot {
  width: 22px; height: 22px; flex: none;
  border-radius: 50%;
  border: 2px solid var(--text-3);
  display: grid; place-items: center;
  transition: all .18s ease;
}
.row.selected .radio-dot { border-color: var(--acc-1); background: var(--acc-1); box-shadow: 0 4px 10px rgba(10,155,220,.4); }
.radio-dot::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #fff; opacity: 0; transform: scale(.4); transition: all .18s ease; }
.row.selected .radio-dot::after { opacity: 1; transform: none; }

/* ── Лидерборд ── */
.lb-pos {
  width: 34px; height: 34px; flex: none;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 13.5px; font-weight: 800;
  color: var(--text-2);
  background: var(--surface-2);
}
.row.me { background: color-mix(in srgb, var(--acc-1) 8%, transparent); border-radius: var(--r-sm); padding: 13px 10px; }
.row.me .lb-pos { color: #fff; background: var(--grad-acc); box-shadow: 0 5px 12px rgba(7,122,192,.35); }

/* Переключатель периода (неделя / месяц / год / всё время) */
.seg {
  display: flex; gap: 4px;
  padding: 5px;
  background: var(--surface);
  border-radius: 100px;
  box-shadow: var(--shadow-soft);
}
.seg button {
  flex: 1;
  padding: 9px 2px;
  border-radius: 100px;
  font-size: 12.5px; font-weight: 700;
  color: var(--text-2);
  white-space: nowrap;
  transition: color .2s ease, background .2s ease, transform .15s ease;
}
.seg button:active { transform: scale(.95); }
.seg button.on {
  color: #fff;
  background: var(--grad-acc);
  box-shadow: 0 6px 14px rgba(7, 122, 192, .35), inset 0 1px 1px rgba(255,255,255,.35);
}

/* Подиум топ-3 */
.lb-podium {
  display: grid;
  grid-template-columns: 1fr 1.14fr 1fr;
  gap: 10px;
  align-items: end;
  margin-top: 36px; /* место под парящие медали и корону */
}
.pod {
  position: relative;
  text-align: center;
  background: var(--surface);
  border-radius: 22px;
  padding: 34px 6px 14px;
  box-shadow: var(--shadow-soft);
}
.pod-medal {
  position: absolute;
  top: -20px; left: 50%;
  transform: translateX(-50%);
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 16px; font-weight: 800;
  border: 2.5px solid var(--surface);
}
.pod.p1 { padding-top: 42px; padding-bottom: 18px; background: linear-gradient(180deg, rgba(255, 199, 84, .2), transparent 62%), var(--surface); }
.pod.p1 .pod-medal { width: 54px; height: 54px; top: -26px; font-size: 19px; color: #7A5200; background: var(--gold-grad); box-shadow: 0 10px 22px rgba(244, 178, 33, .45), inset 0 1px 2px rgba(255,255,255,.65); }
.pod.p2 { background: linear-gradient(180deg, rgba(148, 163, 190, .14), transparent 60%), var(--surface); }
.pod.p2 .pod-medal { color: #4E586B; background: var(--silver-grad); box-shadow: 0 8px 16px rgba(120, 136, 165, .35), inset 0 1px 2px rgba(255,255,255,.7); }
.pod.p3 { background: linear-gradient(180deg, rgba(212, 138, 66, .13), transparent 60%), var(--surface); }
.pod.p3 .pod-medal { color: #7B4315; background: var(--bronze-grad); box-shadow: 0 8px 16px rgba(196, 128, 62, .35), inset 0 1px 2px rgba(255,255,255,.55); }
.pod-crown {
  position: absolute;
  top: -48px; left: 50%;
  transform: translateX(-50%);
  color: #F2AE1C;
  filter: drop-shadow(0 4px 8px rgba(244, 178, 33, .45));
  animation: crown-float 3.2s ease-in-out infinite;
}
.pod-crown .icon { width: 24px; height: 24px; stroke-width: 2; fill: rgba(255, 213, 110, .45); }
@keyframes crown-float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(-3.5px); }
}
@media (prefers-reduced-motion: reduce) { .pod-crown { animation: none; } }
.pod-name {
  font-size: 13px; font-weight: 750; letter-spacing: -.1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 0 4px;
}
.pod.p1 .pod-name { font-size: 14px; }
.pod-count {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 4px;
  font-size: 12px; font-weight: 700;
  color: var(--text-2);
}
.pod-count .icon { width: 13px; height: 13px; stroke-width: 2.2; }
.pod-prize { margin-top: 8px; }
.chip-gold {
  color: #7A5200;
  background: var(--gold-grad);
  box-shadow: 0 4px 10px rgba(244, 178, 33, .3), inset 0 1px 1px rgba(255,255,255,.55);
}

/* Задания */
.task-card { display: flex; flex-direction: column; gap: 12px; }
.task-head { display: flex; align-items: flex-start; gap: 12px; }
.task-num {
  width: 42px; height: 42px; flex: none;
  border-radius: 14px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 16px;
  color: var(--acc-1);
  background: var(--grad-acc-soft);
}
.task-num.done { color: #fff; background: linear-gradient(135deg, #2EBD85, #1FA873); box-shadow: 0 6px 14px rgba(46,189,133,.35); }
.task-num.done .icon { width: 20px; height: 20px; stroke-width: 2.4; }
.task-title { font-size: 14.5px; font-weight: 700; letter-spacing: -.1px; line-height: 1.35; }
.task-reward { display: inline-flex; margin-top: 5px; }
.task-progress { display: flex; align-items: center; gap: 12px; }
.task-bar { flex: 1; height: 9px; border-radius: 100px; background: var(--surface-2); overflow: hidden; box-shadow: inset 0 1px 2px rgba(20,28,66,.06); }
.task-fill { height: 100%; border-radius: 100px; background: var(--grad-acc); transition: width .8s cubic-bezier(.22,.9,.3,1); }
.task-fill.done { background: linear-gradient(135deg, #2EBD85, #1FA873); }
.task-count { font-size: 12.5px; font-weight: 700; color: var(--text-2); white-space: nowrap; }

/* ── Таббар (liquid glass) ── */
.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--safe-b) + 12px);
  z-index: 60;
  width: min(calc(100% - 28px), 420px);
  height: var(--tabbar-h);
  border-radius: 36px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: stretch;
  padding: 8px;
}
.tab {
  position: relative;
  z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border-radius: 28px;
  color: var(--text-2);
  font-size: 11px; font-weight: 650; letter-spacing: .1px;
  transition: color .22s ease, transform .15s ease;
}
.tab:active { transform: scale(.94); }
.tab .icon { width: 23px; height: 23px; transition: transform .25s cubic-bezier(.34,1.56,.64,1); }
.tab.active { color: var(--acc-1); }
.tab.active .icon { transform: translateY(-1px) scale(1.06); stroke-width: 2.1; }

/* Капля жидкого стекла — индикатор активной вкладки. Не телепортируется,
   а перетекает: transform анимируется пружинной кривой, сама капля — линза
   (LiquidGlass.attach в app.js), преломляющая контент под таббаром. */
.tab-drop {
  position: absolute;
  top: 8px; left: 0;
  height: calc(100% - 16px);
  width: calc((100% - 16px) / 3);
  border-radius: 28px;
  z-index: 1;
  pointer-events: none;
  transition: transform .55s cubic-bezier(.3, 1.35, .35, 1), width .3s ease;
  background: rgba(255, 255, 255, .14);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, .55),
    inset 0 -1px 1px rgba(255, 255, 255, .14),
    0 6px 16px rgba(9, 148, 214, .16);
}
/* Фолбэк без displacement (iOS/WebKit): мягкая линза на blur */
.tab-drop.lg-static {
  background: var(--grad-acc-soft);
  -webkit-backdrop-filter: blur(4px) saturate(1.5);
  backdrop-filter: blur(4px) saturate(1.5);
}

/* ── Шторки (bottom sheets) ── */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(12, 15, 30, .4);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .3s ease;
}
.sheet-backdrop.show { opacity: 1; }

.sheet {
  position: fixed;
  left: 50%; transform: translate(-50%, 108%);
  bottom: calc(var(--safe-b) + 8px);
  z-index: 90;
  width: min(calc(100% - 16px), 464px);
  max-height: calc(var(--tg-viewport-stable-height, 100vh) - 60px);
  display: flex; flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-float);
  transition: transform .38s cubic-bezier(.22,.9,.28,1);
}
.sheet.open { transform: translate(-50%, 0); }
.sheet-grab { width: 40px; height: 4.5px; border-radius: 100px; background: var(--line); margin: 10px auto 0; flex: none; }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 18px 4px;
  flex: none;
}
.sheet-head h3 { font-size: 18px; font-weight: 800; letter-spacing: -.3px; }
.sheet-close { color: var(--text-3); background: var(--surface-2); width: 34px; height: 34px; border-radius: 50%; }
.sheet-close .icon { width: 15px; height: 15px; stroke-width: 2.3; }
.sheet-body { padding: 12px 18px calc(18px + var(--safe-b)); overflow-y: auto; overscroll-behavior: contain; }
.sheet-note { font-size: 12.5px; color: var(--text-3); line-height: 1.5; font-weight: 500; }

/* Выбор тарифа в шторке */
.plan-pick {
  display: flex; align-items: center; gap: 13px;
  width: 100%;
  padding: 16px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  text-align: left;
  margin-bottom: 11px;
  transition: transform .16s ease, box-shadow .2s ease;
}
.plan-pick:active { transform: scale(.97); }
.plan-pick .plan-ico { width: 46px; height: 46px; border-radius: 16px; }
.plan-pick b { font-size: 15px; display: block; letter-spacing: -.15px; }
.plan-pick span { font-size: 12px; color: var(--text-2); font-weight: 500; line-height: 1.4; display: block; margin-top: 2px; }
.plan-pick .icon.chev { color: var(--text-3); width: 18px; height: 18px; }

/* Инпуты */
.field { margin: 12px 0; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--text-2); margin: 0 4px 7px; }
.field input {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--r-sm);
  border: 1.5px solid transparent;
  background: var(--surface-2);
  font-size: 15px; font-weight: 600;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field input:focus { border-color: var(--acc-1); box-shadow: 0 0 0 4px color-mix(in srgb, var(--acc-1) 12%, transparent); }
.field input::placeholder { color: var(--text-3); font-weight: 500; }

/* Итог оплаты */
.total-line {
  display: flex; justify-content: space-between; align-items: center;
  padding: 15px 16px;
  border-radius: var(--r-sm);
  background: var(--grad-acc-soft);
  font-weight: 700; font-size: 14px;
  margin-top: 10px;
}
.total-line b { font-size: 19px; font-weight: 800; letter-spacing: -.4px; color: var(--acc-1); }

/* QR */
.qr-wrap {
  display: grid; place-items: center;
  margin: 12px auto;
  padding: 18px;
  width: fit-content;
  border-radius: var(--r-md);
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.qr-wrap img, .qr-wrap canvas { border-radius: 8px; display: block; }

/* Шаги инструкции */
.step-row { display: flex; gap: 13px; padding: 12px 0; }
.step-row + .step-row { border-top: 1px solid var(--line); }
.step-n {
  width: 30px; height: 30px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13.5px; font-weight: 800;
  color: var(--acc-1);
  background: var(--grad-acc-soft);
}
.step-row p { font-size: 13.5px; line-height: 1.5; color: var(--text-2); font-weight: 500; padding-top: 4px; }
.step-row p b { color: var(--text); }

/* Успех */
.success-box { text-align: center; padding: 12px 0 6px; }
.success-ico {
  width: 74px; height: 74px;
  margin: 6px auto 16px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #2EBD85, #1FA873);
  box-shadow: 0 14px 32px rgba(46,189,133,.38), inset 0 1px 2px rgba(255,255,255,.5);
  animation: pop-in .45s cubic-bezier(.34,1.56,.64,1);
}
.success-ico .icon { width: 34px; height: 34px; stroke-width: 2.4; }
@keyframes pop-in { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.success-box h4 { font-size: 18px; font-weight: 800; letter-spacing: -.3px; margin-bottom: 7px; }
.success-box p { font-size: 13.5px; color: var(--text-2); line-height: 1.55; font-weight: 500; }

/* Тост */
.toast {
  position: fixed;
  left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 30px);
  transform: translate(-50%, 16px);
  z-index: 120;
  padding: 12px 20px;
  border-radius: 100px;
  background: color-mix(in srgb, var(--text) 92%, transparent);
  color: var(--bg);
  font-size: 13.5px; font-weight: 700;
  box-shadow: var(--shadow-float);
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease, transform .28s cubic-bezier(.22,.9,.3,1);
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Кнопка-дублёр MainButton (только предпросмотр в браузере) */
.fallback-main {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 26px);
  z-index: 70;
  width: min(calc(100% - 32px), 416px);
  padding: 16px;
  border-radius: 19px;
  color: #fff;
  font-size: 15px; font-weight: 800; letter-spacing: -.1px;
  background: var(--grad-acc);
  box-shadow: 0 14px 34px rgba(10, 155, 220, .45), inset 0 1px 1.5px rgba(255,255,255,.5);
  transition: transform .16s ease;
}
.fallback-main:active { transform: translateX(-50%) scale(.97); }

/* Промо-баннер (создание промокода / пробный период) */
.banner {
  border-radius: var(--r-lg);
  padding: 17px;
  display: flex; align-items: center; gap: 13px;
  background: var(--grad-acc-soft);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.4), var(--shadow-soft);
  overflow: hidden;
  position: relative;
  text-align: left;
  width: 100%;
}
.banner-ico {
  width: 46px; height: 46px; flex: none;
  border-radius: 16px;
  display: grid; place-items: center;
  color: #fff;
  background: var(--grad-acc);
  box-shadow: 0 8px 18px rgba(10,155,220,.35), inset 0 1px 1.5px rgba(255,255,255,.5);
}
.banner-ico .icon { width: 22px; height: 22px; }
.banner b { font-size: 14px; display: block; letter-spacing: -.1px; }
.banner span { font-size: 12px; color: var(--text-2); font-weight: 500; display: block; margin-top: 2px; line-height: 1.4; }
.banner .icon.chev { color: var(--text-3); width: 18px; height: 18px; margin-left: auto; }

/* Хелперы */
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.muted { color: var(--text-3); font-size: 12px; font-weight: 500; }
.hidden { display: none !important; }
.stat-strip { display: flex; gap: 10px; }
.stat-box {
  flex: 1;
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 14px;
  box-shadow: var(--shadow-soft);
  text-align: center;
}
.stat-box b { font-size: 21px; font-weight: 800; letter-spacing: -.5px; display: block; }
.stat-box b em { font-style: normal; background: var(--grad-acc); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat-box span { font-size: 11.5px; color: var(--text-3); font-weight: 600; }
