/* ─── BTG Design System — components ────────────────────────
   Shared component classes. Read-only — не редактируй
   под конкретный экран, используй обёртки в style.css.
   ──────────────────────────────────────────────────────────── */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--btg-font-ui);
  color: var(--btg-text);
  background: var(--btg-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overscroll-behavior-y: none;
}

/* ━━━━━━ TEXT ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.btg-display { font-size: var(--btg-fs-display); font-weight: var(--btg-fw-black); letter-spacing: -0.02em; line-height: 1.05; color: var(--btg-text); margin: 0; }
.btg-h1 { font-size: var(--btg-fs-h1); font-weight: var(--btg-fw-black); letter-spacing: -0.02em; line-height: 1.1; color: var(--btg-text); margin: 0; }
.btg-h2 { font-size: var(--btg-fs-h2); font-weight: var(--btg-fw-bold); letter-spacing: -0.015em; color: var(--btg-text); margin: 0; }
.btg-h3 { font-size: var(--btg-fs-h3); font-weight: var(--btg-fw-semibold); color: var(--btg-text); margin: 0; }
.btg-body { font-size: var(--btg-fs-body); font-weight: var(--btg-fw-regular); line-height: 1.45; color: var(--btg-text); }
.btg-small { font-size: var(--btg-fs-small); color: var(--btg-text-muted); }
.btg-caption { font-size: var(--btg-fs-caption); color: var(--btg-text-muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: var(--btg-fw-semibold); }
.btg-muted { color: var(--btg-text-muted); }
.btg-dim { color: var(--btg-text-dim); }
.btg-brand { font-family: var(--btg-font-brand); font-weight: var(--btg-fw-semibold); letter-spacing: -0.02em; }

/* ━━━━━━ BUTTONS ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.btg-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: var(--btg-r-md);
  font-family: inherit; font-size: var(--btg-fs-body); font-weight: var(--btg-fw-semibold);
  border: none; cursor: pointer;
  transition: background var(--btg-dur-base) var(--btg-ease), transform var(--btg-dur-fast) var(--btg-ease), opacity var(--btg-dur-base);
  min-height: 48px;
  color: var(--btg-text);
}
.btg-btn:active { transform: scale(0.98); }
.btg-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btg-btn-primary { background: var(--btg-primary); color: #fff; }
.btg-btn-primary:hover { background: var(--btg-primary-hover); }
.btg-btn-secondary { background: var(--btg-surface); color: var(--btg-text); }
.btg-btn-secondary:hover { background: var(--btg-surface-hover); }
.btg-btn-ghost { background: transparent; color: var(--btg-primary); }
.btg-btn-ghost:hover { background: var(--btg-primary-ghost); }
.btg-btn-danger { background: var(--btg-danger); color: #fff; }
.btg-btn-stars { background: linear-gradient(135deg, #F7B500, #FF9500); color: #1A0F00; }
.btg-btn-block { width: 100%; }
.btg-btn-sm { padding: 8px 14px; min-height: 36px; font-size: var(--btg-fs-small); border-radius: var(--btg-r-sm); }

/* ━━━━━━ SURFACES / CARDS ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.btg-card { background: var(--btg-surface); border-radius: var(--btg-r-md); padding: var(--btg-s-4); }
.btg-card-lg { background: var(--btg-surface); border-radius: var(--btg-r-lg); padding: var(--btg-s-5); }
.btg-surface-2 { background: var(--btg-surface-2); }

/* ━━━━━━ CHIP ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.btg-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; background: var(--btg-chip-bg);
  border-radius: var(--btg-r-pill); font-size: var(--btg-fs-small);
  color: var(--btg-text); font-weight: var(--btg-fw-medium);
  white-space: nowrap; cursor: pointer; border: none;
  font-family: inherit;
  transition: background var(--btg-dur-base);
}
.btg-chip:hover { background: var(--btg-surface-hover); }
.btg-chip-active { background: var(--btg-primary); color: #fff; }
.btg-chip-active:hover { background: var(--btg-primary-hover); }
.btg-chip-dot {
  width: 6px; height: 6px; border-radius: 50%; display: inline-block;
}

/* ━━━━━━ BADGE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.btg-badge {
  display: inline-flex; align-items: center; padding: 4px 10px;
  border-radius: var(--btg-r-pill); font-size: var(--btg-fs-caption);
  font-weight: var(--btg-fw-semibold); letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--btg-primary-soft); color: var(--btg-primary);
}
.btg-badge-success { background: rgba(16,185,129,.16); color: var(--btg-success); }
.btg-badge-danger { background: rgba(239,68,68,.16); color: var(--btg-danger); }
.btg-badge-muted { background: var(--btg-chip-bg); color: var(--btg-text-muted); }

/* ━━━━━━ ICON TILE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.btg-icon-tile {
  width: 40px; height: 40px; border-radius: var(--btg-r-sm);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.btg-icon-tile svg { width: 20px; height: 20px; stroke-width: 2; }
.btg-tile-primary { background: var(--btg-primary-soft); color: var(--btg-primary); }
.btg-tile-blue { background: rgba(59, 130, 246, 0.16); color: var(--btg-accent-blue); }
.btg-tile-red { background: rgba(239, 68, 68, 0.16); color: var(--btg-accent-red); }
.btg-tile-orange { background: rgba(245, 158, 11, 0.16); color: var(--btg-accent-orange); }
.btg-tile-green { background: rgba(16, 185, 129, 0.16); color: var(--btg-accent-green); }
.btg-tile-purple { background: rgba(168, 85, 247, 0.16); color: var(--btg-accent-purple); }

/* ━━━━━━ LIST ROW ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.btg-row {
  display: flex; align-items: center; gap: var(--btg-s-3);
  padding: var(--btg-s-3) var(--btg-s-4);
  background: var(--btg-surface); border-radius: var(--btg-r-md);
  cursor: pointer; transition: background var(--btg-dur-base);
  width: 100%; border: none; text-align: left;
  font-family: inherit; color: var(--btg-text);
}
.btg-row:hover { background: var(--btg-surface-hover); }
.btg-row-body { flex: 1; min-width: 0; }
.btg-row-title { font-size: var(--btg-fs-body); font-weight: var(--btg-fw-semibold); color: var(--btg-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btg-row-sub { font-size: var(--btg-fs-small); color: var(--btg-text-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btg-chevron { color: var(--btg-text-dim); flex-shrink: 0; width: 18px; height: 18px; }

/* ━━━━━━ INPUT ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.btg-input {
  width: 100%; padding: 14px 16px;
  background: var(--btg-surface); color: var(--btg-text);
  border: 1px solid var(--btg-border); border-radius: var(--btg-r-md);
  font-family: inherit; font-size: var(--btg-fs-body);
  transition: border-color var(--btg-dur-base), box-shadow var(--btg-dur-base);
}
.btg-input:focus { outline: none; border-color: var(--btg-primary); box-shadow: var(--btg-shadow-glow); }
.btg-input::placeholder { color: var(--btg-text-dim); }

.btg-search { position: relative; }
.btg-search .btg-search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--btg-text-muted); width: 18px; height: 18px; pointer-events: none; }
.btg-search .btg-input { padding-left: 44px; }

/* ━━━━━━ HERO ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.btg-hero {
  background: linear-gradient(135deg, var(--btg-primary) 0%, #6366F1 100%);
  border-radius: var(--btg-r-lg); padding: var(--btg-s-5);
  color: #fff; position: relative; overflow: hidden;
}
.btg-hero::after {
  content: ''; position: absolute; right: -40px; top: -40px;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
  pointer-events: none;
}
.btg-hero > * { position: relative; z-index: 1; }
.btg-hero-badge {
  display: inline-flex; padding: 5px 10px; background: rgba(255,255,255,0.22);
  border-radius: var(--btg-r-pill); font-size: 10px; font-weight: var(--btg-fw-bold);
  letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 12px;
}
.btg-hero-title { font-size: 22px; font-weight: var(--btg-fw-black); letter-spacing: -0.015em; line-height: 1.2; margin: 0 0 8px; }
.btg-hero-sub { font-size: 13px; opacity: 0.88; line-height: 1.4; }

/* Hero-success (для активной подписки) */
.btg-hero-success {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
}

