/* Mobix Store — мини-приложение. Цвета и размеры сняты с макетов из tz/ */
:root {
  --bg: #06050b;
  --card: rgba(36, 33, 52, 0.72);
  --card-hover: rgba(52, 46, 78, 0.85);
  --card-border: rgba(255, 255, 255, 0.06);
  --text: #ffffff;
  --muted: rgba(235, 235, 245, 0.6);
  --accent: #9b5cff;
  --accent-2: #7c3aed;
  --accent-glow: rgba(155, 92, 255, 0.55);
  --radius: 12px;
  --safe-top: max(var(--tg-content-safe-area-inset-top, 0px), env(safe-area-inset-top, 0px));
  --safe-bottom: max(var(--tg-content-safe-area-inset-bottom, 0px), env(safe-area-inset-bottom, 0px));
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { background: var(--bg); }
html, body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

/* Фон: тёмный с фиолетовыми диагональными бликами, как на макете */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(70% 45% at 100% 0%, rgba(124, 58, 237, 0.40), transparent 70%),
    radial-gradient(60% 40% at 0% 100%, rgba(124, 58, 237, 0.30), transparent 70%),
    linear-gradient(122deg, transparent 0 56%, rgba(155, 92, 255, 0.16) 59%, transparent 63%),
    linear-gradient(122deg, transparent 0 65.5%, rgba(190, 140, 255, 0.45) 66.6%, transparent 67.6%),
    linear-gradient(122deg, transparent 0 70%, rgba(155, 92, 255, 0.14) 72%, transparent 76%),
    linear-gradient(122deg, transparent 0 16%, rgba(155, 92, 255, 0.14) 19%, transparent 24%),
    linear-gradient(122deg, transparent 0 27.5%, rgba(190, 140, 255, 0.35) 28.4%, transparent 29.3%),
    var(--bg);
}

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 18px) 16px calc(var(--safe-bottom) + 20px);
  min-height: 100vh;
}

.screen { animation: enter 0.22s ease-out; }
.screen.back { animation-name: enter-back; }
@keyframes enter { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes enter-back { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }

/* ---------- Главный экран ---------- */
.hero {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 4px 0 22px;
}
.logo {
  width: 136px;
  height: 136px;
  flex: none;
  filter: drop-shadow(0 0 18px var(--accent-glow));
}
.logo img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.hero-title { font-size: 25px; font-weight: 700; letter-spacing: -0.3px; }
.hero-slogan { font-size: 18px; line-height: 1.25; color: rgba(255,255,255,0.88); margin-top: 6px; }

.greet { font-size: 21px; font-weight: 700; margin: 0 0 4px; }
.lead { font-size: 17px; line-height: 1.35; margin: 0 0 6px; color: rgba(255,255,255,0.92); }
.lead.muted { color: rgba(255,255,255,0.82); margin-bottom: 12px; }

.footer {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
}
.footer.big { font-size: 15px; margin-top: 18px; }

/* ---------- Заголовок экрана ---------- */
.head { text-align: center; margin: 6px 0 18px; }
.head-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.head-title .ico { width: 26px; height: 26px; }
.head-sub { font-size: 17px; color: rgba(255,255,255,0.85); margin-top: 6px; }
.head.left { text-align: left; }

/* ---------- Списки кнопок ---------- */
.list { display: flex; flex-direction: column; gap: 7px; }

.row {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px 8px 14px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  text-align: left;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.15s, transform 0.08s;
}
.row:active { transform: scale(0.985); background: var(--card-hover); }

.row .ico { width: 26px; height: 26px; flex: none; margin-right: 16px; display: grid; place-items: center; }
.row .ico svg { width: 26px; height: 26px; }
.row .emoji { font-size: 22px; line-height: 1; }
.row .label { flex: 1; }
.chev { width: 20px; height: 20px; flex: none; color: var(--accent); }

/* Двухстрочная кнопка по центру: модели, серии, состояния */
.row.tall {
  min-height: 60px;
  padding: 10px 12px 10px 44px;
}
.row.tall .body { flex: 1; text-align: center; }
.row .title { font-size: 18px; font-weight: 500; }
.row .sub { font-size: 13.5px; color: var(--muted); margin-top: 3px; }
.row.card { min-height: 84px; border-radius: 14px; padding-left: 20px; }
.row.card .body { text-align: left; }
.row.card .title { font-size: 21px; }
.row.card .sub { font-size: 14px; line-height: 1.45; }

/* ---------- Плитки брендов ---------- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 112px;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.15s, transform 0.08s;
}
.tile:active { transform: scale(0.97); background: var(--card-hover); }
.tile .brand { height: 52px; display: grid; place-items: center; }
.tile .brand svg { display: block; }

.brand-apple svg { width: 44px; height: 44px; fill: #fff; }
.brand-samsung svg { width: 118px; height: 18px; fill: #fff; }
.brand-huawei svg { width: 58px; height: 44px; fill: #e8202c; }
.brand-honor svg { width: 104px; height: 20px; fill: #fff; }
.brand-google svg { width: 44px; height: 44px; fill: #fff; }
.brand-motorola svg { width: 48px; height: 48px; fill: #fff; }

.wide {
  width: 100%;
  min-height: 82px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  margin-bottom: 12px;
}
.wide:active { transform: scale(0.985); background: var(--card-hover); }
.wide .line { display: inline-flex; align-items: center; gap: 10px; font-size: 18px; }
.wide .line svg { width: 24px; height: 24px; }
.wide .sub { font-size: 13.5px; color: var(--muted); }

/* ---------- Память: по две в ряд ---------- */
.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chips .row { justify-content: center; min-height: 54px; font-size: 18px; padding: 8px 12px; }
.chips .row:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* ---------- Кнопки действий ---------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  margin-top: 10px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: rgba(32, 29, 52, 0.85);
  color: var(--text);
  font: inherit;
  font-size: 17px;
  cursor: pointer;
  transition: transform 0.08s, background 0.15s;
}
.btn:active { transform: scale(0.985); }
.btn svg { width: 22px; height: 22px; }

