/* ─── Memberships — plan cards (one clay "pop" card), billing note, and the
   checkout preview modal */

.plans {
  display: grid;
  gap: 22px;
  align-items: stretch;

  @media (min-width: 768px) {
    grid-template-columns: 1fr 1fr;

    & .plan:last-child:nth-child(odd) {
      grid-column: span 2;
      max-width: 560px;
      width: 100%;
      justify-self: center;
    }
  }

  @media (min-width: 1200px) {
    grid-template-columns: repeat(3, 1fr);

    & .plan:last-child:nth-child(odd) {
      grid-column: auto;
      max-width: none;
    }
  }
}

.plan {
  display: flex;
  flex-direction: column;
  padding: 38px 32px;
  border-radius: var(--r);
  background: var(--cream);
  border: 1px solid var(--line);
  transition: transform 0.35s var(--ease), box-shadow 0.35s;

  &:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lift);
  }

  & .ticks {
    margin: 22px 0 30px;
  }

  & .btn {
    margin-top: auto;
    width: 100%;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .plan.is-flash {
    animation: plan-flash 1.6s var(--ease);
  }

  @keyframes plan-flash {
    25% {
      transform: scale(1.03);
    }
  }
}

.plan__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.plan__name {
  font-size: 2.2rem;
  line-height: 1;
}

.plan__tag {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--cream);
  color: var(--clay-d);
  padding: 6px 12px;
  border-radius: var(--pill);
  white-space: nowrap;
}

.plan__desc {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 10px 0 22px;
  min-height: 48px;
}

.plan__price {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.plan__amt {
  font-family: var(--font-title);
  font-size: 4.4rem;
  line-height: 1;
}

.plan__per {
  color: var(--muted);
}

.plan__bill {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 8px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.plan--pop {
  background: var(--clay);
  color: var(--white);
  border-color: var(--clay);

  & .plan__desc,
  & .plan__bill,
  & .plan__per {
    color: color-mix(in srgb, var(--white) 82%, transparent);
  }

  & .plan__bill {
    border-color: color-mix(in srgb, var(--white) 25%, transparent);
  }

  & .ticks li::before {
    background: color-mix(in srgb, var(--white) 22%, transparent);
  }

  & .ticks li::after {
    border-color: var(--white);
  }
}

.plan:not(.plan--pop) .plan__tag {
  background: var(--clay-soft);
}

.terms-box {
  margin-top: 30px;
  display: grid;
  gap: 20px;
  align-items: start;
  padding: 26px 30px;
  border-radius: var(--r);
  background: var(--cream);
  border: 1px solid var(--line);
  font-size: 0.92rem;
  color: var(--muted);

  @media (min-width: 640px) {
    grid-template-columns: auto 1fr;
  }

  & strong {
    color: var(--cocoa);
  }

  & a {
    color: var(--clay-d);
    font-weight: 700;
  }
}

.terms-box__ic {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--sage-soft);
  color: var(--sage-d);
  display: grid;
  place-items: center;
}

/* ── Checkout preview modal ── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: color-mix(in srgb, var(--text-color) 50%, transparent);
  backdrop-filter: blur(6px);

  &[hidden] {
    display: none;
  }
}

.modal__box {
  position: relative;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  background: var(--cream);
  border-radius: 32px;
  padding: 38px;

  & h3 {
    font-size: 2.2rem;
  }

  & ul {
    margin: 14px 0 16px 18px;
    display: grid;
    gap: 6px;
    list-style: disc;
  }

  & p,
  & li {
    color: var(--muted);
    font-size: 0.93rem;
  }

  & a:not(.btn) {
    color: var(--clay-d);
  }

  & .btn {
    width: 100%;
    margin-top: 20px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .modal:not([hidden]) .modal__box {
    animation: modal-in 0.4s var(--ease);
  }

  @keyframes modal-in {
    from {
      opacity: 0;
      transform: translateY(14px);
    }
  }
}

.modal__x {
  position: absolute;
  right: 16px;
  top: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--sand);
  font-size: 1.4rem;
  line-height: 1;
}

.modal__label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--clay-soft);
  color: var(--clay-d);
  padding: 6px 12px;
  border-radius: var(--pill);
  margin-bottom: 14px;
}

.modal__price {
  font-family: var(--font-title);
  font-size: 2.2rem;
  color: var(--clay);
  margin: 4px 0;
}

.modal__terms {
  margin-top: 12px;
}

body.is-locked {
  overflow: hidden;
}
