/* ============================================================
   Billing + Pricing
   ============================================================ */

.pricing-page {
  padding: 3rem 0 4rem;
}

.pricing-page-header {
  text-align: center;
  margin-bottom: 2rem;
}

.billing-toggle {
  display: inline-flex;
  background: #f3f4f6;
  padding: 0.25rem;
  border-radius: 999px;
  gap: 0.25rem;
  margin-top: 1rem;
}

.billing-toggle-btn {
  border: none;
  background: transparent;
  color: #4b5563;
  border-radius: 999px;
  padding: 0.45rem 1rem;
  cursor: pointer;
  font-weight: 600;
}

.billing-toggle-btn.is-active {
  background: #111827;
  color: white;
}

.pricing-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.billing-status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  background: #f9fafb;
}

.billing-status-actions {
  display: flex;
  gap: 0.5rem;
}

.upgrade-banner {
  margin-bottom: 1rem;
  padding: 0.875rem 1rem;
  border: 1px solid #bfdbfe;
  border-radius: 0.75rem;
  background: #eff6ff;
  color: #1e3a8a;
}

.upgrade-banner a {
  color: #1d4ed8;
  font-weight: 600;
}

.form-help-text {
  margin-top: 0.5rem;
  color: #6b7280;
  font-size: 0.9rem;
}

.feature-comparison {
  margin-top: 2.5rem;
}

.comparison-table-wrap {
  overflow-x: auto;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
  padding: 0.8rem;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  white-space: nowrap;
}

.comparison-table th {
  background: #f9fafb;
}

.billing-warning {
  margin-top: 1rem;
  padding: 0.875rem 1rem;
  border: 1px solid #fde68a;
  border-radius: 0.75rem;
  color: #92400e;
  background: #fffbeb;
}

@media (max-width: 1080px) {
  .pricing-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .pricing-grid-2 {
    grid-template-columns: 1fr;
  }

  .billing-status-card,
  .billing-status-actions {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ============================================================
   Pro Billing Dashboard
   ============================================================ */
.pro-billing-dashboard {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.plan-header-card {
  background: white;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1));
}

.pro-badge {
  display: inline-block;
  background: var(--primary-50, #f0fdfa);
  color: var(--primary, #0f766e);
  font-weight: 700;
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.plan-header-card h2 {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 28px;
  color: var(--gray-900, #111827);
  margin: 0.5rem 0 0.25rem;
}

.plan-header-card .plan-price {
  color: var(--gray-500, #6b7280);
  font-size: 18px;
  margin: 0;
}

.plan-header-card .plan-renewal {
  color: var(--gray-400, #9ca3af);
  font-size: 14px;
  margin: 0.25rem 0 0;
}

.usage-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

.stat-card {
  background: var(--gray-50, #f9fafb);
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
}

.stat-card .stat-label {
  color: var(--gray-500, #6b7280);
  font-size: 13px;
  margin: 0 0 0.25rem;
}

.stat-card .stat-value {
  color: var(--gray-900, #111827);
  font-size: 24px;
  font-weight: 700;
  margin: 0;
}

.stat-card .stat-detail {
  color: var(--gray-400, #9ca3af);
  font-size: 13px;
  margin: 0.25rem 0 0;
}

.subscription-details-card {
  background: white;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1));
  margin-top: 1.5rem;
}

.subscription-details-card h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--gray-900, #111827);
  margin: 0 0 1rem;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--gray-100, #f3f4f6);
}

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

.detail-row .detail-label {
  color: var(--gray-500, #6b7280);
  font-size: 14px;
}

.detail-row .detail-value {
  color: var(--gray-900, #111827);
  font-weight: 500;
  font-size: 14px;
}

.status-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}

.status-badge.active {
  background: var(--success-light, #d1fae5);
  color: var(--success, #059669);
}

.status-badge.past-due {
  background: var(--warning-light, #fef3c7);
  color: var(--warning, #d97706);
}

.status-badge.cancelled {
  background: #fee2e2;
  color: var(--danger, #dc2626);
}

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

.btn-manage-billing {
  border: 1.5px solid var(--primary, #0f766e);
  color: var(--primary, #0f766e);
  background: white;
  border-radius: 8px;
  padding: 10px 20px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-manage-billing:hover {
  background: var(--primary-50, #f0fdfa);
}

/* Free user refinements */
.btn-current-plan-disabled {
  opacity: 0.6;
  pointer-events: none;
}

/* Responsive: Mobile */
@media (max-width: 768px) {
  .pro-billing-dashboard {
    padding: 1rem;
  }

  .usage-stats-row {
    grid-template-columns: 1fr;
  }

  .detail-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .billing-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-manage-billing {
    width: 100%;
    text-align: center;
  }

}
