/* ==========================================================================
   BUSIFY — GROUP 6: PRICING, CHECKOUT, BILLING, SUBSCRIPTION, LEGAL, ERRORS
   Loaded alongside pages.css/modules.css; reuses existing tokens throughout.
   ========================================================================== */

/* ---------- Billing cycle toggle ---------- */
.cycle-toggle {
  display: inline-flex;
  gap: 2px;
  background: var(--color-border-subtle);
  border-radius: var(--radius-full);
  padding: 3px;
  margin: 0 auto var(--space-8);
}
.cycle-toggle button {
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-size: var(--text-small);
  font-weight: 600;
  color: var(--color-text-secondary);
}
.cycle-toggle button.is-active { background: var(--color-surface); color: var(--color-text-primary); box-shadow: var(--shadow-xs); }
.cycle-toggle .savings-tag { font-size: 11px; color: var(--color-success); font-weight: 700; margin-left: 4px; }

/* ---------- Feature comparison table ---------- */
.comparison-table-wrap { overflow-x: auto; }
.comparison-table { width: 100%; min-width: 560px; border-collapse: collapse; }
.comparison-table th, .comparison-table td {
  padding: var(--space-3) var(--space-4);
  text-align: center;
  border-bottom: 1px solid var(--color-border-subtle);
  font-size: var(--text-small);
}
.comparison-table th:first-child, .comparison-table td:first-child { text-align: left; font-weight: 600; }
.comparison-table thead th { font-size: var(--text-caption); text-transform: uppercase; color: var(--color-text-muted); }
.comparison-table .check-yes { color: var(--color-success); }
.comparison-table .check-no { color: var(--color-border); }

/* ---------- Choose plan page ---------- */
.plan-select-card { position: relative; cursor: pointer; transition: transform var(--duration-fast) var(--ease-standard); }
.plan-select-card:hover { transform: translateY(-2px); }
.plan-select-card.is-selected { border-color: var(--color-primary); box-shadow: 0 0 0 2px var(--color-primary); }
.plan-select-check {
  position: absolute; top: 16px; right: 16px;
  width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--color-border); background: var(--color-surface);
  display: flex; align-items: center; justify-content: center; color: transparent;
}
.plan-select-card.is-selected .plan-select-check { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

/* ---------- Checkout ---------- */
.checkout-shell { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--space-6); align-items: start; max-width: 980px; margin: 0 auto; }
.checkout-summary-card { position: sticky; top: calc(var(--header-height) + 16px); }
.payment-option-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
.payment-option {
  padding: var(--space-4); border: 1.5px solid var(--color-border); border-radius: var(--radius-md);
  display: flex; align-items: center; gap: var(--space-3); font-weight: 600; font-size: var(--text-small);
}
.payment-option.is-selected { border-color: var(--color-primary); background: var(--color-primary-subtle); }
.checkout-success { text-align: center; max-width: 480px; margin: var(--space-9) auto; }

@media (max-width: 900px) {
  .checkout-shell { grid-template-columns: 1fr; }
  .checkout-summary-card { position: static; order: -1; }
}

/* ---------- Subscription / My Plan ---------- */
.plan-summary-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-clay);
  padding: var(--space-7);
  box-shadow: var(--clay-shadow-raised);
  margin-bottom: var(--space-6);
}
.usage-row { margin-bottom: var(--space-5); }
.usage-row-top { display: flex; justify-content: space-between; font-size: var(--text-small); margin-bottom: 6px; }
.usage-bar-track { height: 8px; border-radius: var(--radius-full); background: var(--color-border-subtle); overflow: hidden; }
.usage-bar-fill { height: 100%; border-radius: var(--radius-full); background: var(--color-primary); }
.usage-bar-fill.is-near-limit { background: var(--color-warning); }
.usage-bar-fill.is-at-limit { background: var(--color-danger); }

.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: var(--radius-full); font-size: var(--text-caption); font-weight: 700;
}

/* ---------- Billing table ---------- */
.billing-info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-5); margin-bottom: var(--space-6); }

/* ---------- Legal pages ---------- */
.legal-shell { max-width: 720px; margin: 0 auto; padding: var(--space-9) var(--space-6); }
.legal-shell h1 { font-family: var(--font-display); font-size: 32px; margin-bottom: var(--space-2); }
.legal-shell .effective-date { color: var(--color-text-muted); font-size: var(--text-small); margin-bottom: var(--space-8); }
.legal-shell h2 { font-size: 18px; margin: var(--space-7) 0 var(--space-3); }
.legal-shell p, .legal-shell li { font-size: var(--text-small); color: var(--color-text-secondary); line-height: 1.7; margin-bottom: var(--space-3); }
.legal-shell ul { padding-left: 20px; }
.legal-draft-notice {
  background: var(--color-warning-subtle); border: 1px solid #f0dab0; border-radius: var(--radius-md);
  padding: var(--space-4); font-size: var(--text-small); margin-bottom: var(--space-7);
}

/* ---------- System error states ---------- */
.system-state-shell {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: var(--space-6);
}
.system-state-code {
  font-family: var(--font-display); font-size: 88px; font-weight: 600; color: var(--color-primary-subtle-strong);
  line-height: 1;
}
.system-state-icon {
  width: 72px; height: 72px; border-radius: var(--radius-full); background: var(--color-primary-subtle); color: var(--color-primary);
  display: flex; align-items: center; justify-content: center; margin-bottom: var(--space-5);
}
.system-state-title { font-family: var(--font-display); font-size: 24px; margin: var(--space-4) 0 var(--space-2); }
.system-state-desc { color: var(--color-text-secondary); max-width: 380px; margin-bottom: var(--space-7); }

/* ---------- Password strength ---------- */
.password-strength-track { display: flex; gap: 4px; margin-top: 8px; }
.password-strength-seg { height: 4px; flex: 1; border-radius: var(--radius-full); background: var(--color-border); }
.password-strength-seg.filled.weak { background: var(--color-danger); }
.password-strength-seg.filled.medium { background: var(--color-warning); }
.password-strength-seg.filled.strong { background: var(--color-success); }

@media (max-width: 767px) {
  .billing-info-grid { grid-template-columns: 1fr; }
  .payment-option-grid { grid-template-columns: 1fr; }
  .system-state-code { font-size: 56px; }
}
