:root {
  --alfa-red: #DC2A22;
  --alfa-red-soft: #FCE9E8;
  --alfa-red-press: #B81F19;
  --bg: #f4f7fb;
  --card: #ffffff;
  --ink: #000000;
  --ink-soft: #64748b;
  --label: #8b95a1;
  --field-bg: #f2f5f7;
  --line: rgba(15, 23, 42, 0.08);
  --danger: #e11d48;
  --radius-card: 28px;
  --radius-field: 12px;
  --radius-btn: 12px;
  --shadow: 0 24px 60px rgba(220, 42, 34, 0.12), 0 8px 24px rgba(15, 23, 42, 0.06);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
}

body {
  position: relative;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(ellipse 70% 55% at 90% 8%, rgba(220, 42, 34, 0.12), transparent 58%),
    radial-gradient(ellipse 55% 50% at 0% 92%, rgba(184, 31, 25, 0.08), transparent 55%),
    radial-gradient(ellipse 45% 40% at 50% 0%, rgba(220, 42, 34, 0.06), transparent 52%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.page-glow {
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(80px);
}

.page-glow-primary {
  top: 8%;
  right: -10%;
  width: min(520px, 85vw);
  height: min(520px, 85vw);
  background: radial-gradient(circle, rgba(220, 42, 34, 0.14) 0%, transparent 68%);
}

.page-glow-secondary {
  left: -14%;
  bottom: 10%;
  width: min(420px, 70vw);
  height: min(420px, 70vw);
  background: radial-gradient(circle, rgba(220, 42, 34, 0.08) 0%, transparent 68%);
}

.page-glow-soft {
  top: 42%;
  left: -18%;
  width: min(440px, 72vw);
  height: min(440px, 72vw);
  background: radial-gradient(circle, rgba(220, 42, 34, 0.06) 0%, transparent 68%);
  opacity: 0.75;
}

.deco {
  position: fixed;
  pointer-events: none;
  z-index: 0;
}

.deco-card {
  top: 18%;
  left: 4%;
  width: 120px;
  height: 76px;
  border-radius: 12px;
  background: linear-gradient(135deg, #DC2A22 0%, #B81F19 100%);
  box-shadow: 0 20px 40px rgba(220, 42, 34, 0.35);
  transform: rotate(-18deg);
  opacity: 0.85;
}

.deco-card::before {
  content: "";
  position: absolute;
  top: 28px;
  left: 16px;
  width: 28px;
  height: 22px;
  border-radius: 4px;
  background: linear-gradient(135deg, #d4af37, #f5e6a3);
}

.deco-lock {
  top: 12%;
  right: 8%;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(145deg, #f08a82, #DC2A22);
  box-shadow: 0 16px 32px rgba(220, 42, 34, 0.35);
  transform: rotate(12deg);
}

.deco-star {
  bottom: 22%;
  left: 8%;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #DC2A22, #E0B020);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  box-shadow: 0 12px 28px rgba(220, 42, 34, 0.3);
}

.deco-sphere {
  bottom: 14%;
  right: 6%;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #f08a82, #DC2A22 60%, #B81F19);
  box-shadow: 0 24px 48px rgba(220, 42, 34, 0.25);
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 16px 28px;
}

.site-header {
  width: 100%;
  max-width: 480px;
  padding: 8px 4px 20px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: contain;
  flex: 0 0 auto;
  box-shadow: 0 6px 16px rgba(220, 42, 34, 0.18);
}

.logo-text {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

.logo-alfa {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.card-logo-img,
.receipt-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: contain;
  display: block;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.28);
}

.receipt-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.logo-bank {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
}

.shell {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pay-card {
  background: var(--card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 28px 28px 22px;
  animation: rise 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.pay-card[data-state="loading"] {
  animation: none;
  background: transparent;
  box-shadow: none;
  padding: 0;
  min-height: min(70dvh, 520px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.page:has(.pay-card[data-state="loading"]) .site-header {
  visibility: hidden;
}

.boot-alfa-logo {
  width: 104px;
  height: 104px;
  object-fit: contain;
  border-radius: 22px;
  display: block;
}

.bank-loader {
  display: none;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.progress-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.progress-track {
  height: 4px;
  border-radius: 999px;
  background: #e8edf3;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: var(--alfa-red);
  transform-origin: left center;
  transition: transform 200ms linear;
}

.timer {
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  min-width: 42px;
  text-align: right;
}

.pay-title {
  margin: 0 0 16px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--ink);
}

.amount-row {
  margin-bottom: 20px;
}

.amount-label {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
}

.amount-value {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--ink);
}

.mir-logo {
  display: block;
  object-fit: contain;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-3d-wrap {
  perspective: 1200px;
  width: 100%;
  max-width: 350px;
  margin: 0 auto 4px;
  min-height: 202px;
}

.card-3d {
  position: relative;
  width: 100%;
  min-height: 200px;
  transform-style: preserve-3d;
  transition: transform 0.7s ease;
}

.card-3d.flipped {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  padding: 18px 20px;
  min-height: 200px;
  color: #fff;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 18px 40px rgba(220, 42, 34, 0.28);
}

.card-3d .card-front,
.card-3d .card-back {
  background: linear-gradient(135deg, #E63A32 0%, #DC2A22 42%, #B81F19 100%);
}

.card-front {
  z-index: 2;
  display: flex;
  flex-direction: column;
}

.card-back {
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  padding: 0;
}

.card-back__stripe {
  margin-top: 24px;
  width: 100%;
  height: 44px;
  background: rgba(0, 0, 0, 0.75);
}

.card-back__content {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 20px 18px;
}

.card-back__cvv-block {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.card-back__cvv {
  width: 100%;
  max-width: 112px;
  background: #f8fafc;
  color: #0f172a;
  border-radius: 10px;
  padding: 9px 12px;
  text-align: right;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 2px;
}

.card-meta-label {
  font-size: 10px;
  opacity: 0.78;
  margin-bottom: 4px;
  letter-spacing: 0.06em;
}

.card-meta-label.dark {
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 6px;
}

.card-meta-value {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.visual-card__top {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.card-logo {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  color: #fff;
}

.card-logo-alfa {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.card-logo-bank {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
}

.visual-card__bottom {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.visual-card__spacer {
  display: none;
}

.visual-card__number {
  margin: 28px 0 24px;
  font-size: clamp(20px, 5vw, 24px);
  font-weight: 800;
  letter-spacing: 1.5px;
  font-variant-numeric: tabular-nums;
}

.visual-card__mir {
  display: block;
  filter: brightness(0) invert(1);
  opacity: 0.95;
}

.visual-card__mir-back {
  align-self: flex-end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-float .field-control {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--field-bg);
  border: 1.5px solid transparent;
  border-radius: var(--radius-field);
  padding: 10px 44px 10px 14px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.field-float:focus-within .field-control {
  border-color: var(--alfa-red);
  box-shadow: 0 0 0 3px rgba(220, 42, 34, 0.12);
  background: #fff;
}

.field-float .field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--label);
  padding: 0;
  text-transform: none;
  letter-spacing: normal;
}

.field-float input {
  width: 100%;
  height: auto;
  min-height: 24px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  font: 600 16px/1.25 var(--font);
  color: var(--ink);
  outline: none;
}

.field-float input::placeholder {
  color: #b0b8c4;
  font-weight: 500;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field-row .field-float .field-control {
  padding-right: 14px;
}

.field-row .field:last-child .field-float .field-control {
  padding-right: 44px;
}

.field-icon,
.field-icon-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  color: #94a3b8;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.field-icon svg,
.field-icon-btn svg {
  width: 20px;
  height: 20px;
}

.field-icon-btn {
  pointer-events: auto;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.field-icon-btn .hidden {
  display: none;
}

.secure-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--alfa-red-soft);
  flex-wrap: nowrap;
}

.secure-left {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}

.secure-shield {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
}

.secure-shield svg {
  width: 100%;
  height: 100%;
  display: block;
}

.secure-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.secure-copy strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--alfa-red);
}

.secure-copy span {
  font-size: 11px;
  line-height: 1.35;
  color: var(--ink-soft);
  font-weight: 500;
}

.verified-mir {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 52px;
  align-self: center;
}

.mir-logo-verified {
  width: 48px;
  height: 15px;
}

.verified-mir small {
  font-size: 8px;
  font-weight: 600;
  color: var(--ink-soft);
}

.form-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff1f2;
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
}

.form-error.hidden {
  display: none;
}

.card-hint {
  display: block;
  margin-top: 4px;
  padding-left: 2px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
}

.card-hint.hint-error {
  color: var(--danger);
}

.card-hint:empty {
  display: none;
}

.sms-form {
  width: 100%;
  margin-top: 8px;
}

.sms-form #otp {
  letter-spacing: 0.28em;
  text-align: center;
  font-weight: 700;
}

.challenge-wrap {
  width: 100%;
  min-height: 360px;
  margin-top: 8px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
}

.challenge-wrap iframe {
  width: 100%;
  height: 100%;
  min-height: 360px;
  border: 0;
}

.dc-pay-shell {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(8px);
}

.dc-pay-shell.is-hidden {
  display: none !important;
}

.dc-pay-shell.is-visible {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}

.dc-pay-shell.is-visible iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.pay-btn {
  margin-top: 4px;
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: var(--radius-btn);
  background: var(--alfa-red);
  color: #fff;
  font: 600 16px/1 var(--font);
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(220, 42, 34, 0.28);
  transition:
    transform 140ms ease,
    background-color 140ms ease,
    box-shadow 140ms ease;
}

.pay-btn:hover {
  background: #E63A32;
}

.pay-btn:active {
  transform: translateY(1px);
  background: var(--alfa-red-press);
  box-shadow: 0 4px 16px rgba(220, 42, 34, 0.22);
}

.pay-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 500;
}

.footer-secure {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--alfa-red);
}

.footer-secure svg {
  width: 15px;
  height: 15px;
}

.footer-brands {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  opacity: 0.6;
}

.hidden {
  display: none !important;
}

.view.hidden {
  display: none !important;
}

.view-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 28px 8px 18px;
  min-height: 420px;
  justify-content: center;
  animation: rise 360ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.status-title {
  margin: 4px 0 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.status-text {
  margin: 0;
  max-width: 28ch;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink-soft);
}

.status-orb {
  position: relative;
  width: 96px;
  height: 96px;
  margin-bottom: 6px;
}

.status-orb__core {
  position: absolute;
  inset: 28px;
  border-radius: 50%;
  background: var(--alfa-red);
  box-shadow: 0 10px 28px rgba(220, 42, 34, 0.28);
}

.status-orb__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(220, 42, 34, 0.22);
}

.status-orb__ring.ring-a {
  animation: pulseRing 1.8s infinite ease-out;
}

.status-orb__ring.ring-b {
  animation: pulseRing 1.8s infinite ease-out 0.55s;
}

@keyframes pulseRing {
  0% {
    transform: scale(0.72);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.18);
    opacity: 0;
  }
}

.pulse-bars {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.pulse-bars span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--alfa-red);
  animation: barPulse 1.1s ease-in-out infinite;
}

.pulse-bars span:nth-child(2) {
  animation-delay: 0.15s;
}

.pulse-bars span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes barPulse {
  0%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.status-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
}

.status-icon svg {
  width: 34px;
  height: 34px;
}

.status-icon.success {
  background: #e8f7ef;
  color: #16a34a;
}

.status-icon.warn {
  background: #fff4e8;
  color: #ea580c;
}

.status-icon.error,
.status-icon.expired {
  background: #fef2f2;
  color: #dc2626;
}

.info-list {
  width: 100%;
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--field-bg);
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.info-row span {
  color: var(--ink-soft);
  font-weight: 500;
}

.info-row strong {
  color: var(--ink);
  font-weight: 600;
}

.info-row strong.ok {
  color: #16a34a;
}

.receipt {
  width: 100%;
  max-width: 350px;
  margin: 4px auto 0;
  padding: 18px 16px 16px;
  border-radius: 16px;
  background: linear-gradient(160deg, #DC2A22, #B81F19 55%, #8F1813);
  color: #fff;
  text-align: left;
  aspect-ratio: 1.586 / 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
}

.receipt-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #fff;
}

.receipt-brand-alfa {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.receipt-brand-bank {
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
}

.receipt-mask {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.receipt-holder {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.72;
}

.receipt-amount {
  margin-top: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.preview-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.preview-nav a {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(220, 42, 34, 0.14);
  color: var(--alfa-red);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
}

.preview-nav a:hover,
.preview-nav a.is-active {
  background: var(--alfa-red);
  border-color: var(--alfa-red);
  color: #fff;
}

@media (max-width: 640px) {
  .page-glow-primary {
    top: 4%;
    right: -24%;
    opacity: 0.95;
  }

  .page-glow-secondary {
    left: -22%;
    bottom: 6%;
    opacity: 0.9;
  }

  .page-glow-soft {
    top: 38%;
    left: -24%;
    opacity: 0.85;
  }

  .deco-card {
    top: 10%;
    left: -6%;
    width: 96px;
    height: 60px;
    opacity: 0.75;
    transform: rotate(-18deg);
  }

  .deco-lock {
    top: 7%;
    right: 3%;
    width: 48px;
    height: 48px;
    opacity: 0.8;
  }

  .deco-star {
    bottom: 20%;
    left: 3%;
    width: 40px;
    height: 40px;
    opacity: 0.8;
  }

  .deco-sphere {
    bottom: 14%;
    right: -8%;
    width: 80px;
    height: 80px;
    opacity: 0.75;
  }
}

@media (max-width: 480px) {
  .pay-card {
    padding: 22px 18px 18px;
  }

  .pay-title {
    font-size: 24px;
  }

  .amount-value {
    font-size: 28px;
  }

  .secure-box {
    gap: 8px;
    padding: 10px 12px;
  }

  .secure-shield {
    width: 24px;
    height: 24px;
  }

  .secure-copy strong {
    font-size: 12px;
  }

  .secure-copy span {
    font-size: 10px;
    line-height: 1.3;
  }

  .verified-mir {
    min-width: 46px;
  }

  .mir-logo-verified {
    width: 42px;
    height: 13px;
  }
}

@media (max-width: 520px) {
  .challenge-wrap,
  .challenge-wrap iframe {
    min-height: 55vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pay-card,
  .progress-fill,
  .pay-btn,
  .status-orb__ring,
  .pulse-bars span {
    animation: none;
    transition: none;
  }
}

.pay-card[data-state="notfound"],
.pay-card[data-state="error"],
.pay-card[data-state="expired"],
.pay-card[data-state="success"],
.pay-card[data-state="processing"],
.pay-card[data-state="loading"],
.pay-card[data-state="sms"] {
  min-height: 460px;
}

.pay-card[data-state="challenge"] {
  min-height: 520px;
}
