/* ═══════════════════════════════════════════════════════════════════════════
   GetJustly — Upgrade / plans (modal + /upgrade page)
   Theme-aware (light default + dark via gj_theme.css), petite B/W.
   The "featured" plan is an inverted solid card (black in light, white in
   dark) for a premium pure-monochrome pricing look.
   ─────────────────────────────────────────────────────────────────────────── */

/* ── Modal shell ── */
.gj-up-backdrop {
  position: fixed; inset: 0; z-index: 2147483400;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(0,0,0,0.55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .2s ease;
}
.gj-up-backdrop.show { opacity: 1; }

.gj-up-modal {
  width: 100%; max-width: 940px; max-height: 92vh; overflow-y: auto;
  background: var(--gj-surface, #fff); color: var(--gj-text, #171717);
  border: 1px solid var(--gj-border, rgba(0,0,0,0.08));
  border-radius: 20px; box-shadow: 0 24px 70px rgba(0,0,0,0.4);
  padding: 30px 32px 24px;
  font-family: var(--gj-font, -apple-system, BlinkMacSystemFont, "Inter", sans-serif);
  transform: translateY(8px) scale(0.985); opacity: 0;
  transition: transform .26s cubic-bezier(0.22,1,0.36,1), opacity .26s ease;
}
.gj-up-backdrop.show .gj-up-modal { transform: translateY(0) scale(1); opacity: 1; }

/* When rendered inline on the /upgrade page */
.gj-up-inline .gj-up-modal {
  max-width: 100%; box-shadow: none; border: none; background: transparent;
  padding: 0; transform: none; opacity: 1; max-height: none; overflow: visible;
}

/* ── Header ── */
.gj-up-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 4px; }
.gj-up-eyebrow { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.09em; color: var(--gj-text-muted, rgba(0,0,0,0.45)); }
.gj-up-title { font-size: 1.35rem; font-weight: 600; letter-spacing: -0.02em; margin: 4px 0 4px; color: var(--gj-text); }
.gj-up-sub { font-size: 0.875rem; color: var(--gj-text-secondary, rgba(0,0,0,0.6)); margin: 0; line-height: 1.5; }
.gj-up-close {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 9px; border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--gj-accent-dim, rgba(0,0,0,0.05)); color: var(--gj-text-secondary);
  transition: background .15s, color .15s;
}
.gj-up-close:hover { background: var(--gj-border, rgba(0,0,0,0.1)); color: var(--gj-text); }
.gj-up-close svg { width: 16px; height: 16px; }
.gj-up-inline .gj-up-close { display: none; }