/* ━━━━━━ STAT CARD ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.btg-stat {
  background: var(--btg-surface); border-radius: var(--btg-r-md); padding: 14px;
  display: flex; flex-direction: column; gap: 2px;
  position: relative; overflow: hidden; min-width: 0;
}
.btg-stat-icon { position: absolute; right: 10px; top: 10px; color: var(--btg-text-dim); width: 16px; height: 16px; }
.btg-stat-value { font-family: var(--btg-font-brand); font-size: 28px; font-weight: var(--btg-fw-bold); letter-spacing: -0.02em; line-height: 1; overflow: hidden; text-overflow: ellipsis; }
.btg-stat-label { font-size: 11px; color: var(--btg-text-muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: var(--btg-fw-semibold); margin-top: 4px; }
.btg-stat-primary .btg-stat-value { color: var(--btg-primary); }
.btg-stat-green .btg-stat-value { color: var(--btg-success); }
.btg-stat-neutral .btg-stat-value { color: var(--btg-text); }

/* ━━━━━━ EMPTY STATE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.btg-empty { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 40px 24px; text-align: center; }
.btg-empty-icon { width: 56px; height: 56px; color: var(--btg-text-dim); }
.btg-empty-title { font-size: 17px; font-weight: var(--btg-fw-bold); color: var(--btg-text); }
.btg-empty-sub { font-size: 14px; color: var(--btg-text-muted); max-width: 260px; line-height: 1.45; }

/* ━━━━━━ TARIFF CARD ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.btg-tariff {
  background: var(--btg-surface); border-radius: var(--btg-r-lg); padding: 18px;
  display: flex; flex-direction: column; gap: 8px;
  border: 1.5px solid var(--btg-border);
  cursor: pointer; transition: border-color var(--btg-dur-base), background var(--btg-dur-base);
  position: relative; width: 100%; text-align: left; font-family: inherit; color: var(--btg-text);
}
.btg-tariff:hover { border-color: var(--btg-border-strong); }
.btg-tariff-selected { border-color: var(--btg-primary); background: var(--btg-primary-ghost); }
.btg-tariff-popular::before {
  content: 'POPULAR'; position: absolute; top: -10px; right: 14px;
  padding: 4px 10px; font-size: 10px; font-weight: var(--btg-fw-bold);
  letter-spacing: 0.08em; background: var(--btg-primary); color: #fff;
  border-radius: var(--btg-r-pill);
}
.btg-tariff-duration { font-size: 13px; color: var(--btg-text-muted); font-weight: var(--btg-fw-medium); }
.btg-tariff-price { font-family: var(--btg-font-brand); font-size: 28px; font-weight: var(--btg-fw-bold); color: var(--btg-text); letter-spacing: -0.02em; line-height: 1; }
.btg-tariff-price .unit { font-size: 14px; color: var(--btg-text-muted); font-family: var(--btg-font-ui); margin-left: 4px; font-weight: var(--btg-fw-medium); }
.btg-tariff-save { font-size: 11px; color: var(--btg-success); font-weight: var(--btg-fw-bold); letter-spacing: 0.04em; text-transform: uppercase; }

/* ━━━━━━ AVATAR ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.btg-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--btg-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: var(--btg-fw-semibold);
  font-family: var(--btg-font-brand);
  flex-shrink: 0;
}
.btg-avatar-sm { width: 36px; height: 36px; font-size: 14px; }

/* ━━━━━━ SCREEN PRIMITIVES ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.btg-screen {
  background: var(--btg-bg);
  padding: calc(var(--btg-header-top-gap) + var(--btg-s-5)) var(--btg-screen-pad) calc(var(--btg-safe-bottom) + var(--btg-s-5));
  min-height: 100vh;
  max-width: var(--btg-maxw);
  margin: 0 auto;
}
.btg-section { margin-bottom: var(--btg-s-6); }
.btg-section:last-child { margin-bottom: 0; }
.btg-section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: var(--btg-s-3); padding: 0 4px; }
.btg-section-title { font-size: var(--btg-fs-h3); font-weight: var(--btg-fw-bold); color: var(--btg-text); }
.btg-section-link { color: var(--btg-primary); font-size: var(--btg-fs-small); font-weight: var(--btg-fw-semibold); cursor: pointer; }
.btg-group-label { font-size: var(--btg-fs-caption); color: var(--btg-text-muted); text-transform: uppercase; letter-spacing: 0.1em; font-weight: var(--btg-fw-semibold); margin: var(--btg-s-5) 4px var(--btg-s-2); }

/* Стек кнопок снизу */
.btg-stack { display: flex; flex-direction: column; gap: var(--btg-s-3); }

