/* ===== PaySync — светлый минималистичный эквайринг ===== */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #1a1d24;
  --muted: #8b94a3;
  --border: #e6e9ef;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --green: #16a34a;
  --red: #dc2626;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 4px 24px rgba(20, 30, 60, 0.08);
  --shadow-lg: 0 12px 40px rgba(20, 30, 60, 0.12);
  --font: -apple-system, "Segoe UI", "Inter", system-ui, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

body.light-theme {
  background: linear-gradient(180deg, #f4f6f9 0%, #eef1f6 100%);
  min-height: 100vh;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* ===== Оболочка ===== */
.pay-shell {
  width: 100%;
  max-width: 420px;
}

.pay-card-wrap {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 36px 32px 28px;
  box-shadow: var(--shadow-lg);
}

/* ===== Логотип ===== */
.brand-logo {
  text-align: center;
  margin-bottom: 24px;
}
.brand-logo img {
  height: 40px;
  width: auto;
  display: inline-block;
}

/* ===== Сумма ===== */
.pay-amount-block {
  text-align: center;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.pay-amount {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
}
.pay-amount-value {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--text);
}
.pay-amount-cur {
  font-size: 18px;
  font-weight: 600;
  color: var(--muted);
}
.pay-merchant {
  margin-top: 6px;
  font-size: 14px;
  color: var(--muted);
}

/* ===== Форма ===== */
.pay-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.pf-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.pf-field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.pf-row {
  display: flex;
  gap: 12px;
}
.pf-row .pf-field { flex: 1; }

.pf-input-wrap { position: relative; }

.pay-form input {
  width: 100%;
  background: #f8fafc;
  border: 1.5px solid var(--border);
  color: var(--text);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: var(--mono);
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
  letter-spacing: 0.5px;
}
.pay-form input::placeholder {
  color: #c2c8d4;
  letter-spacing: 0.5px;
}
.pay-form input:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.pf-brand-icons {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 4px;
  pointer-events: none;
}
.pf-brand-icons .brand-icon { height: 20px; width: auto; }

/* ===== Кнопка ===== */
.pf-pay-btn {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 16px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .15s;
  margin-top: 4px;
}
.pf-pay-btn:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.3);
}
.pf-pay-btn:active { transform: scale(0.99); }
.pf-pay-btn:disabled {
  background: #b8bcc8;
  cursor: not-allowed;
  box-shadow: none;
}

/* ===== Статус ===== */
.pf-status {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  text-align: center;
  display: none;
}
.pf-status:not([hidden]) { display: block; }
.pf-status.ok {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.pf-status.error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* ===== Безопасность ===== */
.pf-secure {
  margin-top: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.pf-secure svg { color: var(--green); }

/* ===== Оверлей обработки ===== */
.pf-overlay {
  position: fixed;
  inset: 0;
  background: rgba(244, 246, 249, 0.92);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn .25s ease;
}
.pf-overlay:not([hidden]) { display: flex; }
.pf-overlay[hidden] { display: none !important; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.pf-overlay-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  max-width: 320px;
  padding: 0 24px;
}

.pf-spinner-wrap {
  position: relative;
  width: 64px;
  height: 64px;
}
.pf-spinner {
  width: 64px;
  height: 64px;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.pf-overlay-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
.pf-overlay-step {
  font-size: 14px;
  color: var(--muted);
  min-height: 20px;
  transition: opacity .3s;
}

.pf-overlay-dots {
  display: flex;
  gap: 6px;
}
.pf-overlay-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.3;
  animation: dotPulse 1.4s ease-in-out infinite;
}
.pf-overlay-dots .dot:nth-child(2) { animation-delay: 0.2s; }
.pf-overlay-dots .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotPulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.1); }
}

/* ===== Адаптив ===== */
@media (max-width: 480px) {
  body.light-theme { padding: 12px; }
  .pay-card-wrap { padding: 28px 22px 22px; }
  .pay-amount-value { font-size: 32px; }
  .pf-row { flex-direction: column; gap: 18px; }
}
