/**
 * Mesh pricing cards — reference layout, AIO navy / gold accents.
 * Used on /pricing (auth lean) and CMS landing #pricing.
 */
.aio-mesh-card {
  --mesh-ink: var(--brand-ink, #0a1733);
  --mesh-navy: var(--brand-navy, #1e3a6f);
  --mesh-gold: var(--brand-gold, #d4a24c);
  --mesh-surface: var(--bg-surface, #fff);
  --mesh-muted: var(--muted-foreground, #64748b);
  --mesh-text: var(--foreground, #0f172a);
  --mesh-radius: 28px;
  --mesh-pad: 10px;
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-width: 0;
  background: var(--mesh-surface);
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: var(--mesh-radius);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.aio-mesh-card__panel {
  position: relative;
  margin: var(--mesh-pad);
  margin-bottom: 0;
  padding: 22px 22px 20px;
  border-radius: calc(var(--mesh-radius) - 6px);
  overflow: hidden;
  isolation: isolate;
  background: #f8fafc;
}

.aio-mesh-card__panel::before {
  content: "";
  position: absolute;
  inset: -28%;
  z-index: 0;
  pointer-events: none;
  filter: blur(36px) saturate(1.15);
  opacity: 1;
  background:
    radial-gradient(ellipse 58% 52% at 14% 18%, rgba(30, 58, 111, 0.55), transparent 62%),
    radial-gradient(ellipse 52% 48% at 86% 22%, rgba(212, 162, 76, 0.5), transparent 58%),
    radial-gradient(ellipse 62% 52% at 46% 90%, rgba(10, 23, 51, 0.28), transparent 65%),
    linear-gradient(145deg, #e4ecf8 0%, #f8f0e2 55%, #eef2f8 100%);
}

.aio-mesh-card--tone-1 .aio-mesh-card__panel::before {
  background:
    radial-gradient(ellipse 55% 50% at 16% 24%, rgba(30, 58, 111, 0.48), transparent 62%),
    radial-gradient(ellipse 48% 42% at 86% 20%, rgba(212, 162, 76, 0.32), transparent 58%),
    radial-gradient(ellipse 55% 48% at 40% 90%, rgba(100, 116, 139, 0.22), transparent 65%),
    linear-gradient(150deg, #e6eef9 0%, #f4efe6 100%);
}

.aio-mesh-card--tone-2 .aio-mesh-card__panel::before {
  background:
    radial-gradient(ellipse 52% 48% at 22% 18%, rgba(212, 162, 76, 0.42), transparent 60%),
    radial-gradient(ellipse 50% 46% at 78% 30%, rgba(30, 58, 111, 0.36), transparent 60%),
    radial-gradient(ellipse 58% 50% at 50% 92%, rgba(10, 23, 51, 0.18), transparent 65%),
    linear-gradient(155deg, #f7f1e4 0%, #e9f0f8 100%);
}

.aio-mesh-card--tone-3 .aio-mesh-card__panel::before {
  background:
    radial-gradient(ellipse 50% 48% at 20% 30%, rgba(10, 23, 51, 0.4), transparent 60%),
    radial-gradient(ellipse 52% 44% at 80% 18%, rgba(30, 58, 111, 0.4), transparent 58%),
    radial-gradient(ellipse 50% 48% at 55% 88%, rgba(212, 162, 76, 0.34), transparent 62%),
    linear-gradient(148deg, #e4ebf6 0%, #f3eee6 100%);
}

.aio-mesh-card--featured {
  border-color: rgba(30, 58, 111, 0.22);
  box-shadow: 0 22px 48px rgba(30, 58, 111, 0.14);
}

.aio-mesh-card__head {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.aio-mesh-card__name {
  margin: 0;
  font-family: var(--brand-font-sans, Inter, system-ui, sans-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--mesh-ink);
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.aio-mesh-card__badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  background: rgba(212, 162, 76, 0.95);
  color: #0a1733;
  box-shadow: 0 1px 2px rgba(10, 23, 51, 0.08);
}

.aio-mesh-card__badge--popular {
  background: #f59e0b;
  color: #fff;
}

.aio-mesh-card__price-row {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 8px;
  margin-bottom: 10px;
}

.aio-mesh-card__price {
  font-family: var(--brand-font-sans, Inter, system-ui, sans-serif);
  font-size: clamp(1.75rem, 2.4vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--mesh-ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.aio-mesh-card__price .aio-mesh-card__currency {
  font-size: 0.55em;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-right: 0.25em;
  color: var(--mesh-muted);
  vertical-align: 0.15em;
}
.aio-mesh-card__price .aio-mesh-card__currency--after {
  margin-right: 0;
  margin-left: 0.25em;
}

.aio-mesh-card__interval {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--mesh-muted);
}

.aio-mesh-card__desc {
  position: relative;
  z-index: 1;
  margin: 0 0 18px;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: rgba(15, 23, 42, 0.72);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-height: 0;
}

.aio-mesh-card__price--free {
  font-size: 1.15rem !important;
}

.aio-mesh-card__cta,
a.aio-mesh-card__cta {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 12px 20px;
  border: 0 !important;
  border-radius: 999px !important;
  background: var(--mesh-ink) !important;
  color: #fff !important;
  font-family: var(--brand-font-sans, Inter, system-ui, sans-serif);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none !important;
  box-shadow: 0 8px 18px rgba(10, 23, 51, 0.22);
}

.aio-mesh-card__cta:hover,
.aio-mesh-card__cta:focus-visible,
a.aio-mesh-card__cta:hover,
a.aio-mesh-card__cta:focus-visible {
  background: #061022 !important;
  color: #fff !important;
  outline: 2px solid var(--mesh-navy);
  outline-offset: 2px;
}

.aio-mesh-card__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 12px;
  padding: 22px 26px 26px;
}

.aio-mesh-card--compact .aio-mesh-card__panel {
  padding: 16px 14px 14px;
}

.aio-mesh-card--compact .aio-mesh-card__head {
  margin-bottom: 8px;
}

.aio-mesh-card--compact .aio-mesh-card__name {
  font-size: 0.95rem;
}

.aio-mesh-card--compact .aio-mesh-card__price {
  font-size: clamp(1.35rem, 1.6vw, 1.75rem);
  font-variant-numeric: tabular-nums;
}

.aio-mesh-card--compact .aio-mesh-card__desc {
  margin-bottom: 12px;
  font-size: 0.75rem;
  -webkit-line-clamp: 2;
}

.aio-mesh-card--compact .aio-mesh-card__cta {
  min-height: 40px;
  padding: 10px 14px;
  font-size: 0.8125rem;
}

.aio-mesh-card--compact .aio-mesh-card__body {
  padding: 14px 14px 16px;
  gap: 10px;
}

.aio-mesh-card__features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 auto;
}

.aio-mesh-card__features--core {
  gap: 8px;
  flex: 0 0 auto;
}

.aio-mesh-card--compact .aio-mesh-card__feature {
  font-size: 0.78rem;
  gap: 8px;
}

.aio-mesh-card--compact .aio-mesh-card__check {
  width: 16px;
  height: 16px;
  font-size: 8px;
}

.aio-mesh-card__modules {
  margin-top: 2px;
}

.aio-mesh-card__modules-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mesh-muted);
  margin-bottom: 6px;
}

.aio-mesh-card__module-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.aio-mesh-card__module-chips li {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(15, 23, 42, 0.03);
  font-size: 0.6875rem;
  font-weight: 600;
  color: rgba(15, 23, 42, 0.78);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.aio-mesh-card__module-chips li.is-more {
  background: rgba(30, 58, 111, 0.08);
  border-color: rgba(30, 58, 111, 0.18);
  color: var(--mesh-navy);
}

.aio-mesh-card__feature {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.875rem;
  line-height: 1.4;
  color: rgba(15, 23, 42, 0.78);
}

.aio-mesh-card__check {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 999px;
  border: 1.5px solid rgba(15, 23, 42, 0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--mesh-ink);
  font-size: 10px;
  line-height: 1;
}

.aio-mesh-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

/* Duration pill (pricing page) */
.aio-duration-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  width: auto;
  max-width: 100%;
  padding: 4px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.aio-duration-pill__opt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  font-family: var(--brand-font-sans, Inter, system-ui, sans-serif);
  font-size: 13px;
  font-weight: 650;
  line-height: 1;
  color: #334155 !important;
  cursor: pointer;
  white-space: nowrap;
}

.aio-duration-pill__opt.is-active {
  background: #f3ebe0;
  color: #0a1733 !important;
}

.aio-duration-pill__opt:focus-visible {
  outline: 2px solid #1e3a6f;
  outline-offset: 2px;
}

.aio-duration-pill__save {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  background: #d4a24c;
  color: #0a1733;
}

.aio-mesh-card__save-note {
  position: relative;
  z-index: 1;
  margin: -4px 0 10px;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #8a6424;
}

/* Pricing grid helpers (landing `.card-rail` keeps its own flex rail) */
#packages.aio-mesh-grid,
.aio-mesh-grid:not(.card-rail) {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
  justify-items: stretch;
  width: 100%;
}

#packages .aio-mesh-card,
.aio-mesh-grid .aio-mesh-card {
  max-width: none;
}

@media (max-width: 1280px) {
  #packages.aio-mesh-grid,
  .aio-mesh-grid:not(.card-rail) {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (hover: hover) and (pointer: fine) {
  .aio-mesh-card {
    transition:
      transform var(--motion-duration-fast-02, 110ms) var(--motion-easing-productive-standard, ease),
      box-shadow var(--motion-duration-fast-02, 110ms) var(--motion-easing-productive-standard, ease);
  }
  .aio-mesh-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 26px 52px rgba(15, 23, 42, 0.12);
  }
}

@media (prefers-reduced-motion: reduce) {
  .aio-mesh-card,
  .aio-mesh-card:hover {
    transition: none;
    transform: none;
  }
}

/* Dark: keep a dark panel + light ink. The light ::before mesh must be
   overridden — otherwise name/price/desc (light) sit on a glass/light wash. */
html.dark .aio-mesh-card,
html[data-color-mode="dark"] .aio-mesh-card,
html.dark .price-card.aio-mesh-card,
html[data-color-mode="dark"] .price-card.aio-mesh-card {
  --mesh-ink: #e7eefc;
  --mesh-text: #e7eefc;
  --mesh-muted: rgba(231, 238, 252, 0.72);
  --mesh-surface: #1a1d27;
  background: var(--mesh-surface);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

html.dark .aio-mesh-card__panel,
html[data-color-mode="dark"] .aio-mesh-card__panel {
  background: #1c2436;
}

html.dark .aio-mesh-card__panel::before,
html[data-color-mode="dark"] .aio-mesh-card__panel::before {
  opacity: 1;
  filter: blur(36px) saturate(1.1);
  background:
    radial-gradient(ellipse 58% 52% at 14% 18%, rgba(30, 58, 111, 0.55), transparent 62%),
    radial-gradient(ellipse 52% 48% at 86% 22%, rgba(212, 162, 76, 0.28), transparent 58%),
    radial-gradient(ellipse 62% 52% at 46% 90%, rgba(10, 23, 51, 0.55), transparent 65%),
    linear-gradient(145deg, #152038 0%, #1a2234 55%, #141c2c 100%);
}

html.dark .aio-mesh-card--tone-1 .aio-mesh-card__panel::before,
html[data-color-mode="dark"] .aio-mesh-card--tone-1 .aio-mesh-card__panel::before {
  background:
    radial-gradient(ellipse 55% 50% at 16% 24%, rgba(30, 58, 111, 0.5), transparent 62%),
    radial-gradient(ellipse 48% 42% at 86% 20%, rgba(212, 162, 76, 0.2), transparent 58%),
    radial-gradient(ellipse 55% 48% at 40% 90%, rgba(100, 116, 139, 0.2), transparent 65%),
    linear-gradient(150deg, #16233a 0%, #1a2130 100%);
}

html.dark .aio-mesh-card--tone-2 .aio-mesh-card__panel::before,
html[data-color-mode="dark"] .aio-mesh-card--tone-2 .aio-mesh-card__panel::before {
  background:
    radial-gradient(ellipse 52% 48% at 22% 18%, rgba(212, 162, 76, 0.32), transparent 60%),
    radial-gradient(ellipse 50% 46% at 78% 30%, rgba(30, 58, 111, 0.42), transparent 60%),
    radial-gradient(ellipse 58% 50% at 50% 92%, rgba(10, 23, 51, 0.45), transparent 65%),
    linear-gradient(155deg, #1c1f2e 0%, #162338 100%);
}

html.dark .aio-mesh-card--tone-3 .aio-mesh-card__panel::before,
html[data-color-mode="dark"] .aio-mesh-card--tone-3 .aio-mesh-card__panel::before {
  background:
    radial-gradient(ellipse 50% 48% at 20% 30%, rgba(10, 23, 51, 0.5), transparent 60%),
    radial-gradient(ellipse 52% 44% at 80% 18%, rgba(30, 58, 111, 0.45), transparent 58%),
    radial-gradient(ellipse 50% 48% at 55% 88%, rgba(212, 162, 76, 0.22), transparent 62%),
    linear-gradient(148deg, #151e32 0%, #1a2030 100%);
}

html.dark .aio-mesh-card__name,
html.dark .aio-mesh-card__price,
html.dark .aio-mesh-card__feature,
html[data-color-mode="dark"] .aio-mesh-card__name,
html[data-color-mode="dark"] .aio-mesh-card__price,
html[data-color-mode="dark"] .aio-mesh-card__feature {
  color: var(--mesh-ink);
}

html.dark .aio-mesh-card__desc,
html.dark .aio-mesh-card__interval,
html.dark .aio-mesh-card__price .aio-mesh-card__currency,
html.dark .aio-mesh-card__modules-label,
html[data-color-mode="dark"] .aio-mesh-card__desc,
html[data-color-mode="dark"] .aio-mesh-card__interval,
html[data-color-mode="dark"] .aio-mesh-card__price .aio-mesh-card__currency,
html[data-color-mode="dark"] .aio-mesh-card__modules-label {
  color: var(--mesh-muted);
}

html.dark .aio-mesh-card__save-note,
html[data-color-mode="dark"] .aio-mesh-card__save-note {
  color: #e0c07a;
}

html.dark .aio-mesh-card__module-chips li,
html[data-color-mode="dark"] .aio-mesh-card__module-chips li {
  border-color: rgba(231, 238, 252, 0.14);
  background: rgba(231, 238, 252, 0.06);
  color: rgba(231, 238, 252, 0.88);
}

html.dark .aio-mesh-card__module-chips li.is-more,
html[data-color-mode="dark"] .aio-mesh-card__module-chips li.is-more {
  background: rgba(30, 58, 111, 0.35);
  border-color: rgba(212, 162, 76, 0.28);
  color: #e7eefc;
}

html.dark .aio-mesh-card__check,
html[data-color-mode="dark"] .aio-mesh-card__check {
  border-color: rgba(231, 238, 252, 0.35);
  color: var(--mesh-ink);
}

/* Light CTA on dark panel — must beat base `background/color !important`. */
html.dark .aio-mesh-card__cta,
html.dark a.aio-mesh-card__cta,
html[data-color-mode="dark"] .aio-mesh-card__cta,
html[data-color-mode="dark"] a.aio-mesh-card__cta {
  background: #e7eefc !important;
  color: var(--brand-ink, #0a1733) !important;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

html.dark .aio-mesh-card__cta:hover,
html.dark .aio-mesh-card__cta:focus-visible,
html.dark a.aio-mesh-card__cta:hover,
html.dark a.aio-mesh-card__cta:focus-visible,
html[data-color-mode="dark"] .aio-mesh-card__cta:hover,
html[data-color-mode="dark"] .aio-mesh-card__cta:focus-visible,
html[data-color-mode="dark"] a.aio-mesh-card__cta:hover,
html[data-color-mode="dark"] a.aio-mesh-card__cta:focus-visible {
  background: #fff !important;
  color: var(--brand-ink, #0a1733) !important;
  outline-color: var(--mesh-gold, var(--brand-gold, #d4a24c));
}

html.dark .aio-duration-pill,
html[data-color-mode="dark"] .aio-duration-pill {
  background: #1a1d27;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

html.dark .aio-duration-pill__opt,
html[data-color-mode="dark"] .aio-duration-pill__opt {
  color: rgba(231, 238, 252, 0.82) !important;
}

html.dark .aio-duration-pill__opt.is-active,
html[data-color-mode="dark"] .aio-duration-pill__opt.is-active {
  background: rgba(212, 162, 76, 0.22);
  color: #e7eefc !important;
}
