
.pay-body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.pay-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gutter);
  padding-top: calc(18px + env(safe-area-inset-top));
  border-bottom: 1px solid var(--line);
  background: rgba(9, 9, 11, 0.7);
  backdrop-filter: blur(16px) saturate(160%);
}
.pay-header__secure {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500; color: var(--success);
  padding: 7px 14px; border-radius: var(--r-pill);
  background: rgba(54, 211, 153, 0.1); border: 1px solid rgba(54, 211, 153, 0.22);
}
.pay-header__secure svg { width: 15px; height: 15px; }
.pay-wrap { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: clamp(24px, 5vw, 64px) var(--gutter); padding-bottom: calc(clamp(24px, 5vw, 64px) + env(safe-area-inset-bottom)); }
.pay-grid {
  display: flex; flex-direction: column;
  gap: 28px; width: 100%; max-width: 520px; align-items: stretch; margin: 0 auto;
}
.pay-main {
  background: linear-gradient(180deg, rgba(20, 20, 25, 0.85), rgba(13, 13, 16, 0.92));
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2xl);
  padding: clamp(22px, 3.5vw, 38px);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
}
.pay-merchant { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.pay-merchant__logo {
  width: 54px; height: 54px; border-radius: 15px; flex: none;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line);
}
.pay-merchant > div:nth-child(2) { flex: 1; min-width: 0; }
.pay-merchant__name { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.verified { width: 18px; height: 18px; flex: none; border-radius: 50%; background: var(--grad); display: grid; place-items: center; }
.verified svg { width: 11px; height: 11px; color: #0b0712; }
.pay-merchant__status { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); margin-top: 2px; }
.pay-merchant__status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 10px var(--success); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: 0.4; } }
.pay-sbp-badge { display: inline-flex; align-items: center; gap: 7px; flex: none; font-size: 12.5px; font-weight: 700; color: #fff; padding: 7px 12px; border-radius: var(--r-pill); background: linear-gradient(120deg, rgba(108,92,231,0.25), rgba(93,226,255,0.18)); border: 1px solid var(--line-strong); }
.pay-sbp-badge svg { width: 16px; height: 16px; color: var(--accent); }
.pay-amount {
  text-align: center; padding: 26px; margin-bottom: 22px;
  border-radius: var(--r-lg);
  background: radial-gradient(120% 140% at 50% 0%, rgba(108, 92, 231, 0.16), transparent 60%);
  border: 1px solid var(--line);
}
.pay-amount__label { font-size: 13px; color: var(--muted); letter-spacing: 0.02em; }
.pay-amount__value { font-size: clamp(38px, 7vw, 54px); font-weight: 650; letter-spacing: -0.04em; line-height: 1.05; margin: 4px 0 6px; }
.pay-amount__meta { font-size: 13px; color: var(--muted-2); }
.pay-amount__meta strong { color: var(--muted); font-weight: 600; }
.pay-status {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; margin-bottom: 26px;
  border-radius: var(--r-md);
  background: linear-gradient(120deg, rgba(108,92,231,0.1), rgba(93,226,255,0.06));
  border: 1px solid rgba(108, 92, 231, 0.28);
}
.pay-status__loader {
  width: 30px; height: 30px; flex: none; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0%, var(--primary) 55%, var(--accent) 95%, transparent 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 calc(100% - 3px));
  animation: spin 0.9s linear infinite !important;
  animation-duration: 0.9s !important;
  animation-iteration-count: infinite !important;
}
.pay-status__text { display: flex; flex-direction: column; line-height: 1.35; }
.pay-status__text strong { font-size: 15px; font-weight: 600; }
.pay-status__text span { font-size: 13px; color: var(--muted); }
.pay-status[data-status="paid"] { background: rgba(54,211,153,0.1); border-color: rgba(54,211,153,0.3); }
.pay-status[data-status="paid"] .pay-status__loader { background: var(--success); -webkit-mask: none; mask: none; animation: none !important; }
@keyframes spin { to { transform: rotate(360deg); } }
.pay-mobile { display: none; }
.qr {
  width: 188px; height: 188px; border-radius: var(--r-md); padding: 12px;
  background: #fff; position: relative;
}
.qr svg { width: 100%; height: 100%; display: block; }
.sbp { display: flex; gap: 26px; align-items: center; }
.sbp__qr { flex: none; border-radius: var(--r-md); overflow: hidden; }
.sbp__scanline {
  position: absolute; left: 12px; right: 12px; top: 12px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--success), transparent);
  box-shadow: 0 0 14px var(--success);
  animation: scan 2.6s ease-in-out infinite;
}
@keyframes scan { 0%,100% { transform: translateY(0); } 50% { transform: translateY(164px); } }
.sbp__info h3 { font-size: 19px; margin-bottom: 8px; }
.sbp__info p { font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.sbp__steps { display: grid; gap: 10px; }
.sbp__steps li { display: flex; align-items: center; gap: 11px; font-size: 14px; color: var(--muted); }
.sbp__steps span { width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--success); background: rgba(54,211,153,0.14); border: 1px solid rgba(54,211,153,0.25); }
.sbp__banks { margin-top: 16px; }
.muted-label { font-size: 12px; color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.pay-cta { margin-top: 24px; }
.pay-cta--mobile { display: none; }
.qr-toggle {
  display: none;
  width: 100%; margin-top: 12px;
  align-items: center; justify-content: center; gap: 9px;
  padding: 14px; border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line-strong);
  color: var(--muted); font-size: 15px; font-weight: 550;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.qr-toggle svg { width: 18px; height: 18px; }
.qr-toggle:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.qr-toggle[aria-expanded="true"] { color: #fff; border-color: var(--primary); }
.pay-mobile__title { font-size: 18px; margin-bottom: 6px; }
.pay-mobile__hint { font-size: 13.5px; color: var(--muted); margin-bottom: 18px; }
.bank-list { display: grid; gap: 10px; }
.bank-card {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 14px 16px; min-height: 66px;
  border-radius: var(--r-md); text-align: left;
  background: rgba(255,255,255,0.03); border: 1px solid var(--line-strong);
  transition: transform 0.18s var(--ease), background 0.2s, border-color 0.2s;
}
.bank-card:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.2); }
.bank-card:active { transform: scale(0.985); }
.bank-card__logo { width: 44px; height: 44px; flex: none; border-radius: 13px; display: grid; place-items: center; font-size: 18px; font-weight: 800; }
.bank-card__name { flex: 1; font-size: 16px; font-weight: 550; color: #fff; }
.bank-card__chevron { color: var(--muted-2); flex: none; }
.bank-card__chevron svg { width: 20px; height: 20px; display: block; }
.bank-card--other .bank-card__logo { border: 1px solid var(--line-strong); letter-spacing: 1px; font-size: 14px; }
.pay-details { margin-top: 26px; border-top: 1px solid var(--line); }
.pay-details__row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.pay-details__row dt { font-size: 13.5px; color: var(--muted-2); flex: none; }
.pay-details__row dd { font-size: 14px; color: #fff; text-align: right; font-weight: 500; }
.pay-details__amount { font-weight: 650 !important; }
.timer { margin: 22px 0 6px; }
.timer__bar { height: 5px; border-radius: 999px; background: rgba(255,255,255,0.06); overflow: hidden; }
.timer__bar span { display: block; height: 100%; width: 100%; border-radius: 999px; background: var(--grad); transition: width 1s linear; }
.timer__text { text-align: center; font-size: 13px; color: var(--muted); margin-top: 10px; }
.timer__text strong { color: #fff; font-variant-numeric: tabular-nums; }
.timer.is-low .timer__bar span { background: linear-gradient(90deg, #ff5f57, #febc2e); }
.pay-securenote { display: flex; align-items: flex-start; gap: 9px; margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted-2); line-height: 1.5; }
.pay-securenote svg { flex: none; margin-top: 2px; color: var(--success); }
.pay-side { position: sticky; top: calc(72px + 28px); display: grid; gap: 18px; }
.order { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 26px; }
.order__title { font-size: 16px; margin-bottom: 20px; }
.order__item { display: flex; align-items: center; gap: 14px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.order__thumb { width: 46px; height: 46px; border-radius: 12px; flex: none; display: grid; place-items: center; background: var(--grad-soft); border: 1px solid var(--line); }
.order__thumb svg { width: 22px; height: 22px; }
.order__item-info { flex: 1; min-width: 0; }
.order__item-name { font-size: 14.5px; font-weight: 600; }
.order__item-desc { font-size: 12.5px; color: var(--muted-2); }
.order__item-price { font-size: 14.5px; font-weight: 600; white-space: nowrap; }
.order__lines { display: grid; gap: 12px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.order__line { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); }
.order__free { color: var(--success); font-weight: 600; }
.order__total { display: flex; align-items: baseline; justify-content: space-between; padding-top: 20px; }
.order__total > span:first-child { font-size: 15px; font-weight: 600; }
.order__total-val { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; white-space: nowrap; }
.order__promo { display: flex; gap: 8px; margin-top: 20px; }
.order__promo input { flex: 1; min-width: 0; height: 42px; padding: 0 14px; background: rgba(255,255,255,0.03); border: 1px solid var(--line-strong); border-radius: 11px; color: #fff; font-size: 14px; outline: none; transition: border-color 0.2s; }
.order__promo input:focus { border-color: var(--primary); }
.order__promo input::placeholder { color: #55555f; }
.order__promo-btn { padding: 0 16px; border-radius: 11px; font-size: 14px; font-weight: 600; color: #fff; background: rgba(255,255,255,0.06); border: 1px solid var(--line-strong); transition: 0.2s; white-space: nowrap; }
.order__promo-btn:hover { background: rgba(255,255,255,0.12); }
.trust-badges { display: grid; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 8px; }
.trust-badge { display: flex; align-items: center; gap: 13px; padding: 12px; border-radius: 12px; transition: background 0.2s; }
.trust-badge:hover { background: rgba(255,255,255,0.03); }
.trust-badge__ic { width: 38px; height: 38px; border-radius: 11px; flex: none; display: grid; place-items: center; background: rgba(54,211,153,0.1); border: 1px solid rgba(54,211,153,0.2); color: var(--success); }
.trust-badge__ic svg { width: 18px; height: 18px; }
.trust-badge strong { display: block; font-size: 13.5px; font-weight: 600; }
.trust-badge small { font-size: 12px; color: var(--muted-2); }
.pay-back { display: inline-flex; align-items: center; gap: 8px; justify-content: center; padding: 12px; font-size: 14px; color: var(--muted); transition: color 0.2s; }
.pay-back:hover { color: #fff; }
.toast {
  position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(20px);
  display: flex; align-items: center; gap: 10px;
  padding: 13px 20px; border-radius: var(--r-pill);
  background: rgba(20, 20, 25, 0.92); border: 1px solid var(--line-strong);
  backdrop-filter: blur(16px); box-shadow: var(--shadow-md);
  font-size: 14px; font-weight: 500; color: #fff;
  opacity: 0; pointer-events: none; transition: 0.4s var(--ease); z-index: 200;
  max-width: calc(100vw - 32px);
}
.toast svg { width: 18px; height: 18px; color: var(--success); flex: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (max-width: 900px) {
  .pay-side { position: static; order: 2; }
  .pay-main { order: 1; }
}
@media (max-width: 767px) {
  .pay-grid { gap: 18px; }
  .pay-main { padding: 20px 18px; border-radius: var(--r-xl); }
  .pay-merchant__logo { width: 48px; height: 48px; }
  .pay-sbp-badge { padding: 6px 10px; }
  .pay-amount { padding: 22px 18px; }
  .pay-amount__value { font-size: 42px; }
  .order { padding: 22px 18px; }
  .pay-cta--mobile { display: flex; }
  .qr-toggle { display: inline-flex; }
  #sbpBlock { display: none; }
  #sbpBlock.is-open { display: flex; margin-top: 18px; animation: fadeIn 0.3s var(--ease-out); }
  .sbp { flex-direction: column; gap: 22px; text-align: center; align-items: center; }
  .sbp__qr { margin: 0 auto; }
  .sbp__steps { display: inline-grid; text-align: left; }
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(-6px); } }
@media (max-width: 380px) {
  .pay-merchant__name { font-size: 16px; }
  .pay-amount__value { font-size: 38px; }
}
