:root{
  --bg: #0A0B0D;
  --surface: #101215;
  --surface-2: #16181C;
  --border: #232629;
  --border-soft: #1B1D21;
  --text: #E7E9EC;
  --text-muted: #7A7F87;
  --text-dim: #4B4F56;
  --accent: #3D8BFF;
  --accent-dim: #1F3E6B;
  --success: #3ED598;
  --danger: #FF5C5C;
  --radius: 4px;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: 'Manrope', system-ui, -apple-system, sans-serif;
}

*{ box-sizing: border-box; }

html, body{
  margin:0; padding:0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-tap-highlight-color: transparent;
}

body{
  min-height: 100vh;
  padding-bottom: 96px;
  position: relative;
}

@media (prefers-reduced-motion: no-preference){
  .scanlines{
    pointer-events:none;
    position: fixed; inset:0; z-index:0;
    background-image: repeating-linear-gradient(
      to bottom,
      rgba(255,255,255,0.012) 0px,
      rgba(255,255,255,0.012) 1px,
      transparent 1px,
      transparent 3px
    );
    mix-blend-mode: overlay;
  }
}

/* ---------- Topbar ---------- */
.topbar{
  position: sticky; top:0; z-index: 10;
  display:flex; align-items:center; justify-content:space-between;
  padding: 16px 18px;
  background: rgba(10,11,13,0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}

.brand{ display:flex; align-items:center; gap:8px; }
.brand__dot{
  width:8px; height:8px; border-radius:50%;
  background: var(--accent);
  box-shadow: 0 0 8px 1px rgba(61,139,255,0.6);
}
.brand__name{
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 14px;
}
.brand__accent{ color: var(--accent); }

.status-chip{
  display:flex; align-items:center; gap:6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 9px;
  text-transform: lowercase;
}
.status-chip__dot{
  width:6px; height:6px; border-radius:50%;
  background: var(--text-dim);
}
.status-chip[data-state="active"] .status-chip__dot{ background: var(--success); box-shadow:0 0 6px rgba(62,213,152,.7); }
.status-chip[data-state="inactive"] .status-chip__dot{ background: var(--danger); }

/* ---------- Layout ---------- */
.content{
  position: relative; z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: 18px 16px 8px;
}

/* ---------- Promo terminal (signature element) ---------- */
.promo-terminal{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 14px 12px;
  margin-bottom: 22px;
}
.promo-terminal__label{
  display:block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.promo-terminal__row{
  display:flex; align-items:center; gap:8px;
}
.promo-terminal__prompt{
  font-family: var(--mono);
  color: var(--accent);
  font-weight: 700;
}
.promo-terminal__input{
  flex:1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  caret-color: var(--accent);
}
.promo-terminal__input::placeholder{
  color: var(--text-dim);
  text-transform: none;
  letter-spacing: normal;
}
.promo-terminal__cursor{
  width: 7px; height: 15px;
  background: var(--accent);
  opacity: 0.85;
  animation: blink 1s step-end infinite;
  flex-shrink:0;
}
.promo-terminal__input:focus ~ .promo-terminal__cursor{ display:none; }
@keyframes blink{ 50%{ opacity:0; } }

.promo-terminal__log{
  font-family: var(--mono);
  font-size: 12px;
  margin-top: 8px;
  min-height: 14px;
  color: var(--text-muted);
}
.promo-terminal__log[data-state="ok"]{ color: var(--success); }
.promo-terminal__log[data-state="err"]{ color: var(--danger); }

/* ---------- Catalog ---------- */
.catalog__head{
  display:flex; align-items:baseline; justify-content:space-between;
  margin-bottom: 12px;
}
.catalog__title{
  font-size: 20px; font-weight: 800; margin:0;
  letter-spacing: -0.01em;
}
.catalog__count{
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
}

.catalog__grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.plan-card{
  position: relative;
  display:flex; align-items:center; justify-content:space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.plan-card:active{ transform: scale(0.995); }
.plan-card[data-selected="true"]{
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(61,139,255,0.08), rgba(61,139,255,0.02));
}
.plan-card__main{ display:flex; flex-direction:column; gap:4px; }
.plan-card__title{ font-weight: 700; font-size: 15px; }
.plan-card__desc{ font-size: 12px; color: var(--text-muted); }
.plan-card__side{ display:flex; flex-direction:column; align-items:flex-end; gap:4px; }
.plan-card__price{
  font-family: var(--mono);
  font-weight: 700;
  font-size: 17px;
}
.plan-card__price-old{
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  text-decoration: line-through;
}
.plan-card__radio{
  width: 16px; height:16px;
  border: 1px solid var(--border);
  border-radius: 50%;
  position: relative;
  flex-shrink:0;
}
.plan-card[data-selected="true"] .plan-card__radio{ border-color: var(--accent); }
.plan-card[data-selected="true"] .plan-card__radio::after{
  content:"";
  position:absolute; inset:3px;
  border-radius:50%;
  background: var(--accent);
}

.skeleton-card{
  height: 66px;
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
}
@keyframes shimmer{ 0%{ background-position: 200% 0; } 100%{ background-position: -200% 0; } }

/* ---------- Checkout bar ---------- */
.checkout-bar{
  position: fixed; left:0; right:0; bottom:0; z-index: 20;
  display:flex; align-items:center; justify-content:space-between;
  gap: 12px;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: rgba(16,18,21,0.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
}
.checkout-bar__label{ font-size: 12px; color: var(--text-muted); }
.checkout-bar__price{
  font-family: var(--mono);
  font-weight: 700;
  font-size: 18px;
}
.checkout-bar__btn{
  background: var(--accent);
  color: #06101F;
  border: none;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-weight: 800;
  font-size: 14px;
  padding: 13px 22px;
  cursor: pointer;
  transition: opacity .15s ease;
}
.checkout-bar__btn:disabled{ opacity: 0.4; cursor: default; }
.checkout-bar__btn:active:not(:disabled){ opacity: 0.8; }
