/* =============================================================================
   CodSpoke — Account / Pricing / Upgrade (Session #40)
   ============================================================================= */

/* ─── Plan badge ────────────────────────────────────────────────────── */
.plan-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  vertical-align: middle;
}
.plan-badge-none {
  background: rgba(255, 255, 255, 0.06);
  color: #9ca3af;
  border-color: rgba(255, 255, 255, 0.1);
}
.plan-badge-paid {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.3);
}
.plan-badge-premium {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(236, 72, 153, 0.18));
  color: #d8b4fe;
  border-color: rgba(139, 92, 246, 0.4);
}
body.light-mode .plan-badge-none { background: rgba(0,0,0,0.05); color: #6b7280; border-color: rgba(0,0,0,0.08); }

/* ─── Account page layout ───────────────────────────────────────────── */
.account-card { max-width: 520px; }
.account-body { margin-top: 1.2rem; }
.account-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.95rem;
}
.account-row:last-of-type { border-bottom: none; }
.account-label { color: #9ca3af; font-size: 0.85rem; }
.account-value { font-weight: 500; }
body.light-mode .account-row { border-bottom-color: rgba(0,0,0,0.06); }
body.light-mode .account-label { color: #6b7280; }

.account-quota {
  margin-top: 1.4rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
}
.account-quota-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.6rem;
}
.account-quota-text { font-size: 0.95rem; }
.account-quota-hint { margin-top: 0.6rem; font-size: 0.82rem; color: #9ca3af; }
body.light-mode .account-quota { background: rgba(0,0,0,0.02); border-color: rgba(0,0,0,0.06); }
body.light-mode .account-quota-hint { color: #6b7280; }

.quota-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}
body.light-mode .quota-bar { background: rgba(0,0,0,0.08); }
.quota-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  border-radius: 999px;
  transition: width 0.3s ease;
}
.quota-bar-fill-full {
  background: linear-gradient(90deg, #ef4444, #f59e0b);
}
.quota-bar-fill-paid {
  background: linear-gradient(90deg, #10b981, #06b6d4);
}

.account-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1.4rem;
}

/* ─── Pricing page (/pricing-account) ───────────────────────────────── */
.pricing-account-card { max-width: 720px; }
.pricing-account-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.4rem;
}
@media (max-width: 600px) {
  .pricing-account-grid { grid-template-columns: 1fr; }
}
.pricing-account-card-inner {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1.6rem 1.4rem;
  background: rgba(255, 255, 255, 0.02);
  position: relative;
  display: flex;
  flex-direction: column;
}
.pricing-account-card-inner.featured {
  border-color: rgba(139, 92, 246, 0.4);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.06), rgba(59, 130, 246, 0.04));
}
.pricing-account-card-inner h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}
.pricing-account-card-inner .pricing-desc {
  color: #9ca3af;
  font-size: 0.85rem;
  margin: 0.3rem 0 1rem;
}
.pricing-account-card-inner .price {
  font-size: 2.2rem;
  font-weight: 800;
  margin: 0 0 1rem;
  line-height: 1;
}
.pricing-account-card-inner .price span {
  font-size: 0.95rem;
  font-weight: 500;
  color: #9ca3af;
}
.pricing-account-card-inner ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1.4rem;
  flex-grow: 1;
}
.pricing-account-card-inner ul li {
  padding: 0.4rem 0;
  font-size: 0.9rem;
  color: #d1d5db;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.pricing-account-card-inner ul li:last-child { border-bottom: none; }
body.light-mode .pricing-account-card-inner { background: rgba(0,0,0,0.02); border-color: rgba(0,0,0,0.08); }
body.light-mode .pricing-account-card-inner.featured { background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(59, 130, 246, 0.05)); }
body.light-mode .pricing-account-card-inner ul li { color: #374151; border-bottom-color: rgba(0,0,0,0.05); }

.pricing-account-current {
  margin-top: 1.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
  font-size: 0.9rem;
  color: #9ca3af;
}
body.light-mode .pricing-account-current { border-top-color: rgba(0,0,0,0.06); color: #6b7280; }

/* ─── Upgrade page (/upgrade) ──────────────────────────────────────── */
.upgrade-card { max-width: 480px; }
.upgrade-summary {
  margin: 1.2rem 0;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
}
.upgrade-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  font-size: 0.92rem;
}
.upgrade-row.upgrade-total {
  margin-top: 0.4rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 1.05rem;
}
.upgrade-features {
  margin: 1.2rem 0;
}
.upgrade-features h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: #9ca3af; margin: 0 0 0.6rem; }
.upgrade-features ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.upgrade-features ul li {
  padding: 0.3rem 0;
  font-size: 0.92rem;
  color: #d1d5db;
}
.upgrade-features ul li code {
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.85em;
}
body.light-mode .upgrade-summary { background: rgba(0,0,0,0.02); border-color: rgba(0,0,0,0.06); }
body.light-mode .upgrade-row.upgrade-total { border-top-color: rgba(0,0,0,0.08); }
body.light-mode .upgrade-features h3 { color: #6b7280; }
body.light-mode .upgrade-features ul li { color: #374151; }
body.light-mode .upgrade-features ul li code { background: rgba(0,0,0,0.06); }

.upgrade-disclaimer {
  margin: 1rem 0;
  padding: 0.8rem 1rem;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 8px;
  font-size: 0.82rem;
  color: #fcd34d;
  line-height: 1.5;
}
body.light-mode .upgrade-disclaimer { background: rgba(245, 158, 11, 0.1); color: #92400e; border-color: rgba(245, 158, 11, 0.3); }

.upgrade-msg {
  margin: 0.8rem 0;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  text-align: center;
}
.upgrade-msg.success { background: rgba(16, 185, 129, 0.1); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.3); }
.upgrade-msg.error { background: rgba(239, 68, 68, 0.1); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.3); }

.upgrade-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1.2rem;
}

/* ─── Quota modal (in-chat 402 trigger) ────────────────────────────── */
.quota-modal-price {
  text-align: center;
  font-size: 2.2rem;
  font-weight: 800;
  margin: 1rem 0 0.4rem;
  line-height: 1;
}
.quota-modal-price span {
  font-size: 0.95rem;
  font-weight: 500;
  color: #9ca3af;
}
.quota-modal-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.2rem;
  font-size: 0.9rem;
}
.quota-modal-features li {
  padding: 0.3rem 0;
  color: #d1d5db;
}
.quota-modal-features code {
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.85em;
}
body.light-mode .quota-modal-features li { color: #374151; }
body.light-mode .quota-modal-features code { background: rgba(0,0,0,0.06); }

.modal-msg {
  margin: 0.6rem 0;
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  font-size: 0.85rem;
  text-align: center;
}
.modal-msg.error { background: rgba(239, 68, 68, 0.1); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.3); }

/* ─── Quota badge in chat sidebar ──────────────────────────────────── */
.quota-badge-sidebar {
  margin-top: auto;
  padding: 0.6rem 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: #9ca3af;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  flex-wrap: wrap;
}
.quota-badge-sidebar.quota-badge-paid {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}
.quota-badge-sidebar.quota-badge-full {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}
.quota-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.quota-badge-text {
  flex: 1;
  font-weight: 500;
}
.quota-badge-upgrade {
  color: #60a5fa;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.78rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.1);
  transition: background 0.15s;
}
.quota-badge-upgrade:hover { background: rgba(59, 130, 246, 0.2); }
body.light-mode .quota-badge-sidebar { background: rgba(0,0,0,0.02); border-color: rgba(0,0,0,0.06); color: #6b7280; }
