/* ============================================================
   Billing Center — Premium Upgrade UI styles
   US-001: Dark cyberpunk theme pricing page
   ============================================================ */

/* ── Overlay (full-viewport, scrollable) ── */
.billing-center-overlay {
  position: fixed;
  inset: 0;
  z-index: 16000;
  background: rgba(11, 11, 13, 0.88);
  backdrop-filter: blur(3px);
  overflow-y: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px 60px;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
}

.billing-center-overlay.hidden {
  display: none;
}

/* ── Shell (centred card container) ── */
.billing-center-shell {
  width: 100%;
  max-width: 720px;
  background: var(--bg-surface, #131315);
  border: 1px solid var(--border-medium, #F08000);
  border-radius: var(--radius-lg, 10px);
  padding: 28px 30px 32px;
  box-shadow: var(--shadow-elevated);
  box-sizing: border-box;
}

@media (max-width: 600px) {
  .billing-center-shell {
    padding: 20px 16px 24px;
    border-radius: var(--radius-lg, 10px);
  }
}

/* ── Header (mirrors .dc-header pattern) ── */
.billing-center-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  margin-bottom: 24px;
}

.billing-center-header h2 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: 1.5px;
  color: var(--primary, #FFE030);
  text-shadow: none;
  flex: 1 1 auto;
}

@media (max-width: 560px) {
  .billing-center-header h2 {
    font-size: 1.25rem;
  }
}

.billing-close-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md, 7px);
  background: var(--bg-base, #0b0b0d);
  border: 1px solid var(--border-medium);
  color: var(--primary, #FFE030);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  font-size: 18px;
  line-height: 1;
  opacity: 0.9;
  flex-shrink: 0;
}

.billing-close-btn:hover,
.billing-close-btn:focus-visible {
  background: var(--bg-hover, rgba(26, 26, 30, 0.8));
  border-color: var(--primary, #FFE030);
  opacity: 1;
  transform: translateY(-1px);
}

.billing-close-btn:active {
  transform: translateY(0) scale(0.97);
}

/* ── Plan toggle (monthly / yearly radio-style bar) ── */
.billing-plan-toggle {
  display: flex;
  gap: 0;
  border: 1px solid var(--secondary-dim, rgba(240, 128, 0, 0.25));
  border-radius: var(--radius-md, 7px);
  overflow: hidden;
  margin-bottom: 24px;
  width: fit-content;
}

.billing-plan-toggle button {
  background: transparent;
  border: none;
  color: var(--text-secondary, #aaa);
  font-family: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.8px;
  padding: 9px 22px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
  text-transform: uppercase;
}

.billing-plan-toggle button:first-child {
  border-right: 1px solid var(--secondary-dim, rgba(240, 128, 0, 0.2));
}

.billing-plan-toggle button:hover {
  background: var(--primary-dim, rgba(255, 224, 48, 0.08));
  color: var(--primary, #FFE030);
}

.billing-plan-toggle .active,
.billing-plan-toggle button.active {
  background: var(--primary, #FFE030);
  color: var(--text-on-primary, #000);
  font-weight: 700;
}

/* ── Price card ── */
.billing-price-card {
  border: 1px solid var(--secondary-dim, rgba(240, 128, 0, 0.3));
  border-radius: var(--radius-lg, 10px);
  padding: 24px 26px;
  background: var(--bg-elevated, #1a1a1e);
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.billing-price-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary, #FFE030), var(--secondary, #F08000));
  opacity: 0.7;
}

.billing-price-card .plan-name {
  font-size: 1rem;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--secondary, #F08000);
  margin: 0 0 6px;
  font-weight: 600;
}

.billing-price-card .plan-price {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--primary, #FFE030);
  letter-spacing: 1px;
  margin: 0 0 4px;
  line-height: 1;
}

.billing-price-card .plan-price-sub {
  font-size: 0.65rem;
  color: var(--text-secondary, #aaa);
  letter-spacing: 0.8px;
  margin: 0 0 20px;
}

/* ── Subscribe CTA button ── */
.billing-price-card .subscribe-btn,
.subscribe-btn {
  display: inline-block;
  background: var(--primary, #FFE030);
  color: var(--text-on-primary, #000);
  border: none;
  border-radius: var(--radius-md, 7px);
  padding: 11px 28px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
  box-shadow: var(--shadow-glow);
  text-decoration: none;
}

.subscribe-btn:hover,
.subscribe-btn:focus-visible {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: var(--shadow-elevated);
}

.subscribe-btn:active {
  transform: translateY(0) scale(0.98);
}

.subscribe-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: none;
  transform: none;
}

/* ── Premium features heading (shown for active subscribers) ── */
.billing-features-heading {
  font-size: 0.82rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--secondary, #F08000);
  margin: 20px 0 4px;
  font-weight: 600;
}

/* ── Benefits list ── */
.billing-benefits-list {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
}

.billing-benefits-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 0;
  font-size: 0.78rem;
  letter-spacing: 0.5px;
  color: #d4d4d4;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.billing-benefits-list li:last-child {
  border-bottom: none;
}

.billing-benefits-list li::before {
  content: '✓';
  color: var(--primary, #FFE030);
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Subscription status banner (green for active subscribers) ── */
.billing-status-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--green-dim, rgba(74, 222, 128, 0.1));
  border: 1px solid var(--green, #4ade80);
  border-radius: var(--radius-md, 7px);
  padding: 14px 18px;
  margin-bottom: 20px;
  color: var(--green, #4ade80);
  font-size: 0.78rem;
  letter-spacing: 0.6px;
}

.billing-status-banner .status-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.billing-status-banner .status-detail {
  color: var(--text-secondary, #aaa);
  font-size: 0.68rem;
  margin-top: 3px;
}

/* ── Manage subscription button ── */
.billing-manage-btn {
  display: inline-block;
  background: transparent;
  color: var(--secondary, #F08000);
  border: 1px solid var(--secondary, #F08000);
  border-radius: var(--radius-md, 7px);
  padding: 10px 22px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.15s ease;
  text-decoration: none;
}

.billing-manage-btn:hover,
.billing-manage-btn:focus-visible {
  background: var(--secondary-dim, rgba(240, 128, 0, 0.15));
  color: #fff;
  transform: translateY(-1px);
}

.billing-manage-btn:active {
  transform: translateY(0);
}

.billing-manage-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ── Manage actions layout (change + cancel buttons) ── */
.billing-manage-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── Cancel subscription button ── */
.billing-cancel-btn {
  display: inline-block;
  background: transparent;
  color: var(--danger, #ff6b6b);
  border: 1px solid var(--danger-dim, rgba(255, 107, 107, 0.35));
  border-radius: var(--radius-md, 7px);
  padding: 10px 22px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.15s ease;
  text-decoration: none;
}

.billing-cancel-btn:hover,
.billing-cancel-btn:focus-visible {
  background: var(--danger-dim, rgba(255, 107, 107, 0.1));
  color: var(--danger, #ff6b6b);
  transform: translateY(-1px);
}

.billing-cancel-btn:active {
  transform: translateY(0);
}

/* ── Legal / Certification tier callout ── */
.billing-legal-tier {
  margin-top: 28px;
  padding: 16px 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md, 7px);
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.72rem;
  letter-spacing: 0.6px;
  color: var(--text-secondary, #aaa);
  text-align: center;
}

.billing-legal-tier a {
  color: var(--secondary, #F08000);
  text-decoration: underline;
}

.billing-legal-tier a:hover {
  color: var(--primary, #FFE030);
}

/* ── Error message ── */
.billing-error-msg {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--danger-dim, rgba(255, 107, 107, 0.1));
  border: 1px solid var(--danger, #ff6b6b);
  border-radius: var(--radius-md, 7px);
  padding: 12px 14px;
  margin-bottom: 16px;
  color: var(--danger, #ff6b6b);
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  line-height: 1.45;
}

.billing-error-msg.hidden {
  display: none;
}

/* ── Loading state / spinner ── */
.billing-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px 0;
  color: var(--text-secondary, #aaa);
  font-size: 0.72rem;
  letter-spacing: 0.8px;
}

.billing-loading.hidden {
  display: none;
}

.billing-loading::before {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid var(--primary-dim, rgba(255, 224, 48, 0.2));
  border-top-color: var(--primary, #FFE030);
  border-radius: 50%;
  animation: billing-spin 0.75s linear infinite;
  flex-shrink: 0;
}

@keyframes billing-spin {
  to { transform: rotate(360deg); }
}

/* ── Divider ── */
.billing-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 24px 0;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .billing-loading::before {
    animation: none;
    border-top-color: var(--primary, #FFE030);
  }

  .subscribe-btn,
  .billing-manage-btn,
  .billing-close-btn {
    transition: none !important;
  }
}
