@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500;700&display=swap');

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

:root {
  --red:        #b52b26;
  --red-light:  #d44440;
  --red-dark:   #7a1a17;
  --red-glow:   rgba(181,43,38,0.5);
  --red-10:     rgba(181,43,38,0.10);
  --red-20:     rgba(181,43,38,0.20);
  --red-40:     rgba(181,43,38,0.40);
  --red-border: rgba(181,43,38,0.6);
  --bg:         #060000;
  --bg2:        #040000;
  --card-bg:    rgba(20,0,0,0.5);
  --card-bg2:   rgba(10,0,0,0.55);
  --text:       #ffffff;
  --text-dim:   rgba(255,255,255,0.65);
  --text-muted: rgba(255,255,255,0.40);
  --pill:       50px;
  --radius:     18px;
  --glass-bg:   rgba(0,0,0,0.18);
  --glass-border: rgba(255,255,255,0.07);
  --red-btn:    #5d0808;
}

html, body { height: 100%; }

body {
  font-family: 'Rubik', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Background orbs ── */
.orb-wrap {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  overflow: hidden;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  will-change: filter;
  transform: translateZ(0);
  isolation: isolate;
}
.orb-1 {
  width: 70vw; height: 70vw;
  top: 15vh; left: 20vw;
  background: rgba(181,43,38,0.5);
  mix-blend-mode: plus-lighter;
}
.orb-2 {
  width: 120vw; height: 120vw;
  top: -10vh; left: -10vw;
  background: rgba(181,43,38,0.35);
  mix-blend-mode: plus-lighter;
  filter: blur(160px);
}
.orb-3 {
  width: 45vw; height: 25vh;
  top: -2vh; left: 25vw;
  background: rgba(255,255,255,0.35);
  mix-blend-mode: plus-lighter;
  filter: blur(80px);
  transform: rotate(29deg) translateZ(0);
}

/* ── Layout ── */
#app {
  position: relative; z-index: 1;
  max-width: 480px; margin: 0 auto;
  padding: 0 20px 40px;
  min-height: 100vh;
}

.screen { display: none; }
.screen.active { display: block; }

/* ── Top bar ── */
.top-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 0 22px;
}
.back-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 12px;
  color: var(--text);
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; cursor: pointer; flex-shrink: 0;
}
.back-btn:active { background: rgba(255,255,255,0.08); transform: scale(0.95); }
.top-title { font-size: 18px; font-weight: 500; }

/* ── Buttons ── */
.btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; border-radius: var(--pill);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--text);
  font-family: 'Rubik', sans-serif;
  font-size: 16px; font-weight: 300;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); background: rgba(255,255,255,0.06); }

.btn-lg { height: 56px; margin-bottom: 12px; }
.btn-sm { height: 38px; font-size: 14px; padding: 0 18px; width: auto; }
.btn-half { width: calc(50% - 6px); height: 56px; }

.btn-primary {
  background: var(--red-btn);
  border-color: transparent;
  color: #ffe8e8;
  font-weight: 400;
  box-shadow: 0 0 0 5px rgba(93,8,8,0.25);
}
.btn-primary:active {
  background: #3a0505;
  box-shadow: 0 0 0 3px rgba(93,8,8,0.2);
  transform: scale(0.97);
}
.btn-primary:disabled {
  background: rgba(60,5,5,0.35);
  border-color: transparent;
  color: rgba(255,255,255,0.25);
  box-shadow: none; cursor: not-allowed; transform: none;
}

.btn-row { display: flex; gap: 12px; margin-bottom: 12px; }

.icon-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 10px; color: var(--text-dim);
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
}
.icon-btn img { width: 16px; height: 16px; filter: brightness(0.7); }
.icon-btn:active { background: rgba(255,255,255,0.08); }
.icon-btn.danger { border-color: rgba(239,68,68,0.4); }
.icon-btn.danger img { filter: saturate(2) brightness(1.2); }

/* ── Card ── */
.card {
  background: linear-gradient(180deg, var(--card-bg), var(--card-bg2));
  border: 1px solid rgba(181,43,38,0.35);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
}

