/* ===== BILLING PAGE ===== */

body { background: var(--bg); }

/* ─── Minimal nav ─────────────────────────────────────────── */
.billing-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 0 32px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.billing-nav-logo .logo-text { font-size: 1.25rem; font-weight: 800; color: var(--accent); letter-spacing: -0.5px; }
.billing-nav-right { display: flex; align-items: center; gap: 12px; }
.billing-nav-user { font-size: .85rem; color: var(--text-muted); }
/* ─── Page wrap ───────────────────────────────────────────── */
.billing-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 64px 24px 100px;
}

/* ─── Hero heading ────────────────────────────────────────── */
.billing-hero {
  text-align: center;
  margin-bottom: 56px;
}
.billing-hero h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 800;
  color: var(--text);
  margin-bottom: 14px;
  letter-spacing: -.02em;
}
.billing-hero p {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto;
}
.billing-hero-vat {
  font-size: .8rem !important;
  margin-top: 10px !important;
  opacity: .7;
}

/* ─── Current plan banner ─────────────────────────────────── */
.current-plan-banner {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 28px;
  margin-bottom: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}
.cpb-left { display: flex; align-items: center; gap: 14px; }
.cpb-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--accent-light);
  display: flex; align-items: center; justify-content: center;
}
.cpb-icon .lucide { width: 20px; height: 20px; stroke: var(--accent); }
.cpb-label { font-size: .78rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.cpb-plan { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.cpb-right { display: flex; align-items: center; gap: 24px; }
.cpb-stat { text-align: center; }
.cpb-stat-val { font-size: 1.4rem; font-weight: 800; color: var(--text); }
.cpb-stat-lbl { font-size: .72rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; }
.cpb-renews { font-size: .8rem; color: var(--text-dim); }
.btn-manage {
  padding: 8px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border2);
  background: var(--white);
  font-size: .84rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.btn-manage:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

/* ─── Pricing grid ────────────────────────────────────────── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 64px;
}

.plan-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: box-shadow .2s, transform .2s;
  box-shadow: var(--shadow-sm);
}
.plan-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.plan-card.popular {
  border-color: var(--accent);
  border-width: 2px;
}
.plan-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 3px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

.plan-name {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.plan-price-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 4px;
}
.plan-price {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.03em;
  line-height: 1;
}
.plan-price-period { font-size: .85rem; color: var(--text-dim); }
.plan-credits {
  font-size: .85rem;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 20px;
}
.plan-divider {
  height: 1px;
  background: var(--border);
  margin: 0 -4px 20px;
}
.plan-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  margin-bottom: 24px;
}
.plan-features li {
  font-size: .84rem;
  color: var(--text-muted);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.plan-features li .lucide {
  width: 15px; height: 15px;
  stroke: var(--success);
  flex-shrink: 0;
  margin-top: 2px;
}
.plan-features li.feat-no .lucide { stroke: var(--border2); }
.plan-features li.feat-no { color: var(--text-dim); }

.btn-plan {
  width: 100%;
  padding: 11px;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  border: 2px solid transparent;
  text-align: center;
}
.btn-plan-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-plan-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-plan-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border2);
}
.btn-plan-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-plan-current {
  background: var(--success-light);
  color: var(--success);
  border-color: transparent;
  cursor: default;
}
.btn-plan[disabled] { opacity: .55; cursor: not-allowed; }

/* ─── Top-up section ──────────────────────────────────────── */
.topup-section {
  margin-bottom: 64px;
}
.topup-section h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}
.topup-section > p {
  font-size: .88rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.topup-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.topup-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s;
}
.topup-card:hover { box-shadow: var(--shadow-md); }
.topup-info {}
.topup-credits { font-size: 1.4rem; font-weight: 800; color: var(--text); }
.topup-note { font-size: .78rem; color: var(--text-dim); margin-top: 2px; }
.topup-price-row { display: flex; align-items: center; gap: 12px; }
.topup-price { font-size: 1.1rem; font-weight: 800; color: var(--text); }
.btn-topup {
  padding: 8px 18px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: .84rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.btn-topup:hover { background: var(--accent-hover); }

/* ─── Feature comparison table ────────────────────────────── */
.compare-section { margin-bottom: 64px; }
.compare-section h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 24px;
}
.compare-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.compare-table th {
  padding: 14px 20px;
  text-align: left;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
}
.compare-table th:not(:first-child) { text-align: center; }
.compare-table td {
  padding: 13px 20px;
  font-size: .87rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.compare-table tr:last-child td { border-bottom: none; }
.compare-table td:not(:first-child) { text-align: center; }
.compare-table td:first-child { font-weight: 500; color: var(--text); }
.compare-table .ct-yes { color: var(--success); font-weight: 700; }
.compare-table .ct-no  { color: var(--border2); }
.compare-table .ct-val { color: var(--text); font-weight: 600; }
.compare-table .ct-accent { color: var(--accent); font-weight: 700; }
.compare-col-highlight { background: rgba(10,102,194,.04); }

/* ─── FAQ ──────────────────────────────────────────────────── */
.billing-faq { max-width: 700px; margin: 0 auto; }
.billing-faq h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 24px;
  text-align: center;
}
.bfaq-item {
  border-bottom: 1px solid var(--border);
}
.bfaq-q {
  width: 100%;
  text-align: left;
  padding: 18px 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: color .15s;
}
.bfaq-q:hover { color: var(--accent); }
.bfaq-q .lucide { width: 18px; height: 18px; stroke: var(--text-dim); flex-shrink: 0; transition: transform .2s; }
.bfaq-q[aria-expanded="true"] .lucide { transform: rotate(45deg); stroke: var(--accent); }
.bfaq-a {
  overflow: hidden;
  max-height: 0;
  transition: max-height .25s ease, padding-bottom .25s;
}
.bfaq-a.open { max-height: 200px; padding-bottom: 16px; }
.bfaq-a p { font-size: .88rem; color: var(--text-muted); line-height: 1.7; }

/* ─── No-credits modal ────────────────────────────────────── */
.nocredits-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.nocredits-modal {
  background: var(--white);
  border-radius: 16px;
  padding: 36px 32px 28px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  text-align: center;
  position: relative;
}
.ncm-icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: #fff3cd;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
}
.ncm-icon .lucide { width: 26px; height: 26px; stroke: #b45309; }
.nocredits-modal h2 { font-size: 1.2rem; font-weight: 800; margin-bottom: 10px; }
.nocredits-modal p  { font-size: .88rem; color: var(--text-muted); margin-bottom: 24px; line-height: 1.6; }
.ncm-actions { display: flex; flex-direction: column; gap: 10px; }
.btn-ncm-primary {
  padding: 12px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s;
}
.btn-ncm-primary:hover { background: var(--accent-hover); }
.btn-ncm-secondary {
  padding: 10px;
  border-radius: var(--radius);
  background: none;
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-size: .88rem;
  cursor: pointer;
  transition: border-color .15s;
}
.btn-ncm-secondary:hover { border-color: var(--border2); color: var(--text); }

/* ─── Toast (shared) ──────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 500;
  z-index: 999;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--error); }

/* ─── Credit badge (in create/app headers) ────────────────── */
.credit-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s;
  white-space: nowrap;
}
.credit-badge:hover { background: #c5d9ef; }
.credit-badge .lucide { width: 13px; height: 13px; stroke: var(--accent); }
.credit-badge.low { background: #fff3cd; color: #b45309; }
.credit-badge.low .lucide { stroke: #b45309; }
.credit-badge.empty { background: #fde8e8; color: var(--error); }
.credit-badge.empty .lucide { stroke: var(--error); }

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
  .topup-grid { grid-template-columns: 1fr; }
  .current-plan-banner { flex-direction: column; align-items: flex-start; }
  .cpb-right { width: 100%; justify-content: space-between; }
  .compare-table { display: block; overflow-x: auto; }
}
@media (max-width: 600px) {
  .pricing-grid { grid-template-columns: 1fr; }
  .billing-wrap { padding: 40px 16px 80px; }
  .billing-nav { padding: 0 16px; }
}
