/* Pricing page: the document styles (../styles.css) plus a wider column, plan cards
   and the landing's FAQ rows. Tokens not in styles.css are copied from landing.css. */
.pricing {
  --neutral-300: #e5e5e5;
  --green-tint: #e6ece9;
  --fs-lede: 1.125rem;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  /* The landing's reveal curve (landing.css, .reveal). */
  --ease-reveal: cubic-bezier(.16, 1, .3, 1);
}
.pricing main { width: min(100% - 32px, 960px); padding-top: 80px; }
.pricing section + section { margin-top: 96px; }
.pricing h1, .pricing h2 { text-align: center; }
.pricing h2 { margin-top: 0; font-size: 3rem; }
.pricing h3 { margin: 0; font-family: var(--font-display); font-size: var(--fs-subtitle); font-weight: 600; line-height: 0.9; letter-spacing: -0.01em; font-variation-settings: "SOFT" 100; }
.lede { max-width: 48ch; margin: 0 auto 40px; text-align: center; font-size: var(--fs-lede); color: var(--neutral-600); }

.checklist { margin: 0; padding: 0; list-style: none; }
.checklist li { position: relative; padding-left: 32px; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: 0.2em; width: 20px; height: 20px;
  border-radius: 50%; background: var(--green-tint);
}
.checklist li::after {
  content: ""; position: absolute; left: 7px; top: calc(0.2em + 4px); width: 5px; height: 9px;
  border: solid var(--green); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.pricing-hero .checklist { columns: 2 280px; column-gap: 40px; max-width: 760px; margin-inline: auto; }
.pricing-hero .checklist li { break-inside: avoid; margin-block: 0 16px; }

/* Three plans; the annual one in the middle stands out in brand green.
   Each card spans six shared rows (subgrid), so names, prices, buttons and lists line up across cards. */
.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: start; }
.plan {
  position: relative; display: grid; grid-row: span 6; grid-template-rows: subgrid; align-content: start; gap: 16px; padding: 32px 24px;
  background: var(--neutral-100); border: 1px solid rgba(0, 0, 0, 0.08); border-radius: 24px;
  box-shadow: 0px 6px 8px 0px rgba(0, 0, 0, 0.04), 0px 2px 4px 0px rgba(0, 0, 0, 0.06);
}
.plan--featured {
  color: var(--neutral-100); border-color: transparent;
  background: linear-gradient(to bottom, var(--green), #022e19);
  box-shadow: 0px 16px 32px 0px rgba(3, 65, 35, 0.24), 0px 2px 4px 0px rgba(0, 0, 0, 0.06);
}
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
/* «Ahorra 50%» sits centred on the card's top edge, half outside it. */
.plan-badge {
  position: absolute; top: 0; left: 50%; translate: -50% -50%;
  padding: 4px 12px; border-radius: 100px; background: var(--green-tint); color: var(--green);
  font-size: var(--fs-small); font-weight: 500; white-space: nowrap;
  box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.06);
}
.plan-price { margin: 0; color: var(--neutral-600); }
.plan-price strong { font-family: var(--font-display); font-size: 3rem; font-weight: 600; line-height: 0.9; color: var(--neutral-800); font-variation-settings: "SOFT" 100; }
.plan-note { margin: 0; color: var(--neutral-600); font-size: var(--fs-small); }
.plan--featured :is(.plan-price, .plan-price strong, .plan-note) { color: var(--neutral-100); }
.plan--featured .plan-note { opacity: 0.8; }
.plan-cta {
  display: flex; align-items: center; justify-content: center; height: 48px; margin-block: 8px;
  border-radius: 100px; background: var(--green); color: var(--neutral-100);
  font-weight: 500; text-decoration: none; transition: scale 160ms var(--ease-out);
}
.plan--featured .plan-cta { background: var(--neutral-100); color: var(--green); }
.plan-cta:active { scale: 0.97; }
.plan-includes { margin: 0; font-size: var(--fs-small); font-weight: 600; }
.plan .checklist li { margin-block: 0 12px; font-size: var(--fs-small); }
/* Filled checks on the cards: green on white, white on the green card. */
.plan .checklist li::before { background: var(--green); }
.plan .checklist li::after { border-color: var(--neutral-100); }
.plan--featured .checklist li::before { background: var(--neutral-100); }
.plan--featured .checklist li::after { border-color: var(--green); }
/* Under the paid plans' button, as on the app's paywall. */
.plan-cancel { margin: 0; text-align: center; color: var(--neutral-600); font-size: 0.75rem; }
.plan--featured .plan-cancel { color: var(--neutral-100); opacity: 0.8; }
/* «Pago seguro con App Store» with the paywall's shield, in the brand green. */
.plan-footnote { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 24px; color: var(--neutral-600); font-size: var(--fs-small); }
.plan-footnote svg { width: 14px; height: 14px; color: var(--green); }

