/* frontend/css/pricing.css — v5 cinematic editorial pricing.
   Prices/credits render from GET /api/ai-plans (never hard-coded).
   All ids/classes consumed by pricing.js are preserved. */

body.pricing-page {
  background: var(--bk-paper, #f5f2eb);
  color: var(--bk-ink, #0f0c09);
  font-family: var(--bk-font-body, 'Manrope', system-ui, sans-serif);
}
[data-theme="dark"] body.pricing-page {
  background: #14110d;
  color: #f5f2eb;
}

/* ---------- Editorial nav ---------- */
.pricing-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245, 242, 235, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(15, 12, 9, 0.12);
}
[data-theme="dark"] .pricing-nav { background: rgba(20, 17, 13, 0.9); }
.pricing-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
}
.pricing-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.pricing-wordmark {
  font-family: var(--bk-font-display, 'Playfair Display', serif);
  font-style: italic;
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--bk-ink, #0f0c09);
}
[data-theme="dark"] .pricing-wordmark { color: #f5f2eb; }
.pricing-nav-links { display: flex; gap: 22px; align-items: center; }
.pricing-nav-links a {
  text-decoration: none;
  color: #6d6358;
  font-size: 0.85rem;
}
.pricing-nav-links a:hover { color: var(--bk-gold-text); }
.pricing-nav-links a.active { color: var(--bk-gold-text); font-weight: 700; }
.pricing-nav-links .btn {
  background: #0f0c09;
  color: #f5f2eb;
  border: 1px solid #0f0c09;
  border-radius: 2px;
  padding: 9px 16px;
  font-family: var(--bk-font-mono, monospace);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.pricing-nav-links .btn:hover { background: #c19856; border-color: #c19856; color: #0f0c09; }

/* ---------- Hero ---------- */
.pricing-hero {
  padding: 96px 0 40px;
  text-align: center;
  background:
    radial-gradient(circle at 80% 10%, rgba(193, 152, 86, 0.22), transparent 26%),
    radial-gradient(circle at 10% 80%, rgba(255, 255, 255, 0.8), transparent 30%),
    linear-gradient(115deg, #f5f2eb, #fffdf8 50%, #ead9c0);
}
[data-theme="dark"] .pricing-hero { background: #14110d; }
.pricing-eyebrow {
  font-family: var(--bk-font-mono, monospace);
  font-size: 0.72rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--bk-gold-text);
  margin-bottom: 18px;
}
.pricing-title {
  font-family: var(--bk-font-display, 'Playfair Display', serif);
  font-weight: 500;
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  line-height: 1.15; /* VN-safe heading LH */
  letter-spacing: -0.02em;
  max-width: 760px;
  margin: 0 auto 16px;
  text-wrap: balance;
}
.pricing-title .accent { color: var(--bk-gold-text); font-style: italic; }
.pricing-subtitle { color: #6d6358; max-width: 640px; margin: 0 auto 18px; font-size: 0.95rem; line-height: 1.7; }
.pricing-trust { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; font-size: 0.8rem; color: #6d6358; }
.pricing-trust span { display: flex; align-items: center; gap: 6px; }
.pricing-trust span::before { content: '✓'; color: var(--bk-gold-text); font-weight: 700; }

/* ---------- Plan cards ---------- */
.pricing-plans-section { padding: 36px 0 12px; }
.pricing-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: rgba(15, 12, 9, 0.14); border: 1px solid rgba(15, 12, 9, 0.14); }
@media (max-width: 1366px) { .pricing-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1024px) { .pricing-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .pricing-grid { grid-template-columns: 1fr; } }
.pricing-card {
  border: none;
  border-radius: 0;
  padding: 30px 26px;
  background: #fffdf8;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.6s, background 0.4s;
}
[data-theme="dark"] .pricing-card { background: #1d1b18; }
.pricing-card:hover { transform: translateY(-6px); box-shadow: 0 24px 60px rgba(15, 12, 9, 0.14); background: #f7f1e3; z-index: 2; }
[data-theme="dark"] .pricing-card:hover { background: #26221c; }
.pricing-card.featured { background: #0f0c09; color: #f5f2eb; }
.pricing-card.featured:hover { background: #1a1512; }
.pricing-card.featured::before {
  content: "Phổ biến nhất";
  position: absolute;
  top: 0;
  left: 0;
  background: #c19856;
  color: #0f0c09;
  font-family: var(--bk-font-mono, monospace);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 6px 12px;
}
.pricing-card-head { margin-bottom: 14px; }
.pricing-card-name {
  font-family: var(--bk-font-display, 'Playfair Display', serif);
  font-weight: 500;
  font-size: 1.7rem;
  letter-spacing: -0.01em;
}
.pricing-card-desc { font-size: 0.84rem; color: #6d6358; margin-top: 6px; min-height: 36px; line-height: 1.6; }
.pricing-card.featured .pricing-card-desc { color: rgba(245, 242, 235, 0.65); }
.pricing-card-price { margin: 16px 0 6px; display: flex; align-items: baseline; gap: 8px; }
.pricing-card-price .amount {
  font-family: var(--bk-font-display, 'Playfair Display', serif);
  font-weight: 500;
  font-size: 2.6rem;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.pricing-card-price .unit { font-size: 0.8rem; color: #6d6358; }
.pricing-card-credits { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 16px; }
.pricing-credit-pill {
  font-family: var(--bk-font-mono, monospace);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  padding: 6px 10px;
  border-radius: 2px;
  border: 1px solid;
}
.pricing-credit-pill.high { color: var(--bk-gold-text); border-color: rgba(163, 124, 58, 0.4); background: var(--bk-gold-soft); }
.pricing-credit-pill.low { color: #7a6a4f; border-color: rgba(122, 106, 79, 0.35); background: rgba(122, 106, 79, 0.08); }
.pricing-credit-pill.daily { color: #4a5a3f; border-color: rgba(74, 90, 63, 0.3); background: rgba(74, 90, 63, 0.08); }
.pricing-features { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-direction: column; gap: 9px; font-size: 0.88rem; }
.pricing-features li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.55; }
.pricing-features li::before { content: "✓"; color: var(--bk-gold-text); font-weight: 700; }
.pricing-cta { margin-top: auto; }
.pricing-cta .btn {
  width: 100%;
  background: transparent;
  color: #0f0c09;
  border: 1px solid rgba(15, 12, 9, 0.3);
  border-radius: 2px;
  padding: 14px;
  font-family: var(--bk-font-mono, monospace);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
[data-theme="dark"] .pricing-cta .btn { color: #f5f2eb; border-color: rgba(245, 242, 235, 0.3); }
.pricing-cta .btn:hover { background: #0f0c09; color: #f5f2eb; border-color: #0f0c09; }
.pricing-card.featured .pricing-cta .btn { background: #c19856; border-color: #c19856; color: #0f0c09; }
.pricing-card.featured .pricing-cta .btn:hover { background: #f5f2eb; border-color: #f5f2eb; }
.pricing-card-meta { font-size: 0.72rem; color: #6d6358; margin-top: 10px; text-align: center; }

/* ---------- Compare table ---------- */
.pricing-compare { padding: 40px 0; }
.pricing-compare h2, .pricing-faq h2 {
  font-family: var(--bk-font-display, 'Playfair Display', serif);
  font-weight: 500;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  text-align: center;
}
.table-wrap { overflow: auto; border: 1px solid rgba(15, 12, 9, 0.14); }
.compare-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.compare-table th, .compare-table td { padding: 14px 16px; border-bottom: 1px solid rgba(15, 12, 9, 0.1); text-align: left; white-space: nowrap; }
.compare-table th {
  background: #0f0c09;
  color: #f5f2eb;
  font-family: var(--bk-font-mono, monospace);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
}
.compare-table td strong { font-weight: 600; }

/* ---------- FAQ ---------- */
.pricing-faq { padding: 20px 0 64px; }
.pricing-faq .container { max-width: 820px; }
.pricing-faq details {
  border: 1px solid rgba(15, 12, 9, 0.14);
  border-radius: 2px;
  padding: 18px 20px;
  margin-bottom: 10px;
  background: #fffdf8;
  transition: border-color 0.3s;
}
[data-theme="dark"] .pricing-faq details { background: #1d1b18; }
.pricing-faq details[open], .pricing-faq details:hover { border-color: #c19856; }
.pricing-faq summary {
  font-family: var(--bk-font-display, 'Playfair Display', serif);
  font-size: 1.2rem;
  font-weight: 500;
  cursor: pointer;
}
.pricing-faq summary::marker { color: #c19856; }
.pricing-faq p { margin: 10px 0 0; color: #6d6358; font-size: 0.9rem; line-height: 1.7; }

.pricing-loading { grid-column: 1/-1; text-align: center; padding: 40px; color: #6d6358; }
#pricingError { text-align: center; color: #a3341f; margin-top: 16px; }

/* ---------- Purchase modal ---------- */
.pm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 12, 9, 0.6);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}
.pm-card {
  max-width: 500px;
  width: 100%;
  padding: 34px 30px;
  border-radius: 3px;
  background: #fffdf8;
  border: 1px solid rgba(15, 12, 9, 0.16);
  border-top: 3px solid #c19856;
  position: relative;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 28px 70px rgba(15, 12, 9, 0.3);
}
[data-theme="dark"] .pm-card { background: #1d1b18; }
.pm-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #6d6358;
}
.pm-close:hover { color: #0f0c09; }
.pm-eyebrow {
  font-family: var(--bk-font-mono, monospace);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bk-gold-text);
  margin-bottom: 6px;
}
.pm-title {
  font-family: var(--bk-font-display, 'Playfair Display', serif);
  font-weight: 500;
  font-size: 1.9rem;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
}
.pm-section {
  margin-bottom: 14px;
  padding: 16px;
  border: 1px dashed rgba(15, 12, 9, 0.25);
  border-radius: 2px;
  background: #f5f2eb;
  font-size: 0.88rem;
}
[data-theme="dark"] .pm-section { background: #14110d; }
.pm-section-title { font-weight: 700; font-size: 0.86rem; margin-bottom: 10px; }
.pm-voucher-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.pm-voucher-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pm-input {
  flex: 1;
  min-width: 140px;
  padding: 10px 12px;
  border: 1px solid rgba(15, 12, 9, 0.25);
  border-radius: 2px;
  text-transform: uppercase;
  font-size: 0.86rem;
  background: #fffdf8;
  color: #0f0c09;
}
.pm-input:focus { border-color: #c19856; }
.pm-status { margin-top: 8px; font-size: 0.82rem; min-height: 18px; }
.pm-quote { margin-top: 10px; padding: 12px; background: #fffdf8; border: 1px solid rgba(15, 12, 9, 0.14); font-size: 0.86rem; }
.pm-strong { font-weight: 700; }
.pm-discount { color: #4a5a3f; font-weight: 700; }
.pm-final { color: var(--bk-gold-text); }
.pm-row { display: flex; justify-content: space-between; padding: 3px 0; }
.pm-total { border-top: 1px solid rgba(15, 12, 9, 0.2); margin-top: 8px; padding-top: 10px; }
.pm-total strong { color: var(--bk-gold-text); }
.pm-muted { color: #6d6358; font-size: 0.84rem; }
.pm-center { text-align: center; margin-bottom: 12px; }
.pm-qr { max-width: 280px; width: 100%; border: 1px solid rgba(15, 12, 9, 0.2); padding: 8px; background: #fff; }
.pm-transfer { font-weight: 700; font-size: 1.05rem; letter-spacing: 0.5px; font-family: var(--bk-font-mono, monospace); }
.pm-poll { font-size: 0.78rem; color: #6d6358; margin-top: 8px; }
.pm-full { width: 100%; }
.pm-actions { gap: 10px; justify-content: center; margin-top: 12px; }
.pm-card .btn-primary {
  background: #0f0c09;
  color: #f5f2eb;
  border: 1px solid #0f0c09;
  border-radius: 2px;
  font-family: var(--bk-font-mono, monospace);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 14px 20px;
}
.pm-card .btn-primary:hover { background: #c19856; border-color: #c19856; color: #0f0c09; }
.pm-card .btn-secondary, .pm-card .btn-ghost {
  border: 1px solid rgba(15, 12, 9, 0.3);
  border-radius: 2px;
  background: transparent;
  font-family: var(--bk-font-mono, monospace);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 14px;
}
.pm-card .btn-secondary:hover, .pm-card .btn-ghost:hover { border-color: #0f0c09; }

/* ---------- Footer ---------- */
.pricing-footer { border-top: 1px solid rgba(15, 12, 9, 0.14); padding: 30px 0; margin-top: 40px; }
.pricing-footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: #6d6358;
  font-size: 0.82rem;
}
.pricing-footer-brand {
  font-family: var(--bk-font-display, 'Playfair Display', serif);
  font-style: italic;
  font-size: 1.1rem;
  color: #0f0c09;
}
[data-theme="dark"] .pricing-footer-brand { color: #f5f2eb; }
.pricing-footer a { color: var(--bk-gold-text); text-decoration: none; }
.pricing-footer-contact a:hover { text-decoration: underline; }

@media (max-width: 768px) {
  .pricing-nav-links a:not(.btn):not(.active) { display: none; }
  .pricing-hero { padding: 72px 0 32px; }
  .pm-card { padding: 26px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .pricing-card { transition: none; }
}

/* Dark surfaces — inherits shared dark text vars from style.css */
[data-theme="dark"] body.pricing-page { background: #14110d; color: #cfc6b4; }
[data-theme="dark"] .pricing-subtitle,
[data-theme="dark"] .pricing-card-desc,
[data-theme="dark"] .pricing-card-meta,
[data-theme="dark"] .pricing-faq p,
[data-theme="dark"] .pm-muted,
[data-theme="dark"] .pm-poll,
[data-theme="dark"] .pricing-footer-inner { color: #a89c85; }
[data-theme="dark"] .pricing-trust { color: #a89c85; }
[data-theme="dark"] .pricing-hero { background: #14110d; }
[data-theme="dark"] .pricing-nav { background: rgba(20, 17, 13, 0.92); }
[data-theme="dark"] .pricing-wordmark { color: #f5f2eb; }
[data-theme="dark"] .pricing-grid { background: rgba(245, 242, 235, 0.14); border-color: rgba(245, 242, 235, 0.14); }
[data-theme="dark"] .pricing-card { background: #1d1b18; }
[data-theme="dark"] .pricing-card:hover { background: #26221c; }
[data-theme="dark"] .pricing-card.featured { background: #26221c; }
[data-theme="dark"] .pricing-cta .btn { color: #f5f2eb; border-color: rgba(245, 242, 235, 0.3); }
[data-theme="dark"] .pricing-cta .btn:hover { background: #f5f2eb; color: #0f0c09; border-color: #f5f2eb; }
[data-theme="dark"] .pricing-faq details { background: #1d1b18; border-color: rgba(245, 242, 235, 0.14); }
[data-theme="dark"] .pm-card { background: #1d1b18; border-color: rgba(245, 242, 235, 0.16); }
[data-theme="dark"] .pm-section { background: #14110d; }
[data-theme="dark"] .pm-quote, [data-theme="dark"] .pm-input { background: #14110d; color: #f5f2eb; border-color: rgba(245, 242, 235, 0.25); }
[data-theme="dark"] .pricing-footer-brand { color: #f5f2eb; }
