/* ==========================================================================
   Planos — Free em destaque, régua de alunos ativos, cards, módulos e comparativo
   Sem preços do Pro/Enterprise até a aprovação da política comercial
   (especificação, seções 7, 15.11 e 15.12).
   ========================================================================== */

.plans {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: linear-gradient(180deg, #f7fbff 0%, #fff 55%);
}

.plans::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -260px;
  left: 50%;
  width: 900px;
  height: 520px;
  translate: -50% 0;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(83, 160, 221, 0.16), transparent);
}

.plans-inner {
  display: grid;
  gap: clamp(28px, 4vw, 44px);
  padding-block: clamp(72px, 10vw, 120px);
}

.plans-head {
  display: grid;
  justify-items: center;
  gap: 14px;
  max-width: 780px;
  margin-inline: auto;
  text-align: center;
}

.plans-head h2 em {
  font-style: normal;
  color: var(--action);
}

.plans-head p {
  max-width: 36em;
  font-size: 1.0625rem;
}

/* ---------- Régua de alunos ---------- */
.plan-meter {
  display: grid;
  gap: 18px;
  max-width: 880px;
  width: 100%;
  margin-inline: auto;
  padding: clamp(20px, 3vw, 30px);
  border-radius: 24px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-s);
}

.plan-meter-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 16px;
}

.plan-meter-top label {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.0625rem;
}

.plan-meter-value {
  color: var(--ink-2);
}

.plan-meter-value strong {
  font: 800 2rem/1 var(--f-display);
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.plan-range {
  --fill: 52.8%;
  position: relative;
  padding-top: 26px;
}

.plan-range input {
  display: block;
  width: 100%;
  height: 28px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.plan-range input::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--brand-blue), var(--action)) 0 0 / var(--fill) 100% no-repeat, #e3edf6;
}

.plan-range input::-moz-range-track {
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--brand-blue), var(--action)) 0 0 / var(--fill) 100% no-repeat, #e3edf6;
}

.plan-range input::-webkit-slider-thumb {
  width: 28px;
  height: 28px;
  margin-top: -9px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: var(--brand-orange);
  box-shadow: 0 4px 14px rgba(20, 52, 86, 0.3);
  transition: transform 0.2s var(--ease-out);
  -webkit-appearance: none;
  appearance: none;
}

.plan-range input::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: var(--brand-orange);
  box-shadow: 0 4px 14px rgba(20, 52, 86, 0.3);
}

.plan-range input:active::-webkit-slider-thumb {
  transform: scale(1.15);
}

.plan-range input:focus-visible {
  outline: none;
}

.plan-range input:focus-visible::-webkit-slider-thumb {
  outline: 3px solid var(--action);
  outline-offset: 2px;
}

.plan-range input:focus-visible::-moz-range-thumb {
  outline: 3px solid var(--action);
  outline-offset: 2px;
}

/* Marca do limite do Free (50 alunos = 40% da régua) */
.plan-range-mark {
  position: absolute;
  top: 0;
  left: 40%;
  bottom: 22px;
  border-left: 2px dashed var(--ok);
  pointer-events: none;
}

.plan-range-mark b {
  position: absolute;
  top: -2px;
  left: 6px;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--ok);
  white-space: nowrap;
}

.plan-range-ticks {
  position: relative;
  height: 16px;
  margin-top: 6px;
  font-size: 0.6875rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.plan-range-ticks span {
  position: absolute;
  translate: -50% 0;
}

.plan-range-ticks span:nth-child(1) { left: 0; translate: 0 0; }
.plan-range-ticks span:nth-child(2) { left: 40%; }
.plan-range-ticks span:nth-child(3) { left: 60.3%; }
.plan-range-ticks span:nth-child(4) { left: 83.9%; }
.plan-range-ticks span:nth-child(5) { left: 100%; translate: -100% 0; }

.plan-meter-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px 24px;
}

.plan-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
}

.plan-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.plan-switch-ui {
  position: relative;
  flex: none;
  width: 42px;
  height: 24px;
  border-radius: 12px;
  background: #d5e2ee;
  transition: background-color 0.25s;
}

