/* ── Billing UI ── */

.billing-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.billing-modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  max-width: 540px;
  width: 90vw;
  overflow-y: auto;
  max-height: 90vh;
  position: relative;
}

.billing-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.billing-modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.billing-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.billing-modal-close:hover {
  background: var(--border);
  color: var(--text);
}

/* Provider selection */
.billing-provider-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.billing-provider-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  flex: 1;
  min-width: 140px;
  transition: border-color 0.2s;
}

.billing-provider-card:hover,
.billing-provider-card.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.billing-provider-card h4 {
  margin: 0 0 6px 0;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.billing-provider-card p {
  margin: 0;
  font-size: 12px;
  color: var(--text2);
}

.billing-provider-badge {
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  border-radius: 10px;
  padding: 2px 8px;
  font-weight: 600;
}

/* Steps */
.billing-step {
  display: none;
}

.billing-step.active {
  display: block;
}

.billing-back-link {
  color: var(--text2);
  cursor: pointer;
  font-size: 13px;
  margin-top: 16px;
  display: inline-block;
}

.billing-back-link:hover {
  color: var(--text);
}

/* Stripe */
.stripe-card-element {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}

.stripe-error {
  color: var(--red);
  font-size: 13px;
  margin-top: 8px;
}

/* NOWPayments */
.np-address {
  font-family: monospace;
  background: var(--bg3);
  padding: 12px 16px;
  border-radius: 8px;
  word-break: break-all;
  font-size: 13px;
  color: var(--text);
  border: 1px solid var(--border);
}

.np-copy-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  color: var(--text2);
  cursor: pointer;
  font-size: 12px;
}

.np-copy-btn:hover {
  background: var(--border);
  color: var(--text);
}

.np-qr-container {
  display: flex;
  justify-content: center;
  margin: 16px auto;
}

.np-status-pulse {
  animation: billing-pulse 2s ease-in-out infinite;
}

@keyframes billing-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Paywall */
.paywall-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Settings cards */
.billing-plan-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
}

.billing-trial-progress {
  height: 6px;
  background: var(--bg3);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}

.billing-trial-progress-fill {
  background: var(--accent);
  border-radius: 3px;
  height: 100%;
  transition: width 0.3s;
}

/* History table */
.billing-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.billing-history-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
}

.billing-history-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text2);
}

.billing-history-table tr:last-child td {
  border-bottom: none;
}

/* Status badges */
.billing-status-badge {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.billing-status-badge.paid {
  background: rgba(46,204,113,0.15);
  color: var(--green);
}

.billing-status-badge.failed {
  background: rgba(231,76,60,0.15);
  color: var(--red);
}

.billing-status-badge.pending {
  background: rgba(243,156,18,0.15);
  color: var(--orange);
}

/* Trial banner */
.billing-trial-banner {
  background: var(--bg3);
  border: 1px solid var(--orange);
  border-radius: 8px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.billing-trial-banner span {
  font-size: 13px;
  color: var(--text);
}

.billing-trial-banner a {
  color: var(--accent);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.billing-trial-banner button {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 16px;
  padding: 0 4px;
}

/* Loading state */
.billing-btn-loading {
  opacity: 0.7;
  pointer-events: none;
}

@media (max-width: 640px) {
  .billing-provider-cards {
    flex-direction: column;
  }

  .billing-modal {
    padding: 20px;
  }

  .billing-history-table th:nth-child(2),
  .billing-history-table td:nth-child(2) {
    display: none;
  }
}
