/* ====================================================================
   NPD Membership Pro v10 — Clean Card Design
   Modal: fixed width 440px, auto height, scrolls only if > 90vh
   ==================================================================== */

:root {
  /* ── Theme-aware colours ─────────────────────────────────────────
     Pull from Elementor global colours → Astra global colours →
     hardcoded fallback.  Change your primary colour in
     Elementor Site Settings or Astra → Global → Colours and these
     update automatically.
  ────────────────────────────────────────────────────────────────── */
  --npd-primary:    var(--e-global-color-primary,   var(--ast-global-color-0,  #5E1D2D));
  --npd-primary-d:  var(--e-global-color-secondary, var(--ast-global-color-1,  #3d1220));
  --npd-gold:       var(--e-global-color-accent,    var(--ast-global-color-3,  #c8973a));
  --npd-gold-d:                                                                 #b07e26;
  --npd-gold-lt:                                                                #fff8eb;
  --npd-green:                                                                  #2e7d32;
  --npd-bg:         var(--ast-global-color-4,                                   #f0efed);
  /* ── Non-colour tokens ───────────────────────────────────────── */
  --npd-radius:     16px;
  --npd-card-r:     12px;
}

/* ====================================================================
   LOCKED INLINE BANNER (shown in post when modal is dismissed)
   ==================================================================== */
.npdm-content-locked {
  display: flex; align-items: center; gap: 14px;
  background: #fdf5f7; border: 1.5px solid #e8c8d0;
  border-radius: 12px; padding: 16px 20px; margin: 24px 0;
  box-shadow: 0 2px 12px rgba(94,29,45,.07); flex-wrap: wrap;
}
.npdm-locked-icon {
  width: 40px; height: 40px; background: var(--npd-primary);
  border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 1rem; color: #fff; flex-shrink: 0;
}
.npdm-locked-text { flex: 1; min-width: 140px; }
.npdm-locked-text strong { display: block; font-size: .95rem; color: var(--npd-primary); margin-bottom: 2px; }
.npdm-locked-text span   { font-size: .8rem; color: #888; }
.npdm-locked-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; background: var(--npd-primary); color: #fff;
  border: none; border-radius: 9px; font-size: .84rem; font-weight: 700;
  cursor: pointer; transition: background .15s, transform .15s; flex-shrink: 0;
}
.npdm-locked-btn:hover { background: var(--npd-primary-d); transform: translateY(-1px); }
.npdm-locked--behind-modal { visibility: hidden; }

/* ====================================================================
   BACKDROP
   ==================================================================== */
.npdm-modal-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  z-index: 9999;
  align-items: center; justify-content: center;
  padding: 14px 12px;
}
.npdm-modal-backdrop.npdm-modal--visible { display: flex; }
body.npdm-modal-open { overflow: hidden; }

/* ====================================================================
   MODAL SHELL
   Fixed width · auto height · scroll if content > 90vh
   ==================================================================== */
.npdm-modal {
  background: var(--npd-bg);
  border-radius: var(--npd-radius);
  box-shadow: 0 24px 72px rgba(0,0,0,.28);
  width: 440px;
  max-width: calc(100vw - 32px);   /* never wider than screen */
  max-height: 90vh;                /* cap at 90% of viewport */
  overflow-y: auto;                /* scroll ONLY when content exceeds cap */
  overflow-x: hidden;
  position: relative;
  animation: npd-rise .26s cubic-bezier(.16,1,.3,1);
}
@keyframes npd-rise {
  from { transform: translateY(20px) scale(.97); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

/* ====================================================================
   HEADER — white card, centered title + subtitle
   ==================================================================== */
.npdm-modal-header {
  background: #fff;
  border-radius: var(--npd-radius) var(--npd-radius) 0 0;
  padding: 12px 16px 10px;
  text-align: center;
  border-bottom: 1px solid #e8e8e8;
}
.npdm-modal-title {
  font-size: 1.1rem; font-weight: 800;
  color: #1a1a1a; margin: 0 0 4px;
  line-height: 1.2;
}
.npdm-modal-subtitle {
  font-size: .72rem; color: #777;
  margin: 0; line-height: 1.4;
}

/* ====================================================================
   MODAL BODY — the scrollable content area with padding
   ==================================================================== */
.npdm-modal-body {
  padding: 8px 8px 4px;
  display: flex; flex-direction: column; gap: 8px;
}

/* ====================================================================
   SECTION — outer card (light bg, rounded)
   ==================================================================== */
.npdm-section {
  background: #fff;
  border-radius: var(--npd-card-r);
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  overflow: hidden;
}

.npdm-section-title {
  font-size: .78rem; font-weight: 700;
  color: #333; padding: 6px 10px 5px;
  border-bottom: 1px solid #f0f0f0;
  letter-spacing: .01em;
}

/* ====================================================================
   STORY CARD — inside One-Time Purchase section
   ==================================================================== */
.npdm-story-card {
  padding: 8px 10px 10px;
}
.npdm-story-card-top {
  margin-bottom: 5px;
}
.npdm-story-name {
  font-size: .86rem; font-weight: 800; color: #1a1a1a;
}
.npdm-story-card-row {
  display: flex; align-items: center;
  justify-content: space-between; gap: 8px;
}
.npdm-story-card-left {
  display: flex; align-items: center; gap: 7px; flex: 1;
}
.npdm-icon-book {
  width: 28px; height: 28px; flex-shrink: 0;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--npd-primary) 0%, #8b2a42 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .76rem;
}
.npdm-story-desc {
  font-size: .85rem; color: #999;
  display: flex; align-items: center; gap: 4px;
}
.npdm-story-desc i { color: var(--npd-green); font-size: .80rem; }

.npdm-story-card-right {
  display: flex; flex-direction: column;
  align-items: flex-end; gap: 5px; flex-shrink: 0;
}
.npdm-story-price {
  font-size: 1.3rem; font-weight: 800;
  color: #1a1a1a; line-height: 1;
}
.npdm-story-price sup {
  font-size: .65rem; font-weight: 700;
  vertical-align: super; line-height: 1;
}

/* ====================================================================
   GOLD BUTTON — used everywhere
   ==================================================================== */
.npdm-btn-gold {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 6px 13px; border-radius: 7px;
  background: var(--npd-gold); color: #fff;
  font-size: .75rem; font-weight: 700;
  text-decoration: none; white-space: nowrap;
  border: none; cursor: pointer;
  transition: background .14s, transform .14s;
  flex-shrink: 0;
}
.npdm-btn-gold:hover {
  background: var(--npd-gold-d); color: #fff;
  text-decoration: none; transform: translateY(-1px);
}
.npdm-btn-gold:active {
  color: #fff;
}
.npdm-btn--loading { opacity: .65; pointer-events: none; }

/* ====================================================================
   FULL MEMBERSHIP HEADER
   ==================================================================== */
.npdm-membership-header {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px 6px;
  border-bottom: 1px solid #f5f5f5;
}
.npdm-icon-crown {
  width: 30px; height: 30px; flex-shrink: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--npd-gold) 0%, var(--npd-gold-lt, #e4b85a) 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .8rem;
}
.npdm-membership-title {
  font-size: .86rem; font-weight: 800; color: #1a1a1a; line-height: 1.2;
}
.npdm-membership-sub {
  font-size: .65rem; color: #888; margin-top: 1px;
}

/* ====================================================================
   TIER ROWS
   ==================================================================== */
.npdm-tiers {
  display: flex; flex-direction: column;
  padding: 5px 8px 8px; gap: 15px;
}

.npdm-tier {
  position: relative;
  display: flex; align-items: center;
  justify-content: space-between; gap: 8px;
  background: #fff;
  border: 1.5px solid #e8e8e8;
  border-radius: 8px;
  padding: 7px 10px;
  transition: border-color .14s, box-shadow .14s;
}
.npdm-tier:hover {
  border-color: var(--npd-gold);
  box-shadow: 0 2px 8px rgba(200,151,58,.12);
}
.npdm-tier--hot {
  border-color: var(--npd-gold);
  background: #fffdf7;
}

/* Badge floats above the card */
.npdm-tier-badge {
  position: absolute; top: -10px; left: 8px;
  background: var(--npd-gold); color: #fff;
  font-size: .65rem; font-weight: 700;
  padding: 2px 8px; border-radius: 20px;
  white-space: nowrap; letter-spacing: .02em;
}

/* Left: name + small price stacked */
.npdm-tier-left { flex: 1; }
.npdm-tier-name {
  font-size: .78rem; font-weight: 700; color: #1a1a1a; line-height: 1.3; padding-top:10px;
}
.npdm-tier-price-sm {
  font-size: .68rem; font-weight: 600; color: #666; margin-top: 0;
}

/* Right: large price + button side-by-side */
.npdm-tier-right {
  display: flex; align-items: center; gap: 7px; flex-shrink: 0;
}
.npdm-tier-price-lg {
  font-size: .95rem; font-weight: 800; color: #1a1a1a;
  min-width: 28px; text-align: right;
}

.npdm-no-plans {
  text-align: center; color: #aaa; padding: 16px; font-size: .85rem;
}

/* ====================================================================
   FOOTER — centered login link
   ==================================================================== */
.npdm-modal-footer {
  text-align: center;
  padding: 6px 10px 10px;
  font-size: .72rem; color: #888;
}
.npdm-footer-login a {
  color: #1a1a1a; font-weight: 700; text-decoration: none;
}
.npdm-footer-login a:hover { text-decoration: underline; }

/* ====================================================================
   PRICING PAGE  [npd_pricing]
   ==================================================================== */
.npdm-pricing-page { max-width: 860px; margin: 0 auto; padding: 40px 16px; text-align: center; }
.npdm-pricing-title { font-size: 1.9rem; font-weight: 800; color: var(--npd-primary); margin: 0 0 8px; }
.npdm-pricing-subtitle { color: #666; font-size: 1rem; margin: 0 0 24px; }
.npdm-current-plan-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 20px; border-radius: 50px;
  font-size: .88rem; font-weight: 600; margin-bottom: 28px;
}
.npdm-badge--active { background: #e8f5e9; color: var(--npd-green); }
.npdm-badge--free   { background: #f5f5f5; color: #666; }
.npdm-section-label {
  display: flex; align-items: center; gap: 12px;
  margin: 32px 0 16px; font-size: .78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: var(--npd-primary);
}
.npdm-section-label::before, .npdm-section-label::after {
  content: ''; flex: 1; height: 1px; background: #e8c8d0;
}
.npdm-pricing-cards { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.npdm-pricing-card {
  background: #fff; border: 2px solid #e8c8d0;
  border-radius: var(--npd-radius); padding: 26px 18px 20px;
  min-width: 160px; max-width: 200px; flex: 1;
  position: relative; transition: transform .2s, box-shadow .2s; text-align: center;
}
.npdm-pricing-card:hover { transform: translateY(-4px); box-shadow: 0 8px 28px rgba(94,29,45,.12); }
.npdm-pricing-card--featured { border-color: var(--npd-gold); background: var(--npd-gold-lt); }
.npdm-pricing-badge {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--npd-gold); color: #fff;
  font-size: .68rem; font-weight: 700; padding: 2px 10px;
  border-radius: 50px; white-space: nowrap;
}
.npdm-pricing-plan-name { font-size: .92rem; font-weight: 700; color: var(--npd-primary); margin-bottom: 10px; }
.npdm-pricing-amount { display: flex; align-items: baseline; justify-content: center; gap: 2px; margin-bottom: 14px; }
.npdm-pricing-symbol { font-size: 1rem; font-weight: 700; color: var(--npd-primary); }
.npdm-pricing-number { font-size: 2.1rem; font-weight: 800; color: var(--npd-primary); line-height: 1; }
.npdm-pricing-period { font-size: .72rem; color: #888; }
.npdm-pricing-features { list-style: none; margin: 0 0 16px; padding: 0; text-align: left; }
.npdm-pricing-features li { font-size: .78rem; color: #444; padding: 4px 0; display: flex; gap: 6px; align-items: flex-start; }
.npdm-pricing-features li i { color: var(--npd-green); flex-shrink: 0; margin-top: 2px; }
.npdm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 10px; font-size: .85rem; font-weight: 700;
  text-decoration: none; cursor: pointer; transition: background .15s, transform .15s;
  border: 2px solid transparent; width: 100%; box-sizing: border-box;
}
.npdm-btn-primary { background: var(--npd-primary); border-color: var(--npd-primary); color: #fff; }
.npdm-btn-primary:hover { background: var(--npd-primary-d); color: #fff; text-decoration: none; transform: translateY(-1px); }
.npdm-btn-outline { background: #fff; border-color: #e8c8d0; color: var(--npd-primary); }
.npdm-btn-outline:hover { border-color: var(--npd-primary); background: #fdf5f7; text-decoration: none; }
.npdm-pricing-stack-note {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 20px; background: #fff8e1; border-radius: 10px;
  font-size: .82rem; color: #5d4037; margin: 24px auto 0; max-width: 540px;
}
.npdm-pricing-stack-note i { color: #f9a825; flex-shrink: 0; }
.npdm-pricing-note { margin-top: 18px; font-size: .75rem; color: #aaa; display: flex; align-items: center; justify-content: center; gap: 6px; }

/* Member badge */
.npdm-member-badge { display: inline-block; padding: 3px 12px; border-radius: 20px; font-size: .78rem; font-weight: 700; }
.npdm-badge-free    { background: #f5f5f5; color: #666; }
.npdm-badge-full    { background: var(--npd-gold-lt); color: var(--npd-gold); }
.npdm-badge-active  { background: #e8f5e9; color: var(--npd-green); }
.npdm-badge-expired { background: #ffebee; color: #c62828; }
.npdm-badge-guest   { background: #f5f5f5; color: #999; }

/* ====================================================================
   RESPONSIVE
   ==================================================================== */
@media (max-width: 460px) {
  .npdm-modal-header   { padding: 18px 16px 14px; }
  .npdm-modal-title    { font-size: 1.15rem; }
  .npdm-modal-body     { padding: 10px 10px 4px; gap: 10px; }
  .npdm-tiers          { padding: 6px 9px 10px; }
  .npdm-story-price    { font-size: 1.4rem; }
  .npdm-tier-price-lg  { font-size: 1rem; }
  .npdm-btn-gold       { padding: 8px 13px; font-size: .78rem; }
}
