:root {
  color-scheme: light;
  --ink: #17222c;
  --muted: #61707c;
  --line: #d8e0e6;
  --surface: #ffffff;
  --page: #f2f5f7;
  --primary: #087443;
  --primary-hover: #075f38;
  --blue: #1769aa;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--page);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.payment-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.header-inner {
  width: min(100% - 32px, 1080px);
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.header-inner strong { font-size: 18px; }
.header-inner span { color: var(--muted); font-size: 14px; text-align: right; }

.payment-main {
  width: min(100% - 32px, 1080px);
  margin: 0 auto;
  padding: 38px 0 48px;
}

.payment-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  max-width: 720px;
  margin: 0;
  font-size: 44px;
  line-height: 1.08;
  letter-spacing: 0;
}

.lead {
  max-width: 720px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
}

.amount {
  flex: 0 0 auto;
  color: var(--primary);
  font-size: 30px;
  font-weight: 800;
  white-space: nowrap;
}

.amount span { font-size: 54px; }

.payment-workspace {
  display: grid;
  grid-template-columns: minmax(300px, 430px) minmax(0, 1fr);
  gap: 38px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.qr-column { min-width: 0; }

.qr-frame {
  width: 100%;
  aspect-ratio: 1;
  padding: 12px;
  border: 1px solid var(--line);
  background: white;
}

.qr-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.payment-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border: 1px solid var(--primary);
  border-radius: 5px;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.button.bank-sber { color: white; background: var(--primary); }
.button.bank-sber:hover { border-color: var(--primary-hover); background: var(--primary-hover); }
.button.bank-vtb { border-color: var(--blue); color: white; background: var(--blue); }
.button.bank-vtb:hover { border-color: #125688; background: #125688; }
.button.bank-alfa { border-color: #ef3124; color: white; background: #ef3124; }
.button.bank-alfa:hover { border-color: #d7281d; background: #d7281d; }
.button.secondary { border-color: #9daab5; color: #324454; background: white; }
.button.secondary:hover { border-color: var(--blue); color: var(--blue); background: #f4f9fd; }
.button.return-link { grid-column: 1 / -1; }
.button:focus-visible { outline: 3px solid rgba(23, 105, 170, .2); outline-offset: 2px; }
.button[aria-busy="true"] { opacity: .7; pointer-events: none; }

.bank-option { min-width: 0; }
.bank-option .button { width: 100%; min-height: 58px; }

.bank-note {
  margin: 8px 2px 0;
  color: #475866;
  font-size: 12px;
  line-height: 1.4;
}

.save-status {
  min-height: 40px;
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}

.instructions h2 {
  margin: 0 0 16px;
  font-size: 24px;
}

.instructions ol {
  margin: 0;
  padding-left: 24px;
  line-height: 1.55;
}

.instructions li { padding: 0 0 11px 5px; }
.instructions li::marker { color: var(--primary); font-weight: 800; }

.device-note {
  margin: 7px 0 24px;
  padding: 12px 14px;
  border-left: 4px solid var(--blue);
  color: #2e485e;
  background: #edf6fc;
  line-height: 1.45;
}

.payment-details {
  margin: 0;
  border-top: 1px solid var(--line);
}

.payment-details div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.payment-details dt { color: var(--muted); font-size: 13px; font-weight: 700; }
.payment-details dd { margin: 0; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }

.security-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}

@media (max-width: 780px) {
  .payment-main { padding-top: 26px; }
  .payment-intro { display: block; }
  .amount { margin-top: 16px; }
  .amount span { font-size: 44px; }
  .payment-workspace { grid-template-columns: 1fr; padding: 22px; gap: 28px; }
  .qr-column { width: min(100%, 480px); margin: 0 auto; }
}

@media (max-width: 520px) {
  .header-inner { min-height: 60px; align-items: flex-start; flex-direction: column; justify-content: center; gap: 2px; }
  .header-inner span { font-size: 12px; text-align: left; }
  .payment-main { width: min(100% - 20px, 1080px); padding-bottom: 30px; }
  h1 { font-size: 30px; }
  .lead { font-size: 15px; }
  .payment-workspace { padding: 14px; }
  .payment-actions { grid-template-columns: 1fr; }
  .save-status { min-height: 54px; }
  .payment-details div { grid-template-columns: 1fr; gap: 4px; }
}
