/* Billing pages — subscription dashboard + order history */

.billing-page {
  min-height: calc(100vh - 200px);
  padding: 100px 0 60px;
}

.page-header {
  margin-bottom: 40px;
}

.page-header h1 {
  font-size: 2rem;
  color: var(--gold);
  margin-bottom: 8px;
}

.page-sub {
  color: var(--fg-muted);
  font-size: 0.95rem;
}

.page-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

/* --- Status Card --- */
.status-card {
  background: var(--bg-card);
  border: 1px solid rgba(201, 168, 76, 0.15);
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 32px;
}

.status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.status-header h2 {
  font-size: 1.3rem;
  color: var(--fg);
}

.status-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.status-active {
  background: rgba(76, 175, 80, 0.15);
  color: #66bb6a;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.status-trialing {
  background: rgba(33, 150, 243, 0.15);
  color: #42a5f5;
  border: 1px solid rgba(33, 150, 243, 0.3);
}

.status-past_due {
  background: rgba(255, 152, 0, 0.15);
  color: #ffa726;
  border: 1px solid rgba(255, 152, 0, 0.3);
}

.status-canceled, .status-none {
  background: rgba(158, 158, 158, 0.15);
  color: #9e9e9e;
  border: 1px solid rgba(158, 158, 158, 0.3);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.status-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.status-label {
  font-size: 0.8rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-value {
  font-size: 1.1rem;
  color: var(--fg);
  font-weight: 600;
}

.cancel-warning {
  background: rgba(255, 152, 0, 0.1);
  border: 1px solid rgba(255, 152, 0, 0.3);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 24px;
  color: #ffa726;
  font-size: 0.9rem;
}

.warning-icon {
  margin-right: 8px;
}

.status-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--sans);
}

.btn-primary {
  background: var(--gold);
  color: var(--bg);
}

.btn-primary:hover {
  background: #d4b35c;
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold-dim);
}

.btn-secondary:hover {
  background: var(--gold-glow);
}

.btn-sm {
  padding: 6px 16px;
  font-size: 0.85rem;
}

/* --- Orders Table --- */
.orders-table-wrap {
  overflow-x: auto;
  margin-bottom: 24px;
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.orders-table th {
  text-align: left;
  padding: 12px 16px;
  color: var(--fg-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(201, 168, 76, 0.15);
}

.orders-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--fg);
}

.orders-table tbody tr:hover {
  background: rgba(201, 168, 76, 0.04);
}

.order-status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

.order-status-paid {
  color: #66bb6a;
  background: rgba(76, 175, 80, 0.12);
}

.order-status-failed {
  color: #ef5350;
  background: rgba(244, 67, 54, 0.12);
}

.order-status-refunded {
  color: #ffa726;
  background: rgba(255, 152, 0, 0.12);
}

.invoice-link {
  color: var(--gold);
  text-decoration: none;
  font-weight: 500;
}

.invoice-link:hover {
  text-decoration: underline;
}

/* --- Pagination --- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px 0;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 6px;
  color: var(--gold);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid var(--gold-dim);
  transition: all 0.2s;
}

.page-btn:hover {
  background: var(--gold-glow);
}

.page-info {
  color: var(--fg-muted);
  font-size: 0.85rem;
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 80px 24px;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h2 {
  color: var(--fg);
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--fg-muted);
  font-size: 0.95rem;
}

/* --- Credits Display --- */
.credits-display {
  text-align: center;
  padding: 24px 0;
  margin-bottom: 16px;
}

.credits-number {
  font-family: var(--sans);
  font-size: 4rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: -0.02em;
  line-height: 1;
}

.credits-unit {
  font-size: 1.3rem;
  color: var(--fg-muted);
  margin-left: 8px;
  vertical-align: baseline;
}

.credits-desc {
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.85rem;
  margin-top: 8px;
}

/* --- Nav Credits Badge --- */
.nav-credits-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.nav-credits-badge--active {
  background: rgba(201, 168, 76, 0.12);
  color: var(--gold);
  border: 1px solid rgba(201, 168, 76, 0.25);
}

