/* The pricing cards, on both pages: Pro (Monthly or Yearly, switched by the radios with :has, no
   script) and Lantern Lifetime (its price ladder marked by lifetime.js from the live status).
   Warm colors by default (main page), night colors under [data-icp="dev"] (/agents). */

.plans {
  --card: #fffdf8;
  --card-line: #e3ddd1;
  --text: #2b2925;
  --soft: #6f6a60;
  --chip: #f1ece2;
  --strong: #2b2925;
  --on-strong: #fffdf7;
  --live: #3f9a5c;
  --glow-top: linear-gradient(180deg, #f6d9b0 0%, #f9e6cb 45%, #fffdf8 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  max-width: 780px;
  margin: 46px auto 0;
}
[data-icp="dev"] .plans {
  --card: var(--night-2);
  --card-line: var(--night-line);
  --text: var(--night-text);
  --soft: var(--night-muted);
  --chip: #ffffff12;
  --strong: var(--night-text);
  --on-strong: var(--night);
  --live: #6fd28c;
  --glow-top: linear-gradient(180deg, #4a3a26 0%, #2c251b 50%, var(--night-2) 100%);
}

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 28px;
  border: 1px solid var(--card-line);
  border-radius: 24px;
  background: var(--card);
  color: var(--text);
}
.plan--lifetime { padding: 8px 8px 28px; border-color: #d9a463; box-shadow: 0 30px 70px -45px #b6602a80; }
[data-icp="dev"] .plan--lifetime { border-color: #f2b45e66; box-shadow: 0 30px 80px -45px #f2b45e55; }
.plan--lifetime > :not(.plan__glow):not(.plan__flag) { margin-inline: 20px; }
.plan__glow { padding: 20px 20px 18px; border-radius: 17px; background: var(--glow-top); }

.plan__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plan h3 { margin: 0; color: var(--text); font-family: inherit; font-size: 19px; font-style: normal; font-weight: 600; letter-spacing: -.02em; }
.plan__pill { padding: 3px 10px; border-radius: 999px; background: var(--chip); color: var(--text); font-size: 12px; font-weight: 500; white-space: nowrap; }
.plan__flag {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px;
  border: 1px solid #d9a463;
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.plan__flag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--live); }
[data-icp="dev"] .plan__flag { border-color: #f2b45e66; }

.plan__price { display: flex; align-items: flex-start; gap: 2px; margin: 18px 0 0; line-height: 1; }
.plan__price[hidden] { display: none; }
.plan__cur { margin-top: 6px; font-size: 22px; font-weight: 500; }
.plan__price strong { font-size: 56px; font-weight: 600; letter-spacing: -.05em; }
.plan__price sup { margin: 4px 0 0 2px; font-size: 20px; font-weight: 500; }
.plan__per { align-self: flex-end; display: grid; margin: 0 0 6px 10px; color: var(--soft); font-size: 13px; line-height: 1.35; }
.plan__per s { font-size: 12px; }
.plan__sub { margin: 14px 0 0; color: var(--text); font-size: 14px; line-height: 1.5; }

/* Monthly / Yearly */
.plan__toggle { display: grid; grid-template-columns: 1fr 1fr; margin: 18px 0 0; padding: 4px; border: 1px solid var(--card-line); border-radius: 999px; background: var(--chip); }
.plan__toggle legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.plan__toggle label { position: relative; padding: 9px; border-radius: 999px; color: var(--soft); font-size: 14px; font-weight: 500; text-align: center; cursor: pointer; }
.plan__toggle input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.plan__toggle label:has(:checked) { background: var(--card); box-shadow: 0 1px 4px #0000001f; color: var(--text); }
.plan__toggle label:has(:focus-visible) { outline: 2px solid var(--live); outline-offset: 1px; }
.plan--pro .plan__year { display: none; }
.plan--pro:has([value="year"]:checked) .plan__year { display: revert; }
.plan--pro:has([value="year"]:checked) .plan__month { display: none; }
.plan--pro:has([value="year"]:checked) .plan__price.plan__year { display: flex; }
.plan--pro:has([value="year"]:checked) .plan__button.plan__year { display: flex; }

/* The Lifetime price ladder: sold-out tiers fade, the live one glows. */
.plan__ladder { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 2px; margin: 16px 0 0; padding: 0; list-style: none; }
.plan__ladder li { display: grid; justify-items: center; gap: 2px; padding: 8px 4px; border-radius: 12px; font-size: 12px; color: var(--soft); }
.plan__ladder b { color: var(--text); font-size: 15px; font-weight: 600; }
.plan__ladder .plan__step { padding: 0; color: var(--soft); font-size: 20px; }
.plan__ladder .is-gone b { color: var(--soft); text-decoration: line-through; }
.plan__ladder .is-now { background: var(--card); box-shadow: 0 1px 4px #0000001a; }
.plan__ladder .is-now b, .plan__ladder .is-now span { color: var(--live); }
.plan__ladder .is-now b::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 6px 2px 0; border-radius: 50%; background: var(--live); vertical-align: middle; }

.plan > ul { flex: 1; margin: 24px 0 26px; padding: 22px 0 0; border-top: 1px solid var(--card-line); list-style: none; }
.plan > ul li { position: relative; margin-top: 12px; padding-left: 26px; color: var(--text); font-size: 14.5px; line-height: 1.45; }
.plan > ul li:first-child { margin-top: 0; }
.plan > ul li::before { content: ""; position: absolute; left: 2px; top: 4px; width: 10px; height: 6px; border: solid var(--soft); border-width: 0 0 1.6px 1.6px; transform: rotate(-45deg); }

.plan__button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  border: 1px solid var(--card-line);
  border-radius: 999px;
  background: var(--chip);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 180ms ease;
}
.plan__button:hover { transform: translateY(-1px); }
.plan__button svg { width: 16px; height: 16px; }
.plan__button[hidden] { display: none; }
.plan__button--strong { border-color: var(--strong); background: var(--strong); color: var(--on-strong); }
.plan__soldout { margin: 0; padding: 15px; border-radius: 999px; background: var(--chip); font-weight: 600; text-align: center; }
.plan__soldout[hidden] { display: none; }
.plan__fine { margin: 14px 0 0; color: var(--soft); font-size: 12.5px; line-height: 1.55; text-align: center; }
.plan__fine a { color: inherit; }

.plans__notice { max-width: 620px; margin: 30px auto 0; padding: 10px 16px; border-radius: 999px; background: #f1ece2; color: #2b2925; font-size: 14px; text-align: center; }
.plans__notice[hidden] { display: none; }
[data-icp="dev"] .plans__notice { background: #ffffff12; color: var(--night-text); }
.plans__note { max-width: 620px; margin: 28px auto 0; color: var(--muted, #706b61); font-size: 13px; line-height: 1.7; text-align: center; }
.plans__note a { color: inherit; font-weight: 600; text-underline-offset: 3px; }
[data-icp="dev"] .plans__notice { max-width: 620px; margin: 30px auto 0; padding: 10px 16px; border-radius: 999px; background: #f1ece2; color: #2b2925; font-size: 14px; text-align: center; }
.plans__notice[hidden] { display: none; }
[data-icp="dev"] .plans__notice { background: #ffffff12; color: var(--night-text); }
.plans__note { color: var(--night-muted); }

@media (max-width: 760px) {
  .plans { grid-template-columns: minmax(0, 1fr); max-width: 460px; gap: 30px; }
  .plan { padding: 24px 20px; }
  .plan--lifetime { padding: 6px 6px 24px; }
  .plan--lifetime > :not(.plan__glow):not(.plan__flag) { margin-inline: 14px; }
}
