/**
 * premium.css — Phase 10 Premium Tier Styles
 *
 * ALL Phase 10 premium-related styles live here.
 * Do NOT modify styles-v2.css for Phase 10 additions (UI-SPEC Design System rule).
 *
 * Uses existing custom properties from styles-v2.css:
 *   --color-bg, --color-card, --color-text, --color-text-light, --color-primary,
 *   --color-accent, --color-gold, --color-patriot, --color-border,
 *   --radius-sm, --radius-md, --font-heading
 *
 * Contents:
 *   1. Pricing Page (Component 4)
 *   2. Account Page — Tier Badges + Member/Upgrade State (Component 5)
 *   3. Blur Gate Overlay — Vendor Category Pages (Component 1)
 *   4. Blog / Guide Fade Gate (Component 2)
 *   5. Calculator Gate (Component 3)
 *   6. Site-Wide Grandfather Banner (Component 6)
 *   7. Button Loading State
 *   8. Dark Mode overrides
 */


/* ── 1. PRICING PAGE ─────────────────────────────────────────────────────────── */

/* Hero */
.pricing-hero-premium {
  text-align: center;
  padding: 48px 16px 32px;
}

.pricing-hero-premium h1,
.pricing-hero-premium h2 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 8px;
}

.pricing-hero-subline {
  font-size: 1rem;
  color: var(--color-text-light);
  margin: 0;
}

/* Two-column pricing grid */
.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 800px;
  margin: 0 auto 32px;
}

@media (max-width: 640px) {
  .pricing-grid {
    grid-template-columns: 1fr;
  }
  /* Premium card appears first on mobile */
  .pricing-card.featured {
    order: -1;
  }
}

/* Base pricing card */
.pricing-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 32px 24px;
  position: relative;
  display: flex;
  flex-direction: column;
}

.pricing-card.featured {
  border-color: var(--color-accent);
  border-width: 2px;
  box-shadow: 0 4px 24px rgba(3, 105, 161, 0.12);
}

/* Badge (e.g., "Founding Member Rate") */
.popular-badge {
  display: inline-block;
  background: var(--color-gold, #D97706);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 12px;
}

/* Plan name */
.plan-name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 4px;
}

.plan-subtitle {
  font-size: 0.875rem;
  color: var(--color-text-light);
  margin: 0 0 16px;
}

/* Price display — component-level override per UI-SPEC */
.plan-price {
  font-family: var(--font-heading);
  font-size: 2.75rem; /* 44px — UI-SPEC override */
  font-weight: 700;
  line-height: 1;
  margin: 0 0 4px;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.plan-price .period {
  font-size: 1rem;
  font-weight: 400;
  color: var(--color-text-light);
}

/* Alt price line (lifetime offer) */
.plan-alt-price {
  font-size: 0.875rem;
  color: var(--color-text-light);
  margin: 0 0 20px;
  min-height: 1.25rem;
}

/* Feature list */
.feature-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  flex: 1;
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.9375rem;
  line-height: 1.5;
  padding: 4px 0;
}

.feature-list .icon-check {
  color: #16a34a; /* green — success indicator */
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

.feature-list .icon-x {
  color: var(--color-text-light);
  flex-shrink: 0;
  margin-top: 2px;
}

.feature-list li.disabled {
  color: var(--color-text-light);
  opacity: 0.7;
}

/* CTA buttons */
.btn-plan {
  display: block;
  width: 100%;
  padding: 0 16px;
  height: 52px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, background 0.15s;
  line-height: 52px;
  box-sizing: border-box;
}

.btn-plan-primary {
  background: var(--color-primary, #1E3A5F);
  color: #ffffff;
}

.btn-plan-primary:hover {
  opacity: 0.88;
}

.btn-plan-primary:disabled,
.btn-plan-primary[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-plan-secondary {
  background: var(--color-card);
  color: var(--color-text-light);
  border: 1px solid var(--color-border);
}

/* Footnote below CTA */
.plan-footnote {
  font-size: 0.8125rem;
  color: var(--color-text-light);
  text-align: center;
  margin: 10px 0 0;
}

/* AER footnote */
.aer-footnote {
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-text-light);
  margin: 0 0 32px;
}

/* Grandfather offer block */
.grandfather-offer-block {
  background: linear-gradient(135deg, var(--color-primary, #1E3A5F) 0%, #0F4C81 100%);
  border-radius: var(--radius-md);
  padding: 24px 32px;
  color: #ffffff;
  margin: 0 auto 32px;
  max-width: 800px;
  display: none; /* shown only when premiumJustEnabled JS flag is true */
}

.grandfather-offer-block.visible {
  display: block;
}

.grandfather-offer-block h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: #ffffff;
}

.grandfather-offer-block p {
  font-size: 0.9375rem;
  opacity: 0.92;
  margin: 0 0 16px;
}

.btn-grandfather {
  display: inline-block;
  background: #ffffff;
  color: var(--color-primary, #1E3A5F);
  font-weight: 700;
  border-radius: var(--radius-sm, 6px);
  padding: 12px 24px;
  font-size: 0.9375rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-grandfather:hover {
  opacity: 0.88;
}

/* Inline checkout error message */
.checkout-error {
  font-size: 0.875rem;
  color: var(--color-patriot, #DC2626);
  text-align: center;
  margin: 8px 0 0;
  min-height: 1.25rem;
}

/* FAQ section */
.pricing-faq {
  max-width: 800px;
  margin: 0 auto 32px;
}

.pricing-faq h2 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 16px;
}

.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm, 6px);
  margin-bottom: 8px;
  overflow: hidden;
}

.faq-item summary {
  padding: 14px 16px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--color-card);
}

.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 1.2rem; }
.faq-item[open] summary::after { content: '−'; }

.faq-answer {
  padding: 0 16px 14px;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--color-text-light);
  margin: 0;
}