/* ── Labels ── */
.section-label {
  font-size: 11px; font-weight: 500; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text-muted);
  margin: 20px 0 10px;
}
.label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.hint { font-size: 12px; color: var(--text-muted); line-height: 1.5;
  text-align: center; margin: 6px 0 14px; }

/* ════════════ HOME ════════════ */
.home-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 0 18px;
}
.brand {
  font-size: 26px; font-weight: 700; letter-spacing: -0.5px;
  color: var(--text);
}
.sub-badge {
  display: flex; align-items: center; gap: 7px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 20px; padding: 6px 12px;
  font-size: 13px; font-weight: 300;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: #555; }
.dot.on  { background: #22c55e; box-shadow: 0 0 6px #22c55e80; }
.dot.off { background: #ef4444; }

.balance-card { margin-bottom: 18px; }
.balance-row { display: flex; justify-content: space-between; align-items: flex-start; }
.balance-amount { font-size: 30px; font-weight: 500; margin-top: 4px; }
.sub-info { text-align: right; }
.sub-date { font-size: 17px; font-weight: 400; margin-top: 4px; }

/* ── Home emblem ── */
.home-emblem {
  display: flex; justify-content: center; align-items: center;
  padding: 16px 0 24px;
}
.home-emblem img {
  width: 160px; height: 160px;
  object-fit: contain;
  filter: drop-shadow(0 0 24px rgba(181,43,38,0.35));
}

/* ════════════ BUY ════════════ */
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 8px; }
.plan-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 16px; padding: 18px 16px;
  cursor: pointer; position: relative;
  transition: all 0.2s;
}
.plan-card.sel {
  border-color: rgba(181,43,38,0.5);
  background: rgba(181,43,38,0.18);
  box-shadow: 0 0 0 1px rgba(181,43,38,0.2);
}
.plan-card:active { transform: scale(0.97); }
.plan-period { font-size: 14px; font-weight: 400; margin-bottom: 8px; color: var(--text-dim); }
.plan-price-tag { font-size: 20px; font-weight: 500; }
.plan-badge {
  position: absolute; top: 10px; right: 10px;
  background: var(--red-20); border: 1px solid var(--red-border);
  border-radius: 8px; font-size: 10px; font-weight: 500;
  padding: 2px 7px; color: var(--red-light);
}

.slider-card { padding: 18px 20px 14px; }
.slider-top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 14px; }
.slider-val { font-size: 32px; font-weight: 500; }
.slider-unit { font-size: 15px; color: var(--text-dim); }
.slider-extra { font-size: 13px; color: var(--red-light); margin-left: auto; }

input[type=range] {
  -webkit-appearance: none; width: 100%; height: 4px;
  border-radius: 2px; background: rgba(181,43,38,0.25); outline: none; margin-bottom: 8px;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%;
  background: var(--red); cursor: pointer;
  border: 2px solid rgba(255,255,255,0.15);
  box-shadow: 0 2px 10px rgba(181,43,38,0.5);
}
.slider-ticks { display: flex; justify-content: space-between;
  font-size: 11px; color: var(--text-muted); }

.promo-card { padding: 16px 18px; }
.promo-input {
  width: 100%; background: transparent; border: none;
  border-bottom: 1px solid rgba(181,43,38,0.35);
  color: var(--text); font-family: 'Rubik', sans-serif;
  font-size: 15px; padding: 4px 0 10px; outline: none;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.promo-input::placeholder { text-transform: none; color: var(--text-muted); letter-spacing: 0; }
.promo-st { font-size: 12px; margin-top: 6px; min-height: 16px; }
.promo-ok { color: #4ade80; }
.promo-err { color: #f87171; }

.total-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 2px 16px;
}
.total-lbl { font-size: 15px; color: var(--text-dim); font-weight: 300; }
.total-price { font-size: 24px; font-weight: 500; }

/* ════════════ INSTALL ════════════ */
.i-step { display: none; }
.i-step.active { display: block; }

.detected-card { text-align: center; padding: 28px; }
.detected-lbl { font-size: 11px; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 1px; margin-bottom: 10px; }
.detected-os { font-size: 26px; font-weight: 500; }

.os-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.os-btn {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 16px; color: var(--text);
  font-family: 'Rubik', sans-serif; font-size: 15px; font-weight: 400;
  padding: 18px; cursor: pointer; transition: all 0.2s;
}
.os-btn:active { background: rgba(255,255,255,0.08); transform: scale(0.97); }

.app-toggle {
  display: flex;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--pill); padding: 4px; gap: 4px; margin-bottom: 14px;
}
.toggle-btn {
  flex: 1; padding: 10px; border-radius: var(--pill); border: none;
  background: transparent; color: var(--text-muted);
  font-family: 'Rubik', sans-serif; font-size: 14px; font-weight: 400; cursor: pointer;
  transition: all 0.2s;
}
.toggle-btn.on {
  background: var(--red-btn); color: #ffe8e8; font-weight: 400;
  box-shadow: 0 0 0 2px rgba(93,8,8,0.25);
}

.store-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; font-size: 14px; color: var(--text-dim);
  text-decoration: none; border-bottom: 1px solid rgba(181,43,38,0.15);
  font-weight: 300;
}
.store-link:last-child { border-bottom: none; }
.store-link:active { color: var(--red-light); }
.store-arr { font-size: 18px; color: var(--text-muted); }

