/* payment-widget.css — стили виджета оплаты Optima QR (bumaga.kg)
   Мобильно-адаптивно. Префикс всех классов — .opw. Без внешних зависимостей. */

.opw {
  --opw-accent: #1f7a3d;
  --opw-accent-dark: #155c2c;
  --opw-bg: #ffffff;
  --opw-fg: #1c1c1c;
  --opw-muted: #6b7280;
  --opw-border: #e5e7eb;
  --opw-fail: #c0392b;
  box-sizing: border-box;
  max-width: 420px;
  margin: 0 auto;
  padding: 24px 20px;
  background: var(--opw-bg);
  color: var(--opw-fg);
  border: 1px solid var(--opw-border);
  border-radius: 14px;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  text-align: center;
}
.opw *, .opw *::before, .opw *::after { box-sizing: border-box; }

.opw__title { margin: 0 0 12px; font-size: 19px; font-weight: 700; }
.opw__hint { margin: 8px 0 0; color: var(--opw-muted); font-size: 14px; line-height: 1.4; }
.opw__amount { margin: 0 0 16px; font-size: 15px; color: var(--opw-muted); }
.opw__amount strong { color: var(--opw-fg); font-size: 18px; }

/* QR */
.opw__qrbox {
  display: flex; align-items: center; justify-content: center;
  padding: 16px; background: #fff; border: 1px solid var(--opw-border);
  border-radius: 12px; margin: 0 auto 14px; width: 268px; height: 268px;
}
.opw__qr { width: 236px; height: 236px; image-rendering: pixelated; }

/* Таймер */
.opw__timer { font-size: 14px; color: var(--opw-muted); margin-bottom: 18px; }
.opw__timer-val { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--opw-fg); }

/* Банки */
.opw__banks-hint { margin: 0 0 10px; font-size: 13px; color: var(--opw-muted); }
.opw__banks {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  gap: 10px; margin-bottom: 16px;
}
.opw__bank {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 6px; text-decoration: none; color: var(--opw-fg);
  border: 1px solid var(--opw-border); border-radius: 10px; transition: border-color .15s, transform .1s;
}
.opw__bank:hover { border-color: var(--opw-accent); }
.opw__bank:active { transform: scale(0.97); }
.opw__bank-icon { width: 40px; height: 40px; border-radius: 9px; object-fit: contain; background: #f3f4f6; }
.opw__bank-icon--ph {
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: #fff; background: var(--opw-accent);
}
.opw__bank-name { font-size: 12px; line-height: 1.2; }

.opw__status { margin: 4px 0 0; font-size: 13px; color: var(--opw-muted); }

/* Кнопки */
.opw__btn {
  margin-top: 18px; padding: 12px 22px; font-size: 15px; font-weight: 600;
  color: #fff; background: var(--opw-accent); border: none; border-radius: 10px; cursor: pointer;
}
.opw__btn:hover { background: var(--opw-accent-dark); }

/* Результаты */
.opw--result { padding-top: 32px; padding-bottom: 32px; }
.opw__icon { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; position: relative; }
.opw__icon--completed { background: #e7f6ec; }
.opw__icon--completed::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 11px; height: 21px;
  border: solid var(--opw-accent); border-width: 0 4px 4px 0;
  /* центр круга + поправка -60% по Y: оптически выравнивает галочку по центру */
  transform: translate(-50%, -60%) rotate(45deg);
}
.opw__icon--failed, .opw__icon--timeout { background: #fdeaea; }
.opw__icon--failed::after, .opw__icon--timeout::after {
  content: "!"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 34px; font-weight: 800; color: var(--opw-fail);
}

/* Спиннер загрузки */
.opw--loading { padding: 40px 20px; }
.opw__spinner {
  width: 40px; height: 40px; margin: 0 auto 14px; border-radius: 50%;
  border: 4px solid var(--opw-border); border-top-color: var(--opw-accent);
  animation: opw-spin 0.9s linear infinite;
}
@keyframes opw-spin { to { transform: rotate(360deg); } }

@media (max-width: 460px) {
  .opw { border: none; border-radius: 0; max-width: 100%; }
  .opw__qrbox { width: 240px; height: 240px; }
  .opw__qr { width: 208px; height: 208px; }
}
