/* ============================================
   BILLING COMPONENTS
   Paywall, plan cards, usage bars, banners
   Matches Editorial Clarity Design System
   ============================================ */

/* --- Paywall Page Layout --- */

.paywall-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.paywall-header {
  text-align: center;
  margin-bottom: 3rem;
}

.paywall-title {
  font-size: 2.25rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.025em;
}

.paywall-subtitle {
  font-size: 1.125rem;
  color: #6b7280;
  margin: 0 auto;
  max-width: 500px;
  line-height: 1.6;
}

.paywall-plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.paywall-footer {
  text-align: center;
  color: #9ca3af;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
}

@media (max-width: 900px) {
  .paywall-plans {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* --- Plan Card --- */

.plan-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.plan-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: #d1d5db;
}

.plan-card--popular {
  border: 2px solid #2563eb;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.12);
}

.plan-card--popular:hover {
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.18);
  border-color: #2563eb;
}

.plan-card-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: #2563eb;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 1rem;
  border-radius: 9999px;
  letter-spacing: 0.025em;
  white-space: nowrap;
}

.plan-card-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 0.75rem 0;
}

.plan-card-price {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #f3f4f6;
}

.plan-card-price-amount {
  font-size: 2.5rem;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.025em;
}

.plan-card-price-period {
  font-size: 0.875rem;
  color: #6b7280;
}

.plan-card-features {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.plan-card-feature {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #374151;
  line-height: 1.4;
}

.plan-card-feature-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #16a34a;
}

.plan-card-feature--disabled {
  color: #9ca3af;
}

.plan-card-feature--disabled .plan-card-feature-icon {
  color: #d1d5db;
}

.plan-card-cta {
  width: 100%;
  display: flex;
  justify-content: center;
}

.plan-card-cta .dash-btn-primary,
.plan-card-cta .dash-btn-secondary {
  width: 100%;
  justify-content: center;
  text-align: center;
  padding: 0.625rem 1.25rem;
}

/* --- Usage Progress Bar --- */

.billing-usage-item {
  margin-bottom: 1rem;
}

.billing-usage-item:last-child {
  margin-bottom: 0;
}

.billing-usage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.375rem;
}

.billing-usage-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
}

.billing-usage-value {
  font-size: 0.875rem;
  color: #6b7280;
  font-variant-numeric: tabular-nums;
}

.billing-usage-bar {
  width: 100%;
  height: 8px;
  background-color: #f3f4f6;
  border-radius: 9999px;
  overflow: hidden;
}

.billing-usage-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.3s ease;
  min-width: 2px;
}

.billing-usage-bar-fill--low {
  background-color: #16a34a;
}

.billing-usage-bar-fill--medium {
  background-color: #eab308;
}

.billing-usage-bar-fill--high {
  background-color: #dc2626;
}

/* --- Plan Badge --- */

.billing-plan-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.billing-plan-badge--trial {
  background: #dbeafe;
  color: #1e40af;
}

.billing-plan-badge--starter {
  background: #dcfce7;
  color: #166534;
}

.billing-plan-badge--growth {
  background: #ede9fe;
  color: #5b21b6;
}

.billing-plan-badge--scale {
  background: #fef3c7;
  color: #92400e;
}

.billing-plan-badge--admin {
  background: #111827;
  color: #ffffff;
}

/* --- Past Due Banner --- */

.billing-banner-past-due {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  margin-bottom: 1.5rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 4px solid #dc2626;
  border-radius: 8px;
  color: #991b1b;
  font-size: 0.875rem;
  font-weight: 500;
}

.billing-banner-past-due-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.billing-banner-past-due-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* --- Sidebar Trial Banner --- */

.sidebar-trial-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.75rem;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  font-size: 0.8125rem;
  color: #1e40af;
  text-decoration: none;
  transition: all 0.15s ease;
}

.sidebar-trial-banner:hover {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border-color: #93c5fd;
  color: #1e40af;
}

.sidebar-trial-banner-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.sidebar-trial-banner-days {
  font-weight: 700;
}

.sidebar-trial-banner-arrow {
  margin-left: auto;
  font-weight: 500;
}

/* Collapsed sidebar: hide text, show only icon */
.sidebar.sidebar-collapsed .sidebar-trial-banner {
  padding: 0.5rem;
  justify-content: center;
}

.sidebar.sidebar-collapsed .sidebar-trial-banner-text,
.sidebar.sidebar-collapsed .sidebar-trial-banner-arrow {
  display: none;
}

/* --- Billing Section in Settings --- */

.billing-section-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 0.75rem 0;
}

.billing-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.5rem;
}

@media (max-width: 480px) {
  .billing-actions {
    flex-direction: column;
  }

  .billing-actions .dash-btn-primary,
  .billing-actions .dash-btn-secondary {
    width: 100%;
    justify-content: center;
  }
}