.install-hint { font-size: 14px; color: var(--text-dim); line-height: 1.6; margin-bottom: 14px; font-weight: 300; }
.sub-url-box {
  display: flex; align-items: center; gap: 10px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--pill); padding: 12px 16px; margin-bottom: 4px;
}
.sub-url-text {
  font-family: monospace; font-size: 11px; color: var(--text-dim);
  word-break: break-all; flex: 1;
}

/* ════════════ PROFILE ════════════ */
.menu-list { display: flex; flex-direction: column; gap: 3px; }
.menu-item {
  display: flex; align-items: center; gap: 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 20px; padding: 18px 20px;
  color: var(--text); font-size: 15px; font-weight: 300;
  cursor: pointer; text-align: left; width: 100%;
  transition: background 0.15s; overflow: hidden;
}
.menu-item:active { background: rgba(255,255,255,0.06); }
.menu-icon { width: 24px; height: 24px; flex-shrink: 0; }
.menu-icon img { width: 100%; height: 100%; object-fit: contain; filter: hue-rotate(200deg) saturate(2); }
.menu-arrow { margin-left: auto; flex-shrink: 0; }
.menu-arrow img { width: 10px; height: auto; opacity: 0.4; filter: brightness(2); }

/* ════════════ REFERRAL ════════════ */
.ref-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.ref-stat { text-align: center; padding: 16px 8px; }
.ref-num { font-size: 22px; font-weight: 500; margin-bottom: 4px; }
.ref-lbl { font-size: 11px; color: var(--text-muted); }

.ref-link-card { display: flex; align-items: center; gap: 12px; padding: 14px 18px; }
.ref-url { font-size: 12px; font-family: monospace; color: var(--text-dim); flex: 1; word-break: break-all; }

.how-card { padding: 0; overflow: hidden; }
.how-item { padding: 18px 20px; }
.how-title { font-size: 15px; font-weight: 400; margin-bottom: 5px; }
.how-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; font-weight: 300; }
.how-div { height: 1px; background: rgba(181,43,38,0.15); }

/* ════════════ DEVICES ════════════ */
.device-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 18px; padding: 16px 18px; margin-bottom: 10px;
}
.device-info { flex: 1; min-width: 0; }
.device-name { font-size: 15px; font-weight: 400; margin-bottom: 4px; }
.device-url { font-size: 11px; color: var(--text-muted); font-family: monospace;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.device-acts { display: flex; gap: 8px; flex-shrink: 0; }

/* ════════════ LEGAL ════════════ */
.legal-text { padding: 4px 0 24px; line-height: 1.7; }
.legal-text h2 { font-size: 18px; font-weight: 500; margin: 24px 0 8px;
  padding-top: 4px; border-top: 1px solid rgba(181,43,38,0.2); }
.legal-text h2:first-child { border-top: none; margin-top: 0; }
.legal-text h3 { font-size: 14px; font-weight: 400; margin: 14px 0 6px; color: var(--text-dim); }
.legal-text p { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; font-weight: 300; }
.legal-text a { color: var(--red-light); text-decoration: none; }
.legal-date { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }

/* ── Utils ── */
.hidden { display: none !important; }
