:root {
  --cream: #F3EEE6;
  --paper: #FAF8F4;
  --sand: #EBE2D2;
  --line: #E3DACB;
  --black: #171512;
  --ink-2: #5E574D;
  --ink-3: #8D857A;
  --gold: #B08D45;
  --gold-light: #D9B977;
  --gold-dark: #8C6D2F;
  --kaspi: #F14635;
  --green: #1FA45B;
  --green-bg: #E1F2E6;
  --red: #C0392B;
  --r: 16px;
  --r-sm: 12px;
  --head: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--black);
  font: 400 15px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--head); font-weight: 700; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
button { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0 16px env(safe-area-inset-bottom);
}
main { flex: 1; }

/* шапка */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 2px 14px;
  border-bottom: 1px solid var(--line);
  margin: 0 -16px; padding-left: 18px; padding-right: 18px;
}
.logo img { width: 112px; height: auto; }
.lang {
  display: flex; align-items: center; gap: 4px;
  border: 1.5px solid var(--gold-light); border-radius: 999px;
  padding: 5px 12px; font: 600 12px/1 var(--body); color: var(--ink-3);
}
.lang a { color: inherit; text-decoration: none; padding: 2px 1px; }
.lang a.on { color: var(--black); font-weight: 700; }

/* прогресс */
.progress { display: none; gap: 6px; padding-top: 14px; }
.app:not([data-screen="home"]) .progress { display: flex; }
.app[data-screen="done"] .progress { display: none; }
.pr { flex: 1; }
.pr i { display: block; height: 3px; border-radius: 2px; background: var(--line); transition: background .3s; }
.pr span { display: block; margin-top: 6px; font: 600 10px/1 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.pr.on i { background: var(--gold); }
.pr.on span { color: var(--gold-dark); }

.screen { padding: 16px 0 8px; animation: in .35s ease both; }
@keyframes in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .screen { animation: none; } * { transition: none !important; } }

.eyebrow { font: 600 10.5px/1.3 var(--body); letter-spacing: .14em; text-transform: uppercase; }
.gold { color: var(--gold-light); }
.gold-dark { color: var(--gold-dark); }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }

/* hero */
.hero {
  position: relative; overflow: hidden;
  border-radius: 20px; background: var(--black); color: #F7F3EC;
}
.hero-media { position: relative; }
.hero-img { width: 100%; height: auto; aspect-ratio: 640 / 368; object-fit: cover; }
.hero-media::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 60%;
  background: linear-gradient(to bottom, rgba(23,21,18,0), rgba(23,21,18,.75) 55%, var(--black));
  pointer-events: none;
}
.hero-body { position: relative; z-index: 1; padding: 0 18px 20px; margin-top: -64px; }
.hero h1 { font-size: 26px; line-height: 1.18; margin: 8px 0 8px; }
.hero-sub { font-size: 13.5px; color: #CFC7BA; margin-bottom: 18px; }

/* кнопки */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; min-height: 54px; padding: 14px 20px;
  border: 0; border-radius: 999px; cursor: pointer;
  font: 700 15px/1.2 var(--head); text-decoration: none; text-align: center;
  transition: transform .12s ease, filter .15s ease, opacity .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-gold {
  background: linear-gradient(180deg, #E2C487, #C9A45C);
  color: var(--black);
  box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 6px 18px -8px rgba(176,141,69,.7);
}
.btn-gold:hover:not(:disabled) { filter: brightness(1.04); }
.btn-gold:disabled { background: #DCCDAE; box-shadow: none; opacity: 1; color: #7F7563; }
.btn .ico { flex: none; transition: transform .2s ease; }
.btn:hover .ico { transform: translateX(3px); }
.btn-green .ico { margin-right: 2px; }
.btn:focus-visible, .qty button:focus-visible, .back:focus-visible, .lang a:focus-visible, .link:focus-visible {
  outline: 3px solid rgba(176,141,69,.45); outline-offset: 2px;
}
.btn-kaspi { background: var(--kaspi); color: #fff; box-shadow: 0 6px 18px -8px rgba(241,70,53,.7); }
.btn-kaspi:hover:not(:disabled) { filter: brightness(1.05); }
.btn-kaspi-outline { background: transparent; color: var(--kaspi); border: 1.5px solid var(--kaspi); min-height: 48px; margin-top: 14px; }
.btn-green { background: var(--green); color: #fff; margin-top: 12px; }
.btn.loading { pointer-events: none; }
.btn.loading > span, .btn.loading .ico { visibility: hidden; }
.btn { position: relative; }
.btn.loading::after {
  content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite;
}
.link { background: none; border: 0; padding: 12px 0; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 13.5px; display: block; }
.link.center { margin: 6px auto 0; }

/* главная */
.trust { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.mini { display: flex; align-items: center; gap: 10px; padding: 12px; }
.mi { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--sand); color: var(--gold-dark); }
.mi.kaspi { background: #FDE6E3; color: var(--kaspi); }
.mini b { display: block; font: 700 14.5px/1.25 var(--head); }
.mini span { display: block; font-size: 11.5px; line-height: 1.3; color: var(--ink-3); margin-top: 2px; }
.about { background: var(--sand); border-color: transparent; }
.about p:last-child { margin-top: 8px; font-size: 14px; line-height: 1.55; }
.steps { margin-top: 12px; }
.steps ol { list-style: none; margin: 10px 0 0; padding: 0; }
.steps li { display: flex; align-items: center; gap: 10px; padding: 9px 0; font-size: 14px; }
.steps li span { flex: 1; }
.steps li i { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--black); color: var(--gold-light); font: 700 11.5px/1 var(--head); font-style: normal; }
.steps li + li { border-top: 1px dashed var(--line); }
.steps li b { white-space: nowrap; font-family: var(--head); }

/* экран 2 */
.step-n { margin-top: 2px; }
.step-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 2px; }
.back { display: inline-flex; align-items: center; gap: 2px; margin-left: -6px; padding: 6px 8px 6px 4px; border: 0; background: none; border-radius: 999px;
  color: var(--ink-2); font: 500 13px/1 var(--body); cursor: pointer; }
.back:hover { background: var(--sand); }
.screen h2 { font-size: 22px; line-height: 1.25; margin: 4px 0 14px; }
.product { padding: 0; overflow: hidden; }
.product img { width: 100%; height: auto; aspect-ratio: 640 / 368; object-fit: cover; background: var(--sand); }
.product-body { padding: 14px 16px 16px; }
.product h3 { font-size: 16px; }
.price-row { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.price { font: 700 26px/1 var(--head); font-variant-numeric: tabular-nums; }
.unit { display: block; font-size: 12px; margin-top: 4px; }
.qty { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.qty button { width: 44px; height: 44px; border: 0; background: none; font-size: 18px; cursor: pointer; border-radius: 999px; }
.qty button:disabled { opacity: .3; cursor: default; }
.qty output { min-width: 22px; text-align: center; font-weight: 600; }

form { margin-top: 14px; }
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font: 600 12px/1.3 var(--body); color: var(--ink-2); margin-bottom: 6px; }
.field em { color: var(--kaspi); font-style: normal; }
.field small { display: block; margin-top: 6px; font-size: 12px; }
.field input, .field select {
  width: 100%; height: 50px; padding: 0 16px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-sm);
  font: 400 16px/1 var(--body); color: var(--black); outline: none;
  appearance: none; -webkit-appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: #A9A196; }
.field input:focus, .field select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(176,141,69,.18); }
.field input.bad { border-color: var(--red); background: #FFF7F6; }
.field input.ok { border-color: #BFD9C7; }
.select { position: relative; display: block; }
.select::after { content: ""; position: absolute; right: 18px; top: 50%; width: 0; height: 0; margin-top: -2px;
  border: 5px solid transparent; border-top-color: var(--ink-3); pointer-events: none; }
.note { text-align: center; font-size: 12px; color: var(--ink-3); margin-top: 10px; }
.err { color: var(--red); font-size: 13px; margin: 2px 0 10px; text-align: center; }
.band { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; background: var(--sand); border-color: transparent; padding: 14px 16px; font-size: 13.5px; }
.band b { white-space: nowrap; }

.wait { text-align: center; margin-top: 14px; padding: 22px 18px 12px; }
.wait .link { margin: 4px auto 0; }
.wait h3 { font-size: 16px; margin: 14px 0 6px; }
.spinner { width: 34px; height: 34px; margin: 0 auto; border-radius: 50%; border: 3px solid #F9D3CF; border-top-color: var(--kaspi); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* экран 3 */
.paid-badge { display: flex; align-items: center; gap: 8px; background: var(--green-bg); color: #17663B; border-radius: var(--r-sm); padding: 11px 14px; font-size: 13.5px; font-weight: 600; margin-bottom: 14px; }

/* экран 4 */
.done-head { text-align: center; padding: 18px 0 6px; }
.check { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; background: var(--green-bg); color: var(--green); display: grid; place-items: center; }
.done-head h2 { margin: 0 0 4px; font-size: 23px; }
.summary { margin-top: 14px; }
.summary .row, .next .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.summary .row + .row { margin-top: 14px; }
.summary small { display: block; font-size: 12px; margin-top: 2px; }
.summary b { white-space: nowrap; }
.summary .row > div b { white-space: normal; }
.dark { background: var(--black); color: #EDE6DA; border-color: var(--black); margin-top: 12px; }
.next .eyebrow { margin-bottom: 6px; }
.next .row { padding: 6px 0; font-size: 13.5px; }
.next .row b { color: var(--gold-light); white-space: nowrap; }

.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--cream) 65%, rgba(243,238,230,0));
  transform: translateY(110%); transition: transform .28s ease;
}
.sticky-cta .btn { max-width: 448px; margin: 0 auto; }
.sticky-cta.show { transform: none; }
.app:not([data-screen="home"]) ~ .sticky-cta, .app:not([data-screen="home"]) .sticky-cta { display: none; }
.foot { text-align: center; color: var(--ink-3); font-size: 11.5px; letter-spacing: .08em; padding: 28px 0 18px; }

@media (min-width: 560px) {
  body { padding: 24px 0; }
  .app { background: var(--cream); min-height: auto; }
  .hero h1 { font-size: 30px; }
}
.app.has-sticky[data-screen="home"] .foot { padding-bottom: 96px; }