.plan-switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(20, 52, 86, 0.25);
  transition: transform 0.3s var(--ease-out);
}

.plan-switch input:checked + .plan-switch-ui {
  background: var(--action);
}

.plan-switch input:checked + .plan-switch-ui::after {
  transform: translateX(18px);
}

.plan-switch input:focus-visible + .plan-switch-ui {
  outline: 3px solid var(--brand-orange);
  outline-offset: 3px;
}

.plan-verdict {
  margin: 0;
  color: var(--ink);
}

.plan-verdict b {
  color: var(--action);
}

.plan-verdict.is-changed {
  animation: plan-verdict 0.45s var(--ease-out);
}

@keyframes plan-verdict {
  from { opacity: 0.2; transform: translateY(4px); }
}

/* ---------- Cards ---------- */
.plan-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 30px 28px 28px;
  border-radius: 26px;
  background: #fff;
  border: 1px solid var(--line);
  transition: transform 0.5s var(--ease-out), box-shadow 0.5s, border-color 0.4s;
}

.plan h3 {
  font-size: 1.5rem;
}

.plan-top {
  display: grid;
  gap: 6px;
}

.plan-top p {
  font-size: 0.9375rem;
}

.plan-price {
  display: grid;
  gap: 2px;
}

.plan-price strong {
  font: 800 3rem/1 var(--f-display);
  letter-spacing: -0.03em;
}

.plan-price .plan-price-text {
  font-size: 1.75rem;
  line-height: 1.15;
}

.plan-price span {
  font-size: 0.875rem;
  color: var(--ink-3);
}

.plan-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.plan-facts li {
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-2);
}

.plan-plus {
  margin: 0 0 -8px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--ink);
}

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

.plan-list li {
  position: relative;
  padding-left: 28px;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--ink-2);
}

.plan-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--action-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%23216ca9' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.plan-cta {
  align-self: stretch;
  justify-content: space-between;
  margin-top: auto;
  padding: 0 8px 0 22px;
}

.plan-cta .btn-arrow {
  width: 34px;
  height: 34px;
}

.plan:not(.plan--free) .plan-cta {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--ink);
}

.plan:not(.plan--free) .plan-cta .btn-arrow {
  background: #fff;
}

.plan:not(.plan--free) .plan-cta:hover {
  --btn-bg: var(--action);
  --btn-fg: #fff;
  background: var(--action);
}

/* Free: card principal de conversão */
.plan--free {
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(140deg, var(--brand-blue), var(--brand-orange)) border-box;
  border: 2px solid transparent;
}