.nav-credits-badge--empty {
  background: rgba(239, 83, 80, 0.12);
  color: #ef5350;
  border: 1px solid rgba(239, 83, 80, 0.25);
}

.nav-credits-badge:hover {
  transform: translateY(-1px);
}

/* --- Currency Toggle --- */
.pricing-header {
  text-align: center;
}

.currency-toggle {
  display: inline-flex;
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid rgba(201, 168, 76, 0.15);
  padding: 3px;
  margin-top: 20px;
  gap: 2px;
}

.curr-btn {
  padding: 6px 18px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--fg-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--sans);
}

.curr-btn.active {
  background: var(--gold);
  color: var(--bg);
}

.curr-btn:hover:not(.active) {
  color: var(--fg);
}

/* --- Trial Banner --- */
.trial-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(33, 150, 243, 0.08);
  border: 1px solid rgba(33, 150, 243, 0.2);
  border-radius: 10px;
  padding: 14px 20px;
  margin-bottom: 32px;
  color: #64b5f6;
  font-size: 0.9rem;
}

.trial-icon {
  font-size: 1.2rem;
}

.trial-reassurance {
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.85rem;
  margin-top: 12px;
}

/* --- Pricing Grid --- */
.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.pricing-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid rgba(201, 168, 76, 0.12);
  border-radius: 16px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, border-color 0.2s;
}

.pricing-card:hover {
  transform: translateY(-2px);
  border-color: rgba(201, 168, 76, 0.3);
}

.pricing-card-featured {
  border: 2px solid var(--gold);
  background: linear-gradient(180deg, rgba(201, 168, 76, 0.06) 0%, var(--bg-card) 40%);
}

.pricing-card-featured:hover {
  border-color: #d4b35c;
}

.card-badge {
  position: absolute;
  top: -12px;
  right: 20px;
  background: linear-gradient(135deg, #c9a84c, #e0c068);
  color: #0a0a0a;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.card-header h3 {
  font-family: var(--sans);
  font-size: 1.3rem;
  color: var(--fg);
  margin-bottom: 2px;
}

.card-label {
  color: var(--fg-muted);
  font-size: 0.85rem;
  margin-bottom: 20px;
}

.card-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 4px;
}

.price-main {
  font-family: var(--sans);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.02em;
}

.price-period {
  color: var(--fg-muted);
  font-size: 1rem;
}

.price-alt {
  color: var(--fg-dim);
  font-size: 0.8rem;
  margin-bottom: 24px;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0 0 28px 0;
  flex: 1;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  color: var(--fg);
  font-size: 0.9rem;
}

.feature-list .check {
  color: #66bb6a;
  font-weight: 700;
  font-size: 0.9rem;
}

.feature-list .gold-check {
  color: var(--gold);
}

/* --- Subscribe Buttons --- */
.btn-subscribe {
  display: block;
  width: 100%;
  padding: 14px 24px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  border: 1px solid var(--gold-dim);
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--sans);
  text-align: center;
}

.btn-subscribe:hover {
  background: var(--gold-glow);
  border-color: var(--gold);
  transform: translateY(-1px);
}

.btn-subscribe-gold {
  background: linear-gradient(135deg, #c9a84c, #b8860b);
  color: #0a0a0a;
  border: none;
}

.btn-subscribe-gold:hover {
  background: linear-gradient(135deg, #d4b35c, #c9a84c);
}

.btn-subscribe:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.pricing-footer-note {
  text-align: center;
  color: var(--fg-dim);
  font-size: 0.8rem;
  max-width: 720px;
  margin: 0 auto;
}

/* --- Mobile --- */
@media (max-width: 640px) {
  .billing-page {
    padding: 80px 0 40px;
  }

  .page-header h1 {
    font-size: 1.5rem;
  }

  .status-card {
    padding: 20px;
  }

  .status-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .status-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    text-align: center;
  }

  .orders-table th,
  .orders-table td {
    padding: 10px 8px;
    font-size: 0.8rem;
  }

  .page-header-row {
    flex-direction: column;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .pricing-card {
    padding: 24px 20px;
  }

  .price-main {
    font-size: 2rem;
  }

  .pricing-header {
    text-align: left;
  }

  .pricing-tiers-grid {
    grid-template-columns: 1fr;
  }

  .tier-card {
    padding: 24px 20px;
  }

  .tier-price-amount {
    font-size: 2rem;
  }

  .pricing-cycle-toggle {
    width: 100%;
  }

  .cycle-btn {
    flex: 1;
    padding: 10px 8px;
    font-size: 0.75rem;
  }
}

/* --- Three-Tier Pricing Page (overseas) --- */

/* Banners — match `.trial-banner` chromatic family for visual cohesion. */
.pricing-upgrade-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(33, 150, 243, 0.08);
  border: 1px solid rgba(33, 150, 243, 0.2);
  border-radius: 10px;
  padding: 14px 20px;
  margin-bottom: 24px;
  color: #64b5f6;
  font-size: 0.9rem;
}

.pricing-lock-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(239, 83, 80, 0.08);
  border: 1px solid rgba(239, 83, 80, 0.25);
  border-radius: 10px;
  padding: 14px 20px;
  margin-bottom: 24px;
  color: #ef5350;
  font-size: 0.9rem;
}