/* ── "Your plan" management panel ── */
.gj-up-myplan {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin: 20px 0 2px; padding: 15px 18px;
  background: var(--gj-surface-2, #fafafa);
  border: 1px solid var(--gj-border, rgba(0,0,0,0.08)); border-radius: 14px;
}
.gj-up-myplan-head { display: flex; align-items: center; gap: 10px; }
.gj-up-myplan-name { font-size: 0.95rem; font-weight: 600; letter-spacing: -0.01em; color: var(--gj-text); }
.gj-up-myplan-badge {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em;
  padding: 3px 8px; border-radius: 999px; line-height: 1;
}
.gj-up-myplan-badge.ok { background: var(--gj-accent, #171717); color: var(--gj-on-accent, #fff); }
.gj-up-myplan-badge.warn { background: #b45309; color: #fff; }
.gj-up-myplan-badge.muted {
  background: var(--gj-accent-dim, rgba(0,0,0,0.06)); color: var(--gj-text-secondary);
  border: 1px solid var(--gj-border);
}
.gj-up-myplan-meta { font-size: 0.78rem; color: var(--gj-text-secondary, rgba(0,0,0,0.6)); margin-top: 5px; line-height: 1.4; max-width: 46ch; }
.gj-up-myplan-actions { flex-shrink: 0; }
.gj-up-link {
  background: none; border: none; cursor: pointer; font-family: inherit;
  font-size: 0.8rem; font-weight: 600; color: var(--gj-text-secondary);
  text-decoration: underline; text-underline-offset: 2px; padding: 4px 2px;
  transition: color .15s;
}
.gj-up-link:hover { color: var(--gj-text, #171717); }
.gj-up-link[disabled] { opacity: 0.55; cursor: default; }
@media (max-width: 560px) {
  .gj-up-myplan { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* ── Plan grid ── */
.gj-up-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 22px; }
@media (max-width: 760px) { .gj-up-grid { grid-template-columns: 1fr; gap: 14px; } }

.gj-up-card {
  display: flex; flex-direction: column;
  background: var(--gj-surface-2, #fafafa);
  border: 1px solid var(--gj-border, rgba(0,0,0,0.08));
  border-radius: 16px; padding: 24px 22px 22px;
  position: relative; transition: border-color .15s, transform .12s;
}
.gj-up-card:hover { border-color: var(--gj-border-strong, rgba(0,0,0,0.16)); }

/* Featured = inverted solid card (premium B/W) — extra top room for the badge */
.gj-up-card.featured {
  background: var(--gj-accent, #171717); color: var(--gj-on-accent, #fff);
  border-color: var(--gj-accent, #171717);
  padding-top: 28px;
}
.gj-up-badge {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  background: var(--gj-on-accent, #fff); color: var(--gj-accent, #171717);
  padding: 4px 11px; border-radius: 999px; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.gj-up-name { font-size: 0.95rem; font-weight: 600; margin: 0 0 2px; letter-spacing: -0.01em; }
.gj-up-price { font-size: 1.9rem; font-weight: 650; letter-spacing: -0.03em; line-height: 1.1; margin: 10px 0 2px; display: flex; align-items: baseline; gap: 5px; }
.gj-up-price .per { font-size: 0.8rem; font-weight: 400; opacity: 0.6; letter-spacing: 0; }
.gj-up-tag { font-size: 0.78rem; opacity: 0.62; margin: 2px 0 22px; min-height: 1.1em; }

.gj-up-feats { list-style: none; margin: 4px 0 24px; padding: 0; display: flex; flex-direction: column; gap: 11px; flex: 1; }
.gj-up-feat { display: flex; align-items: flex-start; gap: 9px; font-size: 0.82rem; line-height: 1.35; }
.gj-up-feat svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; color: currentColor; opacity: 0.85; }
.gj-up-card:not(.featured) .gj-up-feat { color: var(--gj-text-secondary, rgba(0,0,0,0.6)); }
.gj-up-card:not(.featured) .gj-up-feat svg { color: var(--gj-text, #171717); opacity: 0.9; }
/* not-included rows: muted, dash icon */
.gj-up-feat.off { opacity: 0.4; }
.gj-up-feat.off svg { opacity: 0.6; }

/* CTA */
.gj-up-cta {
  width: 100%; box-sizing: border-box; margin-top: auto;
  padding: 11px 16px; border-radius: 10px; border: 1px solid transparent;
  font-size: 0.875rem; font-weight: 600; cursor: pointer;
  font-family: inherit; text-align: center; text-decoration: none; display: block;
  transition: opacity .15s, background .15s, border-color .15s, transform .1s;
}
.gj-up-cta:active { transform: scale(0.985); }
/* default paid (non-featured) = primary */
.gj-up-cta { background: var(--gj-accent, #171717); color: var(--gj-on-accent, #fff); }
.gj-up-cta:hover { background: var(--gj-accent-hover, #000); }
/* featured card = inverted CTA so it pops on the solid card */
.featured .gj-up-cta { background: var(--gj-on-accent, #fff); color: var(--gj-accent, #171717); }
.featured .gj-up-cta:hover { opacity: 0.9; }
/* ghost (current / free / downgrade) */
.gj-up-cta--ghost { background: transparent; color: var(--gj-text, #171717); border-color: var(--gj-border-strong, rgba(0,0,0,0.16)); }
.gj-up-cta--ghost:hover { background: var(--gj-accent-dim, rgba(0,0,0,0.05)); border-color: var(--gj-border-strong); }
.featured .gj-up-cta--ghost { background: transparent; color: var(--gj-on-accent); border-color: rgba(255,255,255,0.35); }
.gj-up-cta[disabled] { opacity: 0.5; cursor: default; }
.gj-up-cta[disabled]:active { transform: none; }
.gj-up-cta.is-busy { pointer-events: none; opacity: 0.7; }

/* ── Footer ── */
.gj-up-foot {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--gj-border);
  font-size: 0.74rem; color: var(--gj-text-muted, rgba(0,0,0,0.45)); text-align: center;
}
.gj-up-foot svg { width: 13px; height: 13px; flex-shrink: 0; }
.gj-up-inline .gj-up-foot { border-top: none; }

/* ── Loading skeleton ── */
.gj-up-skel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 760px) { .gj-up-skel-grid { grid-template-columns: 1fr; } }
.gj-up-skel { height: 300px; border-radius: 16px; background: var(--gj-accent-dim, rgba(0,0,0,0.05)); position: relative; overflow: hidden; }
.gj-up-skel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, var(--gj-surface, rgba(255,255,255,0.4)), transparent);
  opacity: 0.5; transform: translateX(-100%); animation: gj-up-shimmer 1.3s infinite;
}
@keyframes gj-up-shimmer { 100% { transform: translateX(100%); } }

@media (prefers-reduced-motion: reduce) {
  .gj-up-backdrop, .gj-up-modal { transition: none; }
  .gj-up-skel::after { animation: none; }
}