/* Disclaimer */
.pricing-disclaimer {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--color-text-light);
  max-width: 800px;
  margin: 0 auto 48px;
}


/* ── 2. ACCOUNT PAGE — TIER BADGES + MEMBER/UPGRADE STATE ───────────────────── */

/* Tier badge variants */
.tier-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

/* Free badge — muted */
.tier-badge.free {
  background: rgba(100, 116, 139, 0.1);
  color: var(--color-text-light);
  border: 1px solid rgba(100, 116, 139, 0.2);
}

/* Premium (pro) badge */
.tier-badge.premium {
  background: rgba(3, 105, 161, 0.12);
  color: var(--color-accent, #0369A1);
  border: 1px solid rgba(3, 105, 161, 0.3);
}

/* Lifetime (founding member) badge */
.tier-badge.lifetime {
  background: rgba(217, 119, 6, 0.12);
  color: #92400E;
  border: 1px solid rgba(217, 119, 6, 0.3);
}

/* Premium member confirmation card */
.member-confirmation {
  background: rgba(22, 163, 74, 0.06);
  border: 1px solid rgba(22, 163, 74, 0.2);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 1.5rem;
}

.member-confirmation h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--color-text);
}

.member-confirmation p {
  font-size: 0.9rem;
  color: var(--color-text-light);
  margin: 0 0 4px;
}

.member-confirmation p:last-child {
  margin-bottom: 0;
}

/* Upgrade banner update — overrides account.css placeholder content */
.upgrade-banner-premium {
  background: linear-gradient(135deg, #1E3A5F 0%, #0369A1 100%);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 1.5rem;
  color: #ffffff;
}

.upgrade-banner-premium h3 {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: #ffffff;
}

.upgrade-banner-premium p {
  font-size: 0.9375rem;
  opacity: 0.9;
  margin: 0 0 16px;
}

.btn-upgrade-premium {
  display: inline-block;
  background: #ffffff;
  color: var(--color-primary, #1E3A5F);
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm, 6px);
  padding: 12px 20px;
  font-size: 0.9375rem;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s;
}

.btn-upgrade-premium:hover {
  opacity: 0.88;
}

/* Inline error on account page */
.account-checkout-error {
  font-size: 0.875rem;
  color: var(--color-patriot, #DC2626);
  margin: 8px 0 0;
  min-height: 1.25rem;
}

/* Checkout success confirmation */
.checkout-success-notice {
  background: rgba(22, 163, 74, 0.08);
  border: 1px solid rgba(22, 163, 74, 0.25);
  border-radius: var(--radius-sm, 6px);
  padding: 12px 16px;
  font-size: 0.9rem;
  color: #15803d;
  margin-bottom: 16px;
  display: none;
}

.checkout-success-notice.visible {
  display: block;
}


/* ── 3. BLUR GATE OVERLAY (Vendor Category Pages) ───────────────────────────── */

.gate-zone {
  position: relative;
  min-height: 360px;
}

.gate-blur-wall {
  filter: blur(8px);
  pointer-events: none;
  user-select: none;
  transition: filter 0ms; /* instant apply — no progressive reveal */
}

.gate-cta-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(248, 250, 252, 0.85);
  z-index: 10;
}

.gate-cta-panel {
  background: var(--color-card);
  border-radius: var(--radius-md);
  padding: 40px 32px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  max-width: 420px;
  width: 90%;
  text-align: center;
  position: relative;
}

.gate-headline {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--color-text);
}

.gate-subline {
  font-size: 0.9375rem;
  color: var(--color-text-light);
  margin: 0 0 20px;
}