/* Logged-in strip — small "you have X credits" hint with link to history. */
.pricing-loggedin-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(201, 168, 76, 0.08);
  border: 1px solid rgba(201, 168, 76, 0.2);
  border-radius: 10px;
  padding: 10px 18px;
  margin-bottom: 24px;
  font-size: 0.88rem;
  color: var(--fg);
}

.pricing-loggedin-link {
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
}

.pricing-loggedin-link:hover {
  text-decoration: underline;
}

/* Billing cycle toggle — pill segmented control */
.pricing-cycle-toggle {
  display: flex;
  background: var(--bg-card);
  border-radius: 10px;
  border: 1px solid rgba(201, 168, 76, 0.15);
  padding: 4px;
  margin: 0 auto 28px;
  gap: 4px;
  width: max-content;
  max-width: 100%;
}

@media (max-width: 640px) {
  .pricing-cycle-toggle {
    width: 100%;
  }
}

.cycle-btn {
  padding: 9px 22px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--fg-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--sans);
}

.cycle-btn:not(.cycle-btn--active):hover {
  color: var(--fg);
}

.cycle-btn--active {
  background: var(--gold);
  color: var(--bg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.cycle-savings-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--gold-glow);
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.cycle-btn--active .cycle-savings-badge {
  background: rgba(10, 10, 10, 0.18);
  color: var(--bg);
}

/* Three-tier grid */
.pricing-tiers-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  max-width: 1100px;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .pricing-tiers-grid {
    grid-template-columns: 1fr;
  }
}

/* Tier card — extends .pricing-card aesthetic with per-tier modifiers */
.tier-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid rgba(201, 168, 76, 0.12);
  border-radius: 16px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.tier-card:hover {
  transform: translateY(-2px);
  border-color: rgba(201, 168, 76, 0.3);
}

.tier-card--featured.pricing-card-featured {
  border: 2px solid var(--gold);
  background: linear-gradient(180deg, rgba(201, 168, 76, 0.06) 0%, var(--bg-card) 40%);
}

.tier-card--featured.pricing-card-featured:hover {
  border-color: #d4b35c;
  box-shadow: 0 8px 30px rgba(201, 168, 76, 0.15);
}

.tier-card--highlighted {
  transform: translateY(-2px);
  border-color: rgba(201, 168, 76, 0.5);
  box-shadow: 0 0 0 1px rgba(201, 168, 76, 0.3), 0 8px 24px rgba(201, 168, 76, 0.18);
}

.card-badge--subtle {
  background: rgba(201, 168, 76, 0.15);
  color: var(--gold);
  border: 1px solid rgba(201, 168, 76, 0.3);
}

.tier-header {
  margin-bottom: 18px;
}

.tier-title {
  font-family: var(--sans);
  font-size: 1.4rem;
  color: var(--fg);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.tier-tagline {
  color: var(--fg-muted);
  font-size: 0.85rem;
  margin: 0;
}

/* Price block — drives the cycle toggle swap */
.tier-price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 22px;
  min-height: 56px;
}

