*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0D0D1A;
  --bg2: #13132A;
  --card: #1A1A30;
  --card2: #20203A;
  --purple: #6C63FF;
  --teal: #00D4AA;
  --text: #F0F0FF;
  --text2: rgba(240,240,255,.55);
  --border: rgba(255,255,255,.07);
  --radius: 18px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

#app { min-height: 100vh; display: flex; flex-direction: column; }

/* ── LOADER ── */
.loader {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 20px; z-index: 99;
  transition: opacity .4s;
}
.loader-shield {
  width: 80px; height: 80px;
  animation: pulse 1.6s ease-in-out infinite;
}
.loader p { color: var(--text2); font-size: 14px; }
@keyframes pulse {
  0%,100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: .8; }
}

/* ── HEADER ── */
.header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px;
  position: sticky; top: 0;
  background: var(--bg);
  z-index: 10;
}
.header-logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { width: 32px; height: 32px; }
.logo-text { font-size: 17px; font-weight: 700; letter-spacing: .5px; }
.sub-badge {
  background: rgba(0,212,170,.15);
  border: 1px solid rgba(0,212,170,.3);
  color: var(--teal);
  font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 20px;
}

/* ── SCREENS ── */
#content { flex: 1; display: flex; flex-direction: column; }
.screen {
  display: none;
  flex-direction: column;
  padding: 0 20px calc(24px + var(--safe-bottom));
  flex: 1;
  animation: fadeIn .25s ease;
}
.screen.active { display: flex; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.hidden { display: none !important; }

/* ── HERO ── */
.hero {
  display: flex; flex-direction: column;
  align-items: center; text-align: center;
  padding: 24px 0 28px;
}
.orb {
  width: 160px; height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(108,99,255,.18) 0%, transparent 70%);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 24px;
  position: relative;
}
.orb::before {
  content: '';
  position: absolute; inset: -20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(108,99,255,.08) 0%, transparent 70%);
  animation: breathe 3s ease-in-out infinite;
}
.orb.active::before {
  background: radial-gradient(circle, rgba(0,212,170,.15) 0%, transparent 70%);
}
@keyframes breathe {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}
.orb-inner {
  width: 120px; height: 120px;
  border-radius: 50%;
  background: var(--card);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 40px rgba(108,99,255,.3);
}
.orb.active .orb-inner { box-shadow: 0 0 40px rgba(0,212,170,.3); }
.hero-icon { width: 68px; height: 68px; }
.hero-title { font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.hero-sub { color: var(--text2); font-size: 14px; }

/* ── CARD ── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}
.card-row { display: flex; align-items: center; gap: 12px; }
.card-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.card-icon svg { width: 20px; height: 20px; }
.card-icon.green { background: rgba(0,212,170,.12); }
.card-icon.purple { background: rgba(108,99,255,.12); }
.card-text { flex: 1; min-width: 0; }
.card-title { font-size: 14px; font-weight: 600; }
.card-sub { font-size: 12px; color: var(--text2); margin-top: 2px; }
.card-badge-days {
  background: rgba(0,212,170,.15);
  color: var(--teal);
  font-size: 13px; font-weight: 700;
  padding: 4px 10px; border-radius: 20px;
  white-space: nowrap;
}
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.dot-online {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 8px var(--teal);
  flex-shrink: 0;
}

/* ── FEATURES ── */
.features {
  background: var(--card);
  border-radius: var(--radius);
  padding: 4px 16px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}
.feature {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.feature:last-child { border-bottom: none; }
.feature span:first-child { font-size: 20px; width: 28px; text-align: center; }

/* ── BUTTONS ── */
.actions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px 24px; border-radius: 14px;
  font-size: 15px; font-weight: 600;
  border: none; cursor: pointer;
  width: 100%; transition: all .2s;
  font-family: inherit;
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: scale(.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--purple), #5A52E0);
  color: white;
  box-shadow: 0 4px 20px rgba(108,99,255,.4);
}
.btn-primary:hover { box-shadow: 0 6px 28px rgba(108,99,255,.5); }
.btn-ghost {
  background: var(--card2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-xl { padding: 18px 24px; font-size: 16px; }

/* ── SCREEN HEADER ── */
.back-btn {
  display: flex; align-items: center; gap: 6px;
  background: none; border: none; color: var(--purple);
  font-size: 14px; font-weight: 600;
  cursor: pointer; padding: 4px 0;
  margin-bottom: 20px; font-family: inherit;
}
.back-btn svg { width: 18px; height: 18px; }
.screen-title { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.screen-sub { color: var(--text2); font-size: 13px; margin-bottom: 24px; }

/* ── PLANS ── */
.plans { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.plan-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: all .2s;
  position: relative;
  overflow: hidden;
}
.plan-card:active { transform: scale(.98); }
.plan-card.popular {
  border-color: var(--purple);
  background: linear-gradient(135deg, rgba(108,99,255,.1), rgba(108,99,255,.05));
}
.plan-card.popular::before {
  content: '🔥 Популярный';
  position: absolute; top: 0; right: 0;
  background: var(--purple);
  color: white; font-size: 11px; font-weight: 700;
  padding: 4px 12px;
  border-bottom-left-radius: 10px;
}
.plan-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.plan-name { font-size: 16px; font-weight: 700; }
.plan-badge {
  background: rgba(0,212,170,.15); color: var(--teal);
  font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 8px;
}
.plan-price { font-size: 28px; font-weight: 800; }
.plan-price span { font-size: 14px; font-weight: 500; color: var(--text2); }
.plan-per { font-size: 12px; color: var(--text2); margin-top: 2px; }
.plan-btn {
  margin-top: 14px;
  background: linear-gradient(135deg, var(--purple), #5A52E0);
  color: white; border: none;
  padding: 12px; border-radius: 10px;
  font-size: 14px; font-weight: 600;
  width: 100%; cursor: pointer; font-family: inherit;
  transition: opacity .2s;
}
.plan-btn:active { opacity: .85; }
.payment-note { text-align: center; color: var(--text2); font-size: 12px; margin-top: 8px; }

/* ── CONFIG ── */
.config-tabs {
  display: flex; gap: 8px; margin-bottom: 20px;
  background: var(--card); border-radius: 12px; padding: 4px;
}
.tab {
  flex: 1; padding: 9px 4px;
  background: none; border: none;
  color: var(--text2); font-size: 13px; font-weight: 600;
  border-radius: 9px; cursor: pointer; transition: all .2s;
  font-family: inherit;
}
.tab.active { background: var(--purple); color: white; }
.tab-content { display: none; flex-direction: column; align-items: center; gap: 16px; }
.tab-content.active { display: flex; }

.qr-wrapper {
  background: white; border-radius: 16px;
  padding: 16px; width: 220px; height: 220px;
  display: flex; align-items: center; justify-content: center;
}
.qr-wrapper img { width: 188px; height: 188px; }
.qr-loading { color: #333; font-size: 14px; }
.qr-hint { color: var(--text2); font-size: 13px; text-align: center; }

.file-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--card); border-radius: var(--radius);
  padding: 16px; width: 100%;
  border: 1px solid var(--border);
}
.file-icon { width: 48px; height: 48px; flex-shrink: 0; }
.file-name { font-size: 15px; font-weight: 600; }
.file-desc { font-size: 12px; color: var(--text2); margin-top: 2px; }

/* ── HOW TO ── */
.howto-steps { display: flex; flex-direction: column; gap: 16px; width: 100%; }
.step {
  display: flex; align-items: flex-start; gap: 14px;
  background: var(--card); border-radius: 14px;
  padding: 16px; border: 1px solid var(--border);
}
.step-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), #5A52E0);
  color: white; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.step-text { font-size: 14px; line-height: 1.5; }
.step-text a { color: var(--purple); text-decoration: none; }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: calc(20px + var(--safe-bottom)); left: 50%;
  transform: translateX(-50%);
  background: var(--card2); color: var(--text);
  padding: 12px 20px; border-radius: 12px;
  font-size: 14px; font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
  z-index: 50; white-space: nowrap;
  animation: toastIn .3s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
