.membership-plans {
  position: relative;
  overflow: hidden;
  padding: 88px 24px;
  color: #f8fbff;
  background: #050b18;
  border-block: 1px solid rgba(122, 156, 218, 0.14);
}

.membership-plans::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 18%, rgba(25, 118, 255, 0.16), transparent 34%),
    radial-gradient(circle at 84% 72%, rgba(21, 189, 143, 0.10), transparent 30%);
}

.membership-plans-inner {
  position: relative;
  width: min(1180px, 100%);
  margin-inline: auto;
}

.membership-heading {
  max-width: 680px;
  margin: 0 auto 28px;
  text-align: center;
}

.membership-heading > span {
  color: #7fb0ff;
  font-size: 12px;
  font-weight: 900;
}

.membership-heading h2 {
  margin: 8px 0 10px;
  color: #fff;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.25;
  letter-spacing: 0;
}

.membership-heading p {
  margin: 0;
  color: #91a1ba;
  font-size: 14px;
  line-height: 1.9;
}

.membership-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 28px;
}

.membership-segment {
  display: grid;
  grid-template-columns: repeat(2, minmax(112px, 1fr));
  gap: 4px;
  padding: 4px;
  background: rgba(12, 24, 45, 0.88);
  border: 1px solid rgba(133, 165, 222, 0.18);
  border-radius: 8px;
}

.membership-segment button {
  min-height: 44px;
  padding: 8px 14px;
  color: #9baac0;
  background: transparent;
  border: 0;
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.membership-segment button.is-active {
  color: #fff;
  background: #256df4;
  box-shadow: 0 8px 22px rgba(37, 109, 244, 0.24);
}

.membership-segment.billing button.is-active {
  background: #087f6b;
  box-shadow: 0 8px 22px rgba(8, 127, 107, 0.22);
}

.membership-segment small {
  display: block;
  margin-top: 2px;
  color: #7ee6bd;
  font-size: 9px;
}

.membership-segment button.is-active small { color: #d6fff0; }

.membership-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.membership-cards.is-coach {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.membership-plan-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 100%;
  flex-direction: column;
  padding: 26px;
  background: rgba(10, 20, 38, 0.88);
  border: 1px solid rgba(133, 165, 222, 0.18);
  border-radius: 8px;
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.18);
}

.membership-plan-card.is-featured {
  border-color: rgba(48, 128, 255, 0.62);
  box-shadow: 0 22px 60px rgba(25, 94, 222, 0.22);
}

.membership-plan-badge {
  position: absolute;
  top: -10px;
  left: 14px;
  z-index: 1;
  margin: 0;
  padding: 5px 9px;
  color: #ddecff;
  background: rgba(47, 119, 255, 0.18);
  border: 1px solid rgba(72, 139, 255, 0.35);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 900;
  transform: rotate(-3deg);
  transform-origin: center;
  white-space: nowrap;
}

.membership-plan-card h3 {
  margin: 0;
  color: #fff;
  font-size: 20px;
  line-height: 1.45;
}

.membership-plan-card > p {
  min-height: 48px;
  margin: 8px 0 20px;
  color: #91a1ba;
  font-size: 12px;
  line-height: 1.9;
}

.membership-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 20px;
  color: #fff;
  font-size: 30px;
  font-weight: 950;
}

.membership-price small {
  color: #8292aa;
  font-size: 11px;
  font-weight: 800;
}

.membership-features {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0 0 24px;
  list-style: none;
}

.membership-features li {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  color: #c9d4e5;
  font-size: 12px;
  line-height: 1.7;
}

.membership-features li::before {
  content: "✓";
  color: #58ddb0;
  font-weight: 950;
}

.membership-plan-action {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  padding: 10px 16px;
  color: #fff;
  background: #256df4;
  border: 1px solid #397eff;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 950;
  text-decoration: none;
}

.membership-plan-card:not(.is-featured) .membership-plan-action {
  color: #d9e6fa;
  background: rgba(29, 49, 82, 0.72);
  border-color: rgba(133, 165, 222, 0.28);
}

.membership-cards:not(.is-coach) .membership-plan-card {
  text-align: center;
}

.membership-cards:not(.is-coach) .membership-price {
  justify-content: center;
}

.membership-cards:not(.is-coach) .membership-features {
  width: min(100%, 390px);
  margin-inline: auto;
  text-align: right;
}

.membership-cards:not(.is-coach) .membership-plan-action {
  width: 100%;
}

.membership-cards.is-coach .membership-plan-card {
  align-items: center;
  text-align: center;
}

.membership-cards.is-coach .membership-price {
  justify-content: center;
}

.membership-cards.is-coach .membership-features {
  width: 100%;
}

.membership-cards.is-coach .membership-features li {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  text-align: center;
}

.membership-cards.is-coach .membership-plan-action {
  width: 100%;
}

.membership-comparison {
  margin-top: 18px;
  padding: 22px;
  background: rgba(8, 17, 33, 0.9);
  border: 1px solid rgba(133, 165, 222, 0.18);
  border-radius: 8px;
}

.membership-comparison-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.membership-comparison-heading h3 {
  margin: 0;
  color: #fff;
  font-size: 18px;
}

.membership-comparison-heading span {
  color: #7fb0ff;
  font-size: 11px;
  font-weight: 900;
}

.membership-table-scroll { overflow-x: auto; scrollbar-width: thin; }

.membership-comparison table {
  width: 100%;
  min-width: 660px;
  border-collapse: collapse;
  text-align: right;
}

.membership-comparison th,
.membership-comparison td {
  padding: 14px 12px;
  color: #b8c5d9;
  border-bottom: 1px solid rgba(133, 165, 222, 0.12);
  font-size: 12px;
  line-height: 1.7;
}

.membership-comparison th {
  color: #fff;
  background: rgba(30, 55, 94, 0.34);
  font-weight: 950;
}

.membership-comparison th.is-highlight,
.membership-comparison td.is-highlight {
  color: #eaf2ff;
  background: rgba(39, 108, 232, 0.11);
}

.membership-comparison tbody tr:last-child td { border-bottom: 0; }

@media (max-width: 900px) {
  .membership-plans { padding: 64px 18px; }
  .membership-cards.is-coach { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .membership-plans { padding: 52px 14px; }
  .membership-heading { margin-bottom: 22px; }
  .membership-heading h2 { font-size: 27px; }
  .membership-controls { align-items: stretch; flex-direction: column; }
  .membership-segment { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .membership-cards { grid-template-columns: 1fr; }
  .membership-plan-card { padding: 20px; }
  .membership-plan-badge { top: -9px; left: 12px; font-size: 9px; }
  .membership-plan-card > p { min-height: 0; }
  .membership-price { font-size: 27px; }
  .membership-comparison { padding: 18px 14px; }
  .membership-comparison-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
  .membership-table-scroll::after {
    display: block;
    margin-top: 10px;
    color: #71829c;
    content: "جدول را به چپ و راست بکش";
    font-size: 10px;
    text-align: center;
  }
}

.membership-plans-mobile { padding-inline: 14px; }