.btn.primary {
  border: 1.5px solid var(--accent);
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.26), rgba(124, 58, 237, 0.10));
  box-shadow: 0 0 16px rgba(155, 92, 255, 0.35), inset 0 0 12px rgba(155, 92, 255, 0.15);
  font-weight: 500;
}
.btn.ghost-accent svg { color: var(--accent); }
.btn[disabled] { opacity: 0.55; pointer-events: none; }

.back { margin-top: 12px; }

/* ---------- Экран «Отлично!» ---------- */
.done { text-align: center; padding-top: 28px; }
.done .check { margin: 0 auto; width: 58px; height: 58px; color: var(--accent); filter: drop-shadow(0 0 10px var(--accent-glow)); }
.done h2 { font-size: 26px; margin: 14px 0 10px; }
.done p { font-size: 18px; line-height: 1.4; margin: 0 0 14px; color: rgba(255,255,255,0.92); }
.done .actions-title { font-size: 17px; margin: 14px 0 4px; }

/* ---------- Поддержка ---------- */
.checklist {
  list-style: none;
  margin: 0 0 14px;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--card-border);
}
.checklist li { display: flex; align-items: center; gap: 12px; font-size: 17px; padding: 5px 0; }
.checklist svg { width: 20px; height: 20px; color: var(--accent); flex: none; }
.hint { text-align: center; color: var(--muted); font-size: 15px; margin: 14px 0 2px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- Форма ---------- */
.form-text { font-size: 16px; line-height: 1.5; color: rgba(255,255,255,0.88); margin: 0 0 14px; }
.form-text ul { margin: 6px 0 0; padding-left: 20px; }
textarea {
  width: 100%;
  min-height: 140px;
  padding: 14px;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  resize: vertical;
  outline: none;
}
textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(155, 92, 255, 0.2); }

.error { color: #ff6b81; text-align: center; font-size: 14px; margin-top: 10px; }

.loader { display: grid; place-items: center; min-height: 70vh; }
.loader span {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid rgba(155, 92, 255, 0.25); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
