/* Nomad BC — светлая тема. Цвета: небо и солнце казахстанского флага на белом. */
:root {
  --paper: #FFFFFF;
  --surface: #F1F6F7;
  --ink: #12323C;
  --muted: #5B7079;
  --sky: #0089A3;
  --sky-deep: #006F85;
  --sky-soft: #E3F3F6;
  --gold: #F2B705;
  --gold-soft: #FFF6D6;
  --line: #D9E4E7;
  --bad: #B3261E;
  --bad-soft: #FCE8E6;
  --ok: #1E7B45;
  --ok-soft: #E4F3E9;
  --r-btn: 14px;
  --r-card: 22px;
  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: inherit; }
html { scroll-padding-top: calc(64px + env(safe-area-inset-top, 0px)); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--surface); color: var(--ink);
  font: 16px/1.5 "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
img { max-width: 100%; }
a { color: var(--sky-deep); }
h1 { font-size: 26px; line-height: 1.15; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 8px; }
h2 { font-size: 19px; line-height: 1.25; font-weight: 800; margin: 0 0 6px; }
p { margin: 0 0 12px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
#app:focus, #app:focus-visible { outline: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 14px; }
.lead { color: var(--muted); font-size: 17px; max-width: 34em; }
.note { background: var(--gold-soft); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.hint { color: var(--muted); font-size: 14px; margin-top: -4px; }
.empty { color: var(--muted); padding: 24px 0; }
.center { text-align: center; }

/* Шапка */
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10;
  display: flex; align-items: center; gap: 10px; height: 60px; padding: 0 12px;
  background: rgba(255, 255, 255, 0.94); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.logo { font-weight: 800; font-size: 20px; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.logo span { color: var(--sky); margin-left: 2px; }
.top-title { flex: 1; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo + .top-title { flex: 1; }
.icon-btn { border: 0; background: none; color: var(--ink); width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--surface); }

/* Переключатель (язык) */
.seg { display: inline-flex; background: var(--surface); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: none; font: inherit; font-size: 14px; padding: 6px 12px; border-radius: 999px;
  color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--paper); color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgba(18, 50, 60, 0.12); }
.seg-sm button { padding: 4px 10px; font-size: 13px; }

/* Раскладка */
main { max-width: 560px; margin: 0 auto; padding: 16px 16px 48px; outline: none; }
.loading { padding: 48px 0; text-align: center; color: var(--muted); }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card); padding: 22px 20px; }
.panel + .panel { margin-top: 14px; }
.stack { display: grid; gap: 10px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row-between { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 18px; border-radius: var(--r-btn); border: 0;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; text-align: center;
  transition: background-color .15s, transform .1s;
}
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: .6; cursor: default; }
.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy::after { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid var(--paper); border-right-color: transparent; animation: spin .7s linear infinite; }
.btn-soft.is-busy::after, .btn-gold.is-busy::after { border-color: var(--ink); border-right-color: transparent; }
.btn-main { background: var(--sky); color: #fff; }
.btn-main:hover { background: var(--sky-deep); }
.btn-soft { background: var(--sky-soft); color: var(--ink); }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-text { background: none; color: var(--sky-deep); min-height: 44px; }
.btn-danger { color: var(--bad); }
.btn-xl { min-height: 60px; font-size: 18px; border-radius: 16px; }
.btn-small { min-height: 38px; padding: 0 12px; font-size: 14px; border-radius: 11px; }
.btn-inline { justify-self: start; padding: 0; min-height: 32px; font-size: 14px; }

/* Главная */
.hero { padding: 18px 4px 22px; }
.hero h1 { font-size: 34px; line-height: 1.08; margin-bottom: 12px; max-width: 12em; }
.hero-in { padding-top: 6px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.tile { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 18px 16px;
  min-height: 76px; display: flex; align-items: flex-end; color: var(--ink); text-decoration: none; font-weight: 700; }
.tile:hover { border-color: var(--sky); }
.club-strip { background: var(--gold-soft); border: 1px solid var(--gold); border-radius: var(--r-card); padding: 20px; }
.club-strip p { font-size: 15px; }

/* Формы */
.form { display: grid; gap: 14px; }
fieldset { border: 0; padding: 0; margin: 0 0 6px; display: grid; gap: 12px; }
legend { font-weight: 800; font-size: 17px; margin-bottom: 10px; padding: 0; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 14px; font-weight: 500; color: var(--muted); }
.field input, .field select, .field textarea {
  font: inherit; font-size: 17px; color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; width: 100%;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--sky); outline: none; box-shadow: 0 0 0 3px var(--sky-soft); }
.field.compact { margin: 6px 0 12px; }
.code-input { letter-spacing: 0.4em; font-size: 26px !important; font-weight: 700; text-align: center; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.4; }
.check input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--sky); }
.or { text-align: center; color: var(--muted); margin: 16px 0 10px; }
.g-btn { display: flex; justify-content: center; margin-top: 10px; min-height: 44px; }
.form-actions { display: flex; gap: 10px; align-items: center; justify-content: space-between; position: sticky;
  bottom: 0; background: var(--paper); padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px)); }