.plan--free .plan-price strong {
  background: linear-gradient(90deg, var(--action), var(--brand-blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.plan--free .plan-facts li {
  background: var(--ok-soft);
  color: var(--ok);
}

/* Enterprise: tom escuro */
.plan--ent {
  background: linear-gradient(160deg, var(--deep-700), var(--deep-800));
  border-color: transparent;
  color: #fff;
}

.plan--ent h3,
.plan--ent .plan-price strong {
  color: #fff;
}

.plan--ent p,
.plan--ent .plan-price span,
.plan--ent .plan-list li {
  color: #c3d7ea;
}

.plan--ent .plan-facts li {
  background: rgba(255, 255, 255, 0.1);
  color: #e3eef8;
}

.plan--ent .plan-list li::before {
  background-color: rgba(83, 160, 221, 0.2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%238cc8f5' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.plan--ent .plan-cta {
  --btn-bg: #fff;
  --btn-fg: var(--deep-800);
}

.plan--ent .plan-cta .btn-arrow {
  background: var(--surface-2);
}

/* Indicado pela régua */
.plan-flag {
  position: absolute;
  top: -13px;
  left: 28px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--brand-orange);
  color: var(--deep-800);
  font-size: 0.75rem;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(240, 162, 58, 0.35);
  opacity: 0;
  transform: translateY(6px) scale(0.9);
  transition: opacity 0.35s, transform 0.45s var(--ease-out);
  pointer-events: none;
}

.plan.is-recommended {
  transform: translateY(-8px);
  box-shadow: 0 30px 70px rgba(20, 52, 86, 0.16);
}

.plan.is-recommended:not(.plan--free):not(.plan--ent) {
  border-color: var(--brand-blue);
}

.plan.is-recommended .plan-flag {
  opacity: 1;
  transform: none;
}

/* ---------- Módulos (faixa contínua) ---------- */
.plan-modules {
  display: grid;
  gap: 14px;
  justify-items: center;
  text-align: center;
}

.plan-modules > p {
  font-size: 0.9375rem;
}

.plan-modules b {
  color: var(--ink);
}

.plan-marquee {
  display: flex;
  width: 100%;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.plan-marquee ul {
  flex: none;
  display: flex;
  gap: 10px;
  margin: 0;
  padding: 0 10px 0 0;
  list-style: none;
  animation: plan-marquee 40s linear infinite;
}

.plan-marquee:hover ul {
  animation-play-state: paused;
}

.plan-marquee li {
  padding: 9px 16px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--ink-2);
}

@keyframes plan-marquee {
  to { transform: translateX(-100%); }
}

/* ---------- Comparativo ---------- */
.plan-compare {
  border-radius: 22px;
  background: #fff;
  border: 1px solid var(--line);
}

.plan-compare summary {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 18px 22px;
  font-weight: 700;
  color: var(--action);
  cursor: pointer;
  list-style: none;
}

.plan-compare summary::-webkit-details-marker {
  display: none;
}

.plan-compare summary svg {
  width: 16px;
  height: 16px;
  transform: rotate(90deg);
  transition: transform 0.35s var(--ease-out);
}

.plan-compare[open] summary svg {
  transform: rotate(-90deg);
}

.plan-compare-wrap {
  overflow-x: auto;
  padding: 0 22px 22px;
}

.plan-compare table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.plan-compare thead th {
  position: sticky;
  top: 0;
  padding: 12px 14px;
  background: #fff;
  font-family: var(--f-display);
  font-size: 1rem;
  text-align: center;
}

.plan-compare tbody th {
  padding: 12px 14px;
  text-align: left;
  font-weight: 500;
  color: var(--ink);
}

.plan-compare td {
  padding: 12px 14px;
  text-align: center;
  color: var(--ink-2);
  font-size: 0.875rem;
}

.plan-compare tbody tr:not(.group) {
  border-top: 1px solid #edf2f7;
}

.plan-compare tr.group th {
  padding: 22px 14px 8px;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--action);
}

.plan-compare td:nth-child(2) {
  background: rgba(83, 160, 221, 0.05);
}

.plan-compare .ok {
  width: 18px;
  height: 18px;
  padding: 3px;
  border-radius: 50%;
  background: var(--ok-soft);
  color: var(--ok);
  vertical-align: middle;
}

.plan-compare .no {
  color: #b5c4d3;
}

.plan-compare .small {
  margin-top: 14px;
}

/* ---------- Responsivo ---------- */
@media (max-width: 1000px) {
  .plan-cards {
    grid-template-columns: minmax(0, 1fr);
    max-width: 560px;
    width: 100%;
    margin-inline: auto;
    gap: 26px;
  }
}

@media (max-width: 600px) {
  .plan-range-mark b {
    left: auto;
    right: 6px;
  }

  .plan-range-ticks span:nth-child(3),
  .plan-range-ticks span:nth-child(4) {
    display: none;
  }

  .plan-compare-wrap {
    padding-inline: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .plan,
  .plan-flag,
  .plan-switch-ui::after {
    transition: none;
  }

  .plan-verdict.is-changed {
    animation: none;
  }

  .plan-marquee {
    -webkit-mask-image: none;
    mask-image: none;
  }

  .plan-marquee ul {
    flex: 1 1 auto;
    flex-wrap: wrap;
    justify-content: center;
    animation: none;
  }

  .plan-marquee ul + ul {
    display: none;
  }

  .plan-marquee {
    justify-content: center;
  }
}

/* Colunas do comparativo com larguras iguais para os planos */
.plan-compare table {
  table-layout: fixed;
}

.plan-compare thead th:first-child {
  width: 40%;
}