.gate-btn-primary {
  display: block;
  width: 100%;
  padding: 14px 16px;
  background: var(--color-accent, #0369A1);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm, 6px);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  margin-bottom: 12px;
  transition: opacity 0.15s;
}

.gate-btn-primary:hover {
  opacity: 0.88;
}

.gate-btn-primary:disabled,
.gate-btn-primary[disabled] {
  opacity: 0.7;
  cursor: not-allowed;
}

.gate-btn-secondary {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-accent, #0369A1);
  text-decoration: none;
  margin-bottom: 12px;
}

.gate-btn-secondary:hover {
  text-decoration: underline;
}

.gate-aer-note {
  font-size: 0.8125rem;
  color: var(--color-text-light);
}


/* ── 4. BLOG / GUIDE FADE GATE ───────────────────────────────────────────────── */

.blog-gate-zone {
  position: relative;
}

.blog-gate-fade {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to bottom, transparent 0%, var(--color-bg) 80%);
  pointer-events: none;
  z-index: 1;
}

.blog-gate-blurred {
  filter: blur(4px);
  pointer-events: none;
  user-select: none;
  max-height: 120px;
  overflow: hidden;
}

.blog-gate-cta {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 32px 24px;
  text-align: center;
  margin-top: 24px;
}

.free-article-banner {
  background: rgba(3, 105, 161, 0.07);
  border: 1px solid rgba(3, 105, 161, 0.18);
  border-radius: var(--radius-sm, 6px);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  text-align: left;
}

.free-article-label {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-light);
  white-space: nowrap;
}

.free-article-link {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-accent, #0369A1);
  text-decoration: none;
}

.free-article-link:hover {
  text-decoration: underline;
}


/* ── 5. CALCULATOR GATE ──────────────────────────────────────────────────────── */

.calc-gate-divider {
  border: none;
  border-top: 2px dashed var(--color-border);
  position: relative;
  margin: 32px 0 24px;
}

.calc-gate-label {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-bg);
  padding: 0 12px;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-text-light);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.calc-gate-panel {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 32px 24px;
  text-align: center;
  margin-bottom: 32px;
}


/* ── 6. SITE-WIDE GRANDFATHER BANNER ────────────────────────────────────────── */

.grandfather-banner {
  background: linear-gradient(90deg, #0F172A 0%, #1E3A5F 60%, #0369A1 100%);
  border-left: 4px solid var(--color-patriot, #DC2626);
  position: sticky;
  top: 0; /* updated by JS to match header height */
  z-index: 900;
  padding: 12px 16px;
  min-height: 52px;
  display: none; /* shown by JS when premiumJustEnabled = true */
}

.grandfather-banner.visible {
  display: block;
}

.grandfather-banner-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.grandfather-icon {
  font-size: 1.125rem;
  color: var(--color-gold, #D97706);
  flex-shrink: 0;
}

.grandfather-text {
  flex: 1;
  color: #ffffff;
  font-size: 0.875rem;
  line-height: 1.4;
}

.grandfather-text strong {
  font-weight: 700;
}

.grandfather-body {
  opacity: 0.85;
}

@media (max-width: 768px) {
  .grandfather-body { display: none; }
}

.grandfather-cta {
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 0.875rem;
}

.grandfather-cta:hover {
  text-decoration: underline;
}

.grandfather-dismiss {
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.25rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  flex-shrink: 0;
}

.grandfather-dismiss:hover {
  color: rgba(255, 255, 255, 0.9);
}


/* ── 7. BUTTON LOADING STATE ─────────────────────────────────────────────────── */

/* Applied via JS to all CTA buttons during Stripe or auth flows */
.btn-loading {
  opacity: 0.7;
  cursor: not-allowed;
  pointer-events: none;
}


/* ── 8. DARK MODE OVERRIDES ──────────────────────────────────────────────────── */

[data-theme="dark"] .gate-cta-overlay {
  background: rgba(15, 23, 42, 0.88);
}

[data-theme="dark"] .pricing-card.featured {
  box-shadow: 0 4px 24px rgba(56, 189, 248, 0.1);
}

[data-theme="dark"] .tier-badge.premium {
  background: rgba(56, 189, 248, 0.15);
  color: #38BDF8;
  border-color: rgba(56, 189, 248, 0.3);
}

[data-theme="dark"] .tier-badge.lifetime {
  color: #fbbf24;
  background: rgba(217, 119, 6, 0.15);
}

[data-theme="dark"] .member-confirmation {
  background: rgba(74, 222, 128, 0.06);
  border-color: rgba(74, 222, 128, 0.15);
}

[data-theme="dark"] .blog-gate-fade {
  background: linear-gradient(to bottom, transparent 0%, #0F172A 80%);
}

[data-theme="dark"] .free-article-banner {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.18);
}