.form-actions .btn-main { flex: 1; }

/* Визитка (превью) */
.bcard { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.bcard-band { height: 54px; background: var(--sky); }
.bcard-body { padding: 0 18px 18px; margin-top: -32px; position: relative; }
.avatar { width: 68px; height: 68px; border-radius: 50%; border: 4px solid var(--paper); background: var(--sky-soft);
  object-fit: cover; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 800; color: var(--sky); }
.bcard-name { font-size: 21px; font-weight: 800; margin: 8px 0 2px; line-height: 1.2; }
.bcard-role { color: var(--muted); margin: 0; font-size: 15px; }
.bcard-spot { margin: 10px 0 0; font-size: 14px; background: var(--surface); border-radius: 10px; padding: 8px 10px; }
.bcard-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.bcard-chips span { font-size: 13px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; }

.card-list { display: grid; gap: 16px; margin: 14px 0 18px; }
.card-item-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.card-pick { text-decoration: none; color: inherit; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  background: var(--surface); color: var(--muted); margin-right: auto; }
.badge-ok, .badge-active { background: var(--ok-soft); color: var(--ok); }
.badge-redeemed { background: var(--sky-soft); color: var(--sky-deep); }
.badge-expired { background: var(--bad-soft); color: var(--bad); }

.editor-grid { display: grid; gap: 20px; }
.preview { order: -1; }
.preview .muted { margin-bottom: 8px; }
@media (min-width: 900px) {
  main:has(.editor) { max-width: 980px; }
  .editor-grid { grid-template-columns: 1fr 360px; align-items: start; }
  .preview { order: 0; position: sticky; top: 80px; }
}
.uploads { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.upload { display: grid; gap: 8px; justify-items: start; }
.upload-img { width: 96px; height: 96px; border-radius: 14px; background: var(--surface); border: 1px dashed var(--line); overflow: hidden; }
.upload-img.round { border-radius: 50%; }
.upload-img img { width: 100%; height: 100%; object-fit: cover; }

/* Поделиться */
.share { text-align: center; background: var(--paper); border-radius: var(--r-card); border: 1px solid var(--line); padding: 20px; }
.share-hint { color: var(--muted); }
.share-qr { width: min(78vw, 340px); margin: 6px auto 12px; }
.share-qr svg { width: 100%; height: auto; display: block; }
.share-name { font-size: 22px; font-weight: 800; margin: 0; }
.share-url { color: var(--muted); margin-bottom: 18px; }
.share-sub { margin: 22px 0 10px; font-size: 16px; }

/* Оплата и клуб */
.offer-panel { text-align: left; }
.checks { list-style: none; padding: 0; margin: 14px 0 18px; display: grid; gap: 10px; }
.checks li { padding-left: 30px; position: relative; }
.checks li::before { content: ""; position: absolute; left: 2px; top: 4px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--sky) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/12px no-repeat; }
.club-panel .checks li::before { background-color: var(--gold); }
.price-big { font-size: 40px; font-weight: 800; margin: 0; line-height: 1.1; }
.club-badge { display: inline-grid; place-items: center; width: 92px; height: 92px; border-radius: 50%;
  background: var(--gold); font-size: 30px; font-weight: 800; margin-bottom: 14px; transform: rotate(-8deg); }
.done-mark { width: 72px; height: 72px; border-radius: 50%; background: var(--sky); color: #fff; font-size: 38px;
  display: grid; place-items: center; margin: 4px auto 14px; }
.done-mark.gold { background: var(--gold); color: var(--ink); }
.spinner { width: 40px; height: 40px; border-radius: 50%; border: 4px solid var(--sky-soft); border-top-color: var(--sky);
  animation: spin .8s linear infinite; margin: 10px auto 16px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Списки */
.list { list-style: none; margin: 10px 0 0; padding: 0; }
.list-item { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 0; border-top: 1px solid var(--line); }
.list-item:first-child { border-top: 0; }
.li-title { font-weight: 700; margin: 0; }
.li-sub { color: var(--muted); font-size: 14px; margin: 2px 0 6px; }
.li-note { font-size: 14px; margin: 0 0 6px; }

/* Статистика */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.stat { background: var(--surface); border-radius: 14px; padding: 12px 14px; margin: 0; }
.stat dt { font-size: 13px; color: var(--muted); }
.stat dd { margin: 2px 0 0; font-size: 28px; font-weight: 800; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; margin-top: 12px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.bar::before { content: ""; width: 100%; height: var(--h); min-height: 2px; background: var(--sky); border-radius: 4px 4px 0 0; }
.bar span { font-size: 10px; color: var(--muted); margin-top: 4px; }

/* Сканер */
.scan { text-align: center; }
.scan-view { position: relative; border-radius: var(--r-card); overflow: hidden; background: var(--ink); aspect-ratio: 1; }
.scan-view video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; inset: 18%; border: 3px solid var(--gold); border-radius: 18px; }
.result { margin-top: 14px; padding: 18px; border-radius: var(--r-card); text-align: center; }
.result-ok { background: var(--ok-soft); border: 2px solid var(--ok); }
.result-bad { background: var(--bad-soft); color: var(--bad); font-weight: 700; }
.result-title { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.result-pct { font-size: 56px; font-weight: 800; line-height: 1; margin: 6px 0 14px; color: var(--ok); }

/* Купон */
.coupon { text-align: center; }
.coupon-seller { font-size: 22px; font-weight: 800; margin: 0; }
.coupon-pct { font-size: 64px; font-weight: 800; color: var(--ink); line-height: 1; margin: 12px 0;
  background: var(--gold); border-radius: 18px; padding: 10px 0; }
.coupon-qr { width: min(72vw, 300px); margin: 0 auto 10px; }
.coupon-qr svg { width: 100%; height: auto; display: block; }
.coupon .form { text-align: left; margin-top: 20px; }
.coupon .stack { margin-top: 12px; }

/* Настройки */
.setting { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.panel .btn { width: 100%; margin-top: 10px; }
.panel .card-item-bar .btn, .panel .row-between .btn, .panel .list-item .btn, .panel .upload .btn, .panel .btn-inline { width: auto; margin-top: 0; }
.panel .row .btn, .panel .form-actions .btn { margin-top: 0; }

/* Уведомления */
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 14px; max-width: calc(100% - 32px);
  opacity: 0; transition: opacity .2s, transform .2s; z-index: 50; font-size: 15px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-error { background: var(--bad); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Выбор цели и тарифов */
.goals, .plans { display: grid; gap: 12px; }
.goal { display: grid; gap: 6px; background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--r-card);
  padding: 18px; color: var(--ink); text-decoration: none; }
.goal:hover, .goal:focus-visible { border-color: var(--sky); }
.goal-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.goal-head b { font-size: 21px; font-weight: 800; }
.goal-price { font-weight: 800; font-size: 18px; white-space: nowrap; }
.goal-text { color: var(--muted); font-size: 15px; }
.goal-note { font-size: 13px; font-weight: 500; color: var(--sky-deep); }
.goal-trade { border-color: var(--sky); box-shadow: 0 0 0 3px var(--sky-soft); }
.goal-club { background: var(--gold-soft); border-color: var(--gold); }
.goal-club .goal-note { color: var(--ink); }
.plan { position: relative; background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--r-card); padding: 22px 20px; }
.plan-hl { border-color: var(--sky); box-shadow: 0 0 0 3px var(--sky-soft); }
.plan-tag { position: absolute; top: -12px; left: 18px; background: var(--sky); color: #fff; font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; }
.plan .btn { width: 100%; }
@media (min-width: 720px) { .plans { grid-template-columns: 1fr 1fr; } main:has(.plans) { max-width: 820px; } }

/* Клиенты и рассылка */
.to-phone { margin: 6px 0 8px; padding: 14px; background: var(--surface); border-radius: 16px; }
.to-phone .btn { margin-top: 0; }
.to-phone .hint { margin: 0; }
.li-actions { display: flex; flex-direction: column; gap: 6px; }
.badge-new { background: var(--gold); color: var(--ink); margin-left: 6px; vertical-align: middle; }
.steps { padding-left: 22px; display: grid; gap: 8px; margin: 8px 0 14px; }
.tpl { display: grid; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.tpl:first-of-type { border-top: 0; }
.tpl-text { font: inherit; font-size: 15px; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; resize: vertical; width: 100%; }
.panel .tpl .btn { width: auto; justify-self: start; margin-top: 0; }