.pricing-faq { max-width: 720px; margin-inline: auto; }
.pricing-faq h2 { margin-bottom: 40px; }
.faq-list { border-top: 1px solid var(--neutral-300); }
details { border-bottom: 1px solid var(--neutral-300); }
summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 24px 0; font-weight: 500; cursor: pointer; list-style: none;
}
summary::-webkit-details-marker { display: none; }
.faq-chevron { flex-shrink: 0; width: 20px; height: 20px; color: var(--neutral-600); transition: transform 250ms cubic-bezier(0.2, 0, 0, 1); }
details[open] .faq-chevron { transform: rotate(180deg); }
details p { max-width: 60ch; margin: 0; padding-bottom: 24px; color: var(--neutral-600); }
/* Answers with steps: the intro, the numbered steps and the closing line, 8px apart. */
details p:has(+ ol) { padding-bottom: 8px; }
details ol { max-width: 60ch; margin: 0 0 8px; padding-left: 24px; color: var(--neutral-600); }
details li { margin-block: 4px; }
/* The answer slides open, as on the landing. Browsers without ::details-content or interpolate-size open instantly. */
@supports (interpolate-size: allow-keywords) {
  .pricing { interpolate-size: allow-keywords; }
  details::details-content {
    block-size: 0; overflow: clip;
    transition: block-size 250ms cubic-bezier(0.2, 0, 0, 1), content-visibility 250ms allow-discrete;
  }
  details[open]::details-content { block-size: auto; }
}

/* Motion, matching the landing: things rise 16px and fade in, once. The title, its line and the
   checklist on load (CSS only); the plans and the FAQ as they scroll in (index.js sets .js-reveal,
   so nothing is hidden if the script never runs). */
@keyframes pricing-rise { from { opacity: 0; transform: translateY(16px); } }
.pricing-hero h1 { animation: pricing-rise 750ms var(--ease-reveal) both; }
.pricing-hero .lede { animation: pricing-rise 750ms var(--ease-reveal) 60ms both; }
.pricing-hero .checklist li { animation: pricing-rise 600ms var(--ease-reveal) calc(160ms + var(--i, 0) * 40ms) both; }
.pricing-hero .checklist li:nth-child(2) { --i: 1; }
.pricing-hero .checklist li:nth-child(3) { --i: 2; }
.pricing-hero .checklist li:nth-child(4) { --i: 3; }
.pricing-hero .checklist li:nth-child(5) { --i: 4; }
.pricing-hero .checklist li:nth-child(6) { --i: 5; }
.pricing-hero .checklist li:nth-child(7) { --i: 6; }
.pricing-hero .checklist li:nth-child(8) { --i: 7; }
.pricing-hero .checklist li:nth-child(9) { --i: 8; }
/* The cards follow each other 80 ms apart; the saving chip pops in once the annual card has landed. */
.js-reveal :is(.plan, .pricing-faq) {
  opacity: 0; transform: translateY(16px);
  transition: opacity 600ms var(--ease-reveal), transform 600ms var(--ease-reveal);
}
.js-reveal .plan:nth-child(2) { transition-delay: 80ms; }
.js-reveal .plan:nth-child(3) { transition-delay: 160ms; }
.js-reveal :is(.plans.is-visible .plan, .pricing-faq.is-visible) { opacity: 1; transform: none; }
.js-reveal .plan-badge { opacity: 0; scale: 0.9; transition: opacity 250ms var(--ease-out) 420ms, scale 250ms var(--ease-out) 420ms; }
.js-reveal .plans.is-visible .plan-badge { opacity: 1; scale: 1; }

@media (max-width: 720px) {
  .pricing main { padding-top: 40px; }
  .pricing section + section { margin-top: 64px; }
  .pricing h2 { font-size: 2rem; }
  .plan { padding: 24px; }
}
@media (max-width: 900px) {
  .plan-grid { grid-template-columns: minmax(0, 480px); justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .faq-chevron, .plan-cta { transition: none; }
  details::details-content { transition: none; }
  /* Fade only: no rising, no pop. */
  @keyframes pricing-rise { from { opacity: 0; } }
  .pricing-hero :is(h1, .lede, .checklist li) { animation-duration: 200ms; animation-delay: 0ms; }
  .js-reveal :is(.plan, .pricing-faq) { transform: none; transition: opacity 200ms ease-out; transition-delay: 0ms; }
  .js-reveal .plan-badge { scale: 1; transition: opacity 200ms ease-out; }
}