.tier-price-row {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.tier-price-row.is-hidden {
  display: none;
}

.tier-price-amount {
  font-family: var(--sans);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: -0.02em;
  line-height: 1;
}

.tier-price-cycle {
  color: var(--fg-muted);
  font-size: 0.95rem;
}

/* Feature list — reuses the ✓ glyph from .feature-list */
.tier-features {
  list-style: none;
  padding: 0;
  margin: 0 0 28px 0;
  flex: 1;
}

.tier-features li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  color: var(--fg);
  font-size: 0.9rem;
  line-height: 1.4;
}

.tier-features .check {
  color: #66bb6a;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Tier CTA — uses .btn-subscribe styles as the base */
.tier-cta {
  text-decoration: none;
  display: block;
  margin-top: auto;
}

/* Per-use micro-CTA — sits directly below the primary CTA inside each
   Pro/Flagship card so users who don't want a subscription can buy one
   credit (€2.99 Pro / €6.99 Flagship) without leaving their card. */
.tier-cta-secondary {
  display: block;
  margin-top: 8px;
  text-decoration: none;
  width: 100%;
}

.tier-cta-secondary-price {
  margin-left: 4px;
  color: var(--gold);
  font-weight: 700;
}

/* Page-title-row + trial-badge — keeps the 7-day free-trial marker visible
   on the same horizontal line as the h1, not stacked above the cards. */
.page-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.trial-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(201, 168, 76, 0.12);
  border: 1px solid rgba(201, 168, 76, 0.45);
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Flagship highlight — keep existing border + gradient, add an isometric
   box-shadow and a soft golden radial halo behind the price on hover. */
.tier-card--featured.pricing-card-featured {
  position: relative;
  border: 2px solid var(--gold);
  background: linear-gradient(180deg, rgba(201, 168, 76, 0.06) 0%, var(--bg-card) 40%);
  box-shadow: 0 12px 40px rgba(201, 168, 76, 0.20);
}

.tier-card--featured.pricing-card-featured::before {
  content: "";
  position: absolute;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 40%;
  background: radial-gradient(ellipse at center, rgba(201, 168, 76, 0.35) 0%, rgba(201, 168, 76, 0) 70%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}

.tier-card--featured.pricing-card-featured > * {
  position: relative;
  z-index: 1;
}

.tier-card--featured.pricing-card-featured:hover {
  border-color: #d4b35c;
  box-shadow: 0 16px 50px rgba(201, 168, 76, 0.30);
}

.tier-note {
  color: var(--fg-muted);
  font-size: 0.8rem;
  margin: 0 0 16px 0;
}

/* China single-card grid — constrains the page to one centered card. */
.china-grid {
  grid-template-columns: minmax(0, 380px);
  justify-content: center;
}

/* China /pricing page — two-card ¥9.9 / ¥88 layout with cycle toggle.
   Width matches the legacy single-card grid so the page has a clean
   centered column at desktop sizes while remaining responsive on mobile. */
.pricing-tiers-grid--china {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  max-width: 760px;
}

@media (max-width: 720px) {
  .pricing-tiers-grid--china {
    grid-template-columns: 1fr;
  }
}

.cycling-toggle--two {
  /* narrower pill for the two-button China variant; reuses the existing
     .cycle-btn / .cycle-btn--active modifiers from the overseas three-tier
     toggle, so no extra button styling is needed. */
  width: max-content;
}

.tier-card--china-pricing {
  /* default accent — the active card picks up .tier-card--active on top. */
  background: linear-gradient(180deg, rgba(201, 168, 76, 0.04) 0%, var(--bg-card) 40%);
}

.tier-card--china-pricing.tier-card--active {
  border: 2px solid var(--gold);
  box-shadow: 0 8px 24px rgba(201, 168, 76, 0.18);
}

.tier-card--soon .pricing-soon-pill {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 152, 0, 0.18);
  color: #ffa726;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.pricing-fallback-wrap {
  text-align: center;
  margin-top: 24px;
}

.pricing-fallback-link {
  color: var(--fg-muted);
  font-size: 0.85rem;
  text-decoration: none;
  border-bottom: 1px dotted var(--fg-muted);
  padding-bottom: 1px;
}

.pricing-fallback-link:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
}
