/* ============================================================
   dixpic v2 — Pricing Page Styles
   ============================================================ */

/* Alias variables used in the pricing spec */
:root {
  --border-subtle: var(--border-primary);
  --border-accent: rgba(124, 58, 237, 0.4);
}

.pricing-page {
  background: var(--bg-primary);
  min-height: 100vh;
}

/* ============================================================
   Hero
   ============================================================ */
.pricing-hero {
  text-align: center;
  padding: 140px 48px 40px;
}

.pricing-hero h1 {
  font-size: 48px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.pricing-hero p {
  font-size: 20px;
  color: var(--text-secondary);
}

/* ============================================================
   Sections
   ============================================================ */
.pricing-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 60px 48px;
}

.pricing-section h2 {
  text-align: center;
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.pricing-page .section-subtitle {
  text-align: center;
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 40px;
}

/* ============================================================
   Free Tier Card
   ============================================================ */
.free-tier-card {
  max-width: 700px;
  margin: 0 auto;
  padding: 40px;
  background: var(--bg-card);
  border: 2px solid rgba(34, 197, 94, 0.3);
  border-radius: 16px;
  text-align: center;
  position: relative;
}

.free-tier-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: #22c55e;
  color: #000;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 16px;
  border-radius: 12px;
}

.free-tier-card h2 {
  font-size: 24px;
  margin-bottom: 24px;
}

.free-tier-features {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-bottom: 24px;
}

.free-feature {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
}

.free-feature-icon {
  font-size: 28px;
}

.free-feature strong {
  display: block;
  font-size: 16px;
  color: var(--text-primary);
}

.free-feature p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.free-tier-bonus {
  font-size: 16px;
  color: var(--text-secondary);
}

/* ============================================================
   Tier Tabs
   ============================================================ */
.tier-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 32px;
}

.tier-tab {
  padding: 12px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.2s;
}

.tier-tab:hover {
  border-color: var(--accent-purple);
  color: var(--text-primary);
}

.tier-tab.active {
  background: rgba(124, 58, 237, 0.1);
  border-color: var(--accent-purple);
  color: var(--accent-purple);
}

.tier-content {
  display: none;
}

.tier-content.active {
  display: block;
}

/* ============================================================
   Tier Cards
   ============================================================ */
.tier-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.tier-cards.two-cols {
  grid-template-columns: repeat(2, 1fr);
  max-width: 600px;
  margin: 0 auto;
}

.tier-cards.one-col {
  grid-template-columns: 1fr;
  max-width: 400px;
  margin: 0 auto;
}

.tier-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  transition: border-color 0.2s, transform 0.2s;
}

.tier-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-4px);
}

.tier-card.recommended {
  border-color: var(--accent-purple);
}

.tier-recommended-badge {
  position: absolute;
  top: -1px;
  right: 20px;
  background: var(--gradient-primary);
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 0 0 8px 8px;
}

.tier-card-header {
  padding: 24px 24px 16px;
  text-align: center;
}

.tier-card-header.free {
  background: rgba(34, 197, 94, 0.05);
}

.tier-card-header h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.tier-price {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
}

.tier-price span {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
}

.tier-card ul {
  list-style: none;
  padding: 0 24px 16px;
}

.tier-card li {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.tier-card li:last-child {
  border-bottom: none;
}

.tier-card li strong {
  color: var(--accent-cyan);
}

.tier-btn {
  display: block;
  margin: 0 24px 24px;
  padding: 12px;
  text-align: center;
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  background: transparent;
  border: 1px solid var(--border-subtle);
  transition: all 0.2s;
}

.tier-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.tier-btn.primary {
  background: var(--gradient-primary);
  border: none;
  color: #fff;
}

.tier-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

/* ============================================================
   Package Cards
   ============================================================ */
.package-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 1000px;
  margin: 0 auto;
}

.package-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
  position: relative;
  transition: border-color 0.2s, transform 0.2s;
}

.package-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-4px);
}

.package-card.popular {
  border-color: var(--accent-purple);
}

/* Reuse .popular-badge from global/landing — same style */
.package-card .popular-badge {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 4px 16px;
  background: var(--gradient-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.package-card h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.package-price {
  font-size: 40px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.package-credits {
  font-size: 18px;
  color: var(--accent-cyan);
  font-weight: 600;
  margin-bottom: 8px;
}

.package-per-credit {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.package-btn {
  width: 100%;
  padding: 12px;
  background: var(--gradient-primary);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.2s;
}

.package-btn:disabled {
  background: #374151;
  color: var(--text-muted);
  cursor: not-allowed;
}

.packages-note {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 24px;
}

/* ============================================================
   Comparison Table
   ============================================================ */
.comparison-table-wrapper {
  overflow-x: auto;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
}

.comparison-table th,
.comparison-table td {
  padding: 14px 20px;
  text-align: center;
  border-bottom: 1px solid var(--border-subtle);
}

.comparison-table th {
  background: rgba(124, 58, 237, 0.1);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.comparison-table th:first-child,
.comparison-table td:first-child {
  text-align: left;
}

.comparison-table td {
  font-size: 14px;
  color: var(--text-secondary);
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

/* ============================================================
   FAQ (pricing page — uses .open instead of .active)
   ============================================================ */
.pricing-page .faq-list {
  max-width: 700px;
  margin: 40px auto 0;
  text-align: left;
}

.pricing-page .faq-item {
  border-bottom: 1px solid var(--border-primary);
}

.pricing-page .faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-sans);
  text-align: left;
  transition: color 0.2s;
}

.pricing-page .faq-question:hover {
  color: var(--accent-purple);
}

.pricing-page .faq-icon {
  font-size: 20px;
  font-weight: 400;
  color: var(--text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
  margin-left: 16px;
}

.pricing-page .faq-item.open .faq-icon {
  transform: rotate(45deg);
}

.pricing-page .faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.pricing-page .faq-item.open .faq-answer {
  max-height: 300px;
  padding-bottom: 20px;
}

.pricing-page .faq-answer p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ============================================================
   Final CTA (scoped to pricing page)
   ============================================================ */
.pricing-page .final-cta {
  text-align: center;
  padding: 80px 24px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(236, 72, 153, 0.1));
}

.pricing-page .final-cta h2 {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 16px;
}

.pricing-page .final-cta p {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 968px) {
  .tier-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .package-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .free-tier-features {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  .tier-tabs {
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .pricing-hero {
    padding: 100px 24px 30px;
  }

  .pricing-hero h1 {
    font-size: 32px;
  }

  .pricing-section {
    padding: 40px 24px;
  }

  .tier-cards,
  .package-cards {
    grid-template-columns: 1fr;
  }

  .tier-cards.two-cols {
    grid-template-columns: 1fr;
  }
}
