:root {
  --red: #EF3124;
  --red-600: #d92a1e;
  --ok: #16a34a;
  --ok-600: #128a3e;

  --ink: #14161a;
  --muted: #8b909a;
  --line: #eef0f3;
  --card: #ffffff;

  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 10px 30px rgba(20, 22, 26, 0.06);
  --shadow-cta: 0 12px 26px rgba(239, 49, 36, 0.30);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
[hidden] { display: none !important; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: #f3f4f7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Фон: мягкий градиент с алым свечением сверху */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(239, 49, 36, 0.14), transparent 60%),
    linear-gradient(180deg, #f7f8fa 0%, #eef0f4 100%);
}

.page {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 20px 16px calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Шапка ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand__logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--red); color: #fff;
  font-weight: 800; font-size: 19px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 14px rgba(239, 49, 36, 0.28);
}
.brand__name { font-weight: 700; font-size: 16px; }
.tag {
  font-size: 12px; font-weight: 700; letter-spacing: 0.5px;
  color: var(--muted);
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--line);
  padding: 5px 10px; border-radius: 999px;
}

/* ---------- Сумма ---------- */
.hero {
  text-align: center;
  padding: 22px 20px 24px;
}
.hero__label {
  font-size: 13px; font-weight: 700; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--muted);
}
.hero__amount {
  font-size: 46px; font-weight: 800; letter-spacing: -1.5px;
  margin: 6px 0 4px; line-height: 1.05;
}
.hero__sub { font-size: 15px; color: var(--muted); }

/* ---------- Таймер ---------- */
.timer {
  background: var(--card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 14px 16px 16px;
}
.timer__row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.timer__label { font-size: 14px; color: var(--muted); font-weight: 600; }
.timer__value {
  font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.timer__track { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.timer__fill {
  display: block; height: 100%; width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e, #22c55e);
  transition: width 0.9s linear, background 0.4s;
}
.timer.is-warning .timer__value { color: var(--red); }
.timer.is-warning .timer__fill { background: linear-gradient(90deg, var(--red), #ff6a3d); }
.timer.is-expired .timer__value { color: var(--muted); }
.timer.is-expired .timer__fill { background: var(--muted); }

/* ---------- Блок «куда переводить» ---------- */
.route {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.route__head { display: flex; align-items: center; gap: 12px; }
.route__ic {
  flex-shrink: 0;
  width: 42px; height: 42px; border-radius: 12px;
  background: #fdeede; color: var(--alfa-orange-2, #e07a2b);
  display: flex; align-items: center; justify-content: center;
}
.route__title { font-size: 16px; font-weight: 700; line-height: 1.25; }
.route__title b { font-weight: 800; }
.route__sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

.route__bankrow {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #f6f7f9;
  border-radius: 14px;
  padding: 12px 14px;
}
.route__bank-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.route__bank-badge {
  font-size: 15px; font-weight: 800; color: #fff;
  background: var(--red);
  padding: 7px 16px; border-radius: 999px;
  box-shadow: 0 4px 12px rgba(239, 49, 36, 0.25);
  white-space: nowrap;
}

.route__warn {
  display: flex; align-items: flex-start; gap: 10px;
  background: #fff2f1;
  border: 1px solid #ffd9d5;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 13.5px; line-height: 1.45; color: #b3241a;
}
.route__warn-ic { flex-shrink: 0; color: var(--red); margin-top: 1px; }
.route__warn b { font-weight: 800; }

/* ---------- Действие ---------- */
.action {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  text-align: center;
}
.action__hint { font-size: 13.5px; color: var(--muted); margin: 12px 2px 0; line-height: 1.45; }

/* CTA */
.cta {
  position: relative;
  width: 100%;
  border: none;
  border-radius: 16px;
  padding: 18px;
  font-family: var(--font);
  font-size: 17px; font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(180deg, #ff5a44 0%, var(--red) 55%, var(--red-600) 100%);
  box-shadow: var(--shadow-cta);
  transition: transform 0.12s ease, box-shadow 0.2s, filter 0.15s;
}
.cta:active { transform: translateY(1px) scale(0.995); }
.cta[disabled] { filter: saturate(0.5) opacity(0.7); cursor: default; box-shadow: none; }
.cta--ok {
  background: linear-gradient(180deg, #22c55e 0%, var(--ok) 60%, var(--ok-600) 100%);
  box-shadow: 0 12px 26px rgba(22, 163, 74, 0.28);
}
.cta__spinner {
  display: none;
  width: 18px; height: 18px; margin-left: 10px;
  border: 2.5px solid rgba(255,255,255,0.4); border-top-color: #fff;
  border-radius: 50%; vertical-align: -4px;
  animation: spin 0.7s linear infinite;
}
.cta.is-loading .cta__spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.link-muted {
  display: inline-block; margin-top: 14px;
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 14px; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px;
  font-family: var(--font);
}

.qr {
  display: inline-block; padding: 16px;
  background: #fff; border: 1px solid var(--line);
  border-radius: 18px;
}
.qr img, .qr canvas { display: block; }

.error-text { color: var(--red); font-size: 15px; margin: 6px 0; }

/* ---------- VPN заметка ---------- */
.vpn {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted);
}
.vpn__icon { flex-shrink: 0; color: #e07a2b; }
.vpn__text { font-size: 13px; font-weight: 600; line-height: 1.4; flex: 1; }
.vpn__close { background: none; border: none; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 0 2px; flex-shrink: 0; }

/* ---------- Реквизиты ---------- */
.req {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 18px 14px;
}
.req__head { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.req__list { display: flex; flex-direction: column; }
.req__row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 4px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.15s;
}
.req__row:last-child { border-bottom: none; }
.req__row:active { background: #f6f7f9; }
.req__main { flex: 1; min-width: 0; }
.req__label { font-size: 12px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; color: var(--muted); }
.req__value { font-size: 16.5px; font-weight: 700; margin-top: 2px; word-break: break-word; }
.req__copy {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 11px;
  border: 1px solid var(--line); background: #fafbfc;
  color: #6a7180; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
.req__copy:active { transform: scale(0.92); }
.req__copy.is-copied { background: #e8f8ee; color: var(--ok); border-color: #bfe9cd; }
.req__foot { font-size: 12.5px; color: var(--muted); text-align: center; margin: 10px 0 2px; }

/* ---------- Аккордеон ---------- */
.acc {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.acc__head {
  list-style: none;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px; cursor: pointer;
  font-size: 16px; font-weight: 700;
}
.acc__head::-webkit-details-marker { display: none; }
.acc__chev { color: var(--muted); transition: transform 0.25s ease; }
.acc[open] .acc__chev { transform: rotate(180deg); }
.acc__list {
  margin: 0; padding: 2px 20px 20px 40px;
  color: #454b54; font-size: 14.5px; line-height: 1.6;
}
.acc__list li { margin-bottom: 8px; }
.acc__list li:last-child { margin: 0; }
.acc__list b { color: var(--ink); }

/* ---------- Подтверждение ---------- */
.confirm { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 2px; }
.confirm .cta--ok { max-width: 100%; }
.confirm.is-done .cta--ok { filter: grayscale(0.4) opacity(0.75); }
.btn-text {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 14px; font-weight: 600;
  font-family: var(--font); padding: 8px;
}
.btn-text:active { color: var(--red); }

.foot { text-align: center; font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(8px);
  background: #14161a; color: #fff;
  padding: 12px 20px; border-radius: 24px;
  font-size: 14px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  opacity: 0; transition: opacity 0.22s, transform 0.22s;
  pointer-events: none; z-index: 20;
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (min-width: 480px) {
  .page { padding-top: 28px; }
}