/* ━━━━━━ SHEET (выезжает снизу) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.btg-sheet-overlay {
  position: fixed; inset: 0; background: var(--btg-overlay);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 1000;
  opacity: 0; pointer-events: none;
  transition: opacity var(--btg-dur-base);
}
.btg-sheet-overlay.open { opacity: 1; pointer-events: auto; }
.btg-sheet {
  background: var(--btg-surface);
  border-radius: var(--btg-r-xl) var(--btg-r-xl) 0 0;
  padding: var(--btg-s-5) var(--btg-s-5) calc(var(--btg-safe-bottom) + var(--btg-s-5));
  width: 100%; max-width: var(--btg-maxw);
  transform: translateY(100%);
  transition: transform var(--btg-dur-slow) var(--btg-ease);
  box-shadow: var(--btg-shadow-lg);
}
.btg-sheet-overlay.open .btg-sheet { transform: translateY(0); }
.btg-sheet-handle {
  width: 40px; height: 4px; border-radius: 2px;
  background: var(--btg-text-dim); opacity: 0.5;
  margin: 0 auto var(--btg-s-4);
}

/* ━━━━━━ TOAST ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.btg-toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(var(--btg-safe-bottom) + 24px);
  max-width: calc(var(--btg-maxw) - 32px); margin: 0 auto;
  background: var(--btg-surface); color: var(--btg-text);
  border: 1px solid var(--btg-border);
  padding: 14px 18px; border-radius: var(--btg-r-md);
  font-size: var(--btg-fs-body); font-weight: var(--btg-fw-medium);
  box-shadow: var(--btg-shadow-lg);
  opacity: 0; transform: translateY(20px);
  transition: opacity var(--btg-dur-base), transform var(--btg-dur-base);
  pointer-events: none; z-index: 2000;
}
.btg-toast.visible { opacity: 1; transform: translateY(0); }
.btg-toast-success { border-left: 3px solid var(--btg-success); }
.btg-toast-error { border-left: 3px solid var(--btg-danger); }
