/* payments.css — баланс, модалка пополнения, история платежей.
   Отдельный файл: не конфликтует со style.css кабинета. */

.pay-section[hidden] {
  display: none;
}

/* ---------- карточка баланса ---------- */

.balance-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  background: var(--panel, #12131a);
  border: 1px solid var(--line, #262a35);
  border-radius: var(--radius, 12px);
  padding: 24px 28px;
  margin-bottom: 24px;
}

.balance-label {
  font-size: 13px;
  color: var(--muted, #8b93a7);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.balance-value {
  font-family: "Space Grotesk", sans-serif;
  font-size: 40px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text, #e8eaf0);
}

.balance-meta {
  font-size: 13px;
  color: var(--muted, #8b93a7);
  margin-top: 6px;
}

/* ---------- модалка ---------- */

body.pay-modal-open {
  overflow: hidden;
}

.payment-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.payment-modal[hidden] {
  display: none;
}

.payment-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 5, 9, 0.78);
  backdrop-filter: blur(4px);
}

.payment-modal-card {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--panel, #12131a);
  border: 1px solid var(--line, #262a35);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  animation: pay-in 0.18s ease-out;
}

@keyframes pay-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.payment-modal-card h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 21px;
  margin: 0 0 20px;
  color: var(--text, #e8eaf0);
}

.payment-modal-x {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  color: var(--muted, #8b93a7);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.payment-modal-x:hover {
  color: var(--text, #e8eaf0);
  background: rgba(255, 255, 255, 0.06);
}

.pay-step-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted, #8b93a7);
  margin: 18px 0 10px;
}

.pay-step-label:first-child {
  margin-top: 0;
}

/* ---------- выбор провайдера ---------- */

.provider-grid {
  display: grid;
  gap: 10px;
}

.provider-btn {
  display: grid;
  grid-template-columns: 34px 1fr;
  grid-template-rows: auto auto;
  gap: 2px 12px;
  align-items: center;
  text-align: left;
  padding: 14px 16px;
  background: var(--panel-2, #191b24);
  border: 1px solid var(--line, #262a35);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  color: var(--text, #e8eaf0);
  font: inherit;
}

.provider-btn:hover {
  border-color: var(--accent, #7c8cff);
  transform: translateY(-1px);
}

.provider-btn.selected {
  border-color: var(--accent, #7c8cff);
  background: rgba(124, 140, 255, 0.1);
  box-shadow: 0 0 0 1px var(--accent, #7c8cff) inset;
}

.provider-icon {
  grid-row: 1 / 3;
  font-size: 24px;
  text-align: center;
}

.provider-name {
  font-weight: 600;
  font-size: 15px;
}

.provider-note {
  font-size: 12px;
  color: var(--muted, #8b93a7);
  line-height: 1.4;
}

/* ---------- сумма ---------- */

.amount-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.amount-btn {
  padding: 8px 16px;
  background: var(--panel-2, #191b24);
  border: 1px solid var(--line, #262a35);
  border-radius: 999px;
  color: var(--muted, #8b93a7);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  transition: border-color 0.15s, color 0.15s;
}

.amount-btn:hover,
.amount-btn.selected {
  border-color: var(--accent, #7c8cff);
  color: var(--text, #e8eaf0);
}

.amount-input {
  width: 100%;
  padding: 13px 16px;
  background: var(--panel-2, #191b24);
  border: 1px solid var(--line, #262a35);
  border-radius: 10px;
  color: var(--text, #e8eaf0);
  font: inherit;
  font-size: 17px;
  font-weight: 600;
}

.amount-input:focus {
  outline: none;
  border-color: var(--accent, #7c8cff);
}

.pay-submit {
  width: 100%;
  margin-top: 18px;
  text-align: center;
  display: block;
}

.pay-error {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  font-size: 13px;
}

/* ---------- созданный платёж ---------- */

.pay-created {
  text-align: center;
  padding: 6px 0 18px;
}

.pay-created-sum {
  font-family: "Space Grotesk", sans-serif;
  font-size: 34px;
  font-weight: 700;
  color: var(--text, #e8eaf0);
}

.pay-created-note {
  font-size: 13px;
  color: var(--muted, #8b93a7);
  margin-top: 4px;
}

/* ---------- таймер ---------- */

.timer-bar {
  height: 6px;
  background: var(--panel-2, #191b24);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line, #262a35);
}

.timer-bar-fill {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent, #7c8cff), #22d3ee);
  transition: width 1s linear;
}

.timer-label {
  text-align: center;
  font-size: 13px;
  color: var(--muted, #8b93a7);
  margin: 10px 0 18px;
}

.timer-label b {
  color: var(--text, #e8eaf0);
  font-variant-numeric: tabular-nums;
}

/* ---------- крипто-адрес ---------- */

.crypto-box {
  background: var(--panel-2, #191b24);
  border: 1px solid var(--line, #262a35);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 6px;
}

.crypto-label {
  font-size: 13px;
  color: var(--muted, #8b93a7);
  margin-bottom: 8px;
}

.crypto-label b {
  color: var(--text, #e8eaf0);
}

.crypto-addr {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  word-break: break-all;
  color: var(--accent, #7c8cff);
  background: rgba(0, 0, 0, 0.25);
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 10px;
}

.pay-waiting {
  text-align: center;
  font-size: 13px;
  color: var(--muted, #8b93a7);
  margin-top: 14px;
}

/* ---------- успех ---------- */

.pay-success {
  text-align: center;
  padding: 12px 0;
}

.pay-success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.5);
  color: #4ade80;
  font-size: 28px;
  line-height: 54px;
}

.pay-success-sum {
  font-family: "Space Grotesk", sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--text, #e8eaf0);
}

.pay-success-note {
  font-size: 13px;
  color: var(--muted, #8b93a7);
  margin-top: 4px;
}

/* ---------- история ---------- */

.payment-history {
  border: 1px solid var(--line, #262a35);
  border-radius: var(--radius, 12px);
  overflow: hidden;
}

.pay-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 12px;
  padding: 13px 18px;
  align-items: center;
  font-size: 14px;
  border-bottom: 1px solid var(--line, #262a35);
}

.pay-row:last-child {
  border-bottom: none;
}

.pay-head {
  background: var(--panel-2, #191b24);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted, #8b93a7);
}

.pay-date {
  color: var(--muted, #8b93a7);
  font-variant-numeric: tabular-nums;
}

.pay-amount {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.pay-crypto {
  display: block;
  font-style: normal;
  font-size: 11px;
  color: var(--muted, #8b93a7);
  font-weight: 400;
}

.pay-empty {
  padding: 26px 18px;
  text-align: center;
  color: var(--muted, #8b93a7);
  font-size: 14px;
}

/* ---------- статусы ---------- */

.status-paid,
.status-pending,
.status-failed,
.status-expired,
.status-refunded {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  justify-self: start;
  white-space: nowrap;
}

.status-paid {
  background: rgba(34, 197, 94, 0.14);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.status-pending {
  background: rgba(234, 179, 8, 0.14);
  color: #fbbf24;
  border: 1px solid rgba(234, 179, 8, 0.35);
}

.status-failed {
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.status-expired {
  background: rgba(139, 147, 167, 0.14);
  color: #a5adc0;
  border: 1px solid rgba(139, 147, 167, 0.3);
}

.status-refunded {
  background: rgba(56, 189, 248, 0.14);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

/* ---------- мобильные ---------- */

@media (max-width: 600px) {
  .balance-card {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .pay-row {
    grid-template-columns: 1fr 1fr;
    row-gap: 6px;
  }

  .pay-head {
    display: none;
  }

  .payment-modal-card {
    padding: 22px 18px;
  }
}

/* ---------- верхний блок баланса в кабинете ---------- */

.pay-topup-inline {
  margin-top: 12px;
  display: block;
  width: 100%;
}

.pay-balance-meta {
  font-size: 12px;
  color: var(--muted, #8b93a7);
  margin-top: 8px;
  line-height: 1.4;
}

.pay-history-panel[hidden] {
  display: none;
}
