/* Checkout do Asaas (meindica-api). Só estilo: a interface é construída pelo assets/js/checkout.js
   e só aparece quando GET /api/billing/plans responde com o plano da página.

   Identidade light da landing principal. Tokens locais sobrescrevem a paleta escura
   que as páginas ainda definem em .ck-overlay,#ck — sem alterar HTML/JS. */

.ck-overlay,
.ck-modal,
#ck.ck,
.ck {
  --bg: #f7f7f3;
  --panel: #ffffff;
  --panel-2: #f1f4ef;
  --line: #d9ded7;
  --ink: #141a16;
  --soft: #5f685f;
  --muted: #5f685f;
  --dim: #687068;
  --accent: #2fd80f;
  --accent-ink: #14800a;
  --cyan: #14800a;
  --ok: #14800a;
  --on: #141a16;
  --grad: #2fd80f;
  --grad-text: #14800a;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-family: var(--body);
  color: var(--ink);
}

.ck[hidden] {
  display: none !important;
}

.ck {
  margin: 0 0 18px;
  text-align: left;
}

.ck-modal .ck-title {
  margin: 0 36px 18px 0;
  font-family: var(--body);
  font-size: 20px;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  line-height: 1.25;
  text-transform: none !important;
  color: #141a16;
}

.ck-trial {
  display: block;
  margin: 0 28px 12px 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.4;
  text-transform: none;
  color: #5f685f;
}

.ck-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.ck-step {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}

.ck-step[hidden] {
  display: none !important;
}

.ck-step > .ck-step-title,
.ck-step > .ck-row,
.ck-step > .ck-sum,
.ck-step > .ck-accept,
.ck-step > .ck-note {
  grid-column: 1 / -1;
}

.ck-step-title {
  margin: 0 0 2px;
  padding: 0 0 0 26px;
  font-family: var(--body);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: #141a16;
  outline: none;
}

.ck-step-title--dados {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%2314800A' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 18v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='6' r='3.5'/%3E%3C/svg%3E")
    no-repeat left center / 18px 18px;
}

.ck-step-title--pagto {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%2314800A' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='5' width='14' height='10' rx='2'/%3E%3Cpath d='M2 9h14'/%3E%3C/svg%3E")
    no-repeat left center / 18px 18px;
}

.ck-step-title--confirmar {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%2314800A' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 6h8M8 12h8M8 18h8'/%3E%3Cpath d='M3 6h.01M3 12h.01M3 18h.01'/%3E%3C/svg%3E")
    no-repeat left center / 18px 18px;
}

/* Indicador de progresso — stepper em 3 colunas iguais; não é navegação clicável. */
.ck-progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 16px;
  padding: 0 28px 0 0;
  list-style: none;
}

.ck-progress-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  text-align: center;
  color: #5f685f;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
}

.ck-progress-item::after {
  content: '';
  display: block;
  align-self: stretch;
  width: auto;
  height: 3px;
  margin-top: 2px;
  border-radius: 999px;
  background: #e5e9e3;
}

.ck-progress-num {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid #d9ded7;
  border-radius: 50%;
  background: #ffffff;
  color: #5f685f;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.ck-progress-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ck-progress-item.is-current {
  color: #141a16;
  font-weight: 600;
}

.ck-progress-item.is-current .ck-progress-num {
  border-color: #2fd80f;
  background: #2fd80f;
  color: #141a16;
}

.ck-progress-item.is-current::after {
  background: #2fd80f;
}

.ck-progress-item.is-done {
  color: #14800a;
  font-weight: 500;
}

.ck-progress-item.is-done .ck-progress-num {
  border-color: #14800a;
  background: #14800a;
  color: #ffffff;
}

.ck-progress-item.is-done::after {
  background: #14800a;
}

.ck-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.ck-nav-back {
  flex: 0 0 auto;
  min-width: 96px;
  height: 44px;
  padding: 0 16px;
  border: 1px solid #d9ded7;
  border-radius: 12px;
  background: #ffffff;
  color: #141a16;
  font-family: var(--body);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
}

.ck-nav-back:hover {
  border-color: #c5d0c2;
  background: #f7f7f3;
}

.ck-nav-back:focus-visible {
  outline: 2px solid #14800a;
  outline-offset: 2px;
}

.ck-nav-back[hidden],
.ck-nav-next[hidden],
.ck-submit[hidden] {
  display: none !important;
}

.ck-nav .ck-nav-next,
.ck-nav .ck-submit {
  flex: 1 1 auto;
}

.ck-field {
  display: grid;
  gap: 6px;
  align-content: start;
}

.ck-field label {
  font-size: 13px;
  font-weight: 500;
  color: #141a16;
}

.ck-field input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #d9ded7;
  border-radius: 12px;
  background: #ffffff;
  color: #141a16;
  font-family: var(--body);
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ck-field input::placeholder {
  color: #687068;
  opacity: 1;
}

.ck-field input:hover {
  border-color: #c5d0c2;
}

.ck-field input:focus {
  outline: 2px solid #14800a;
  outline-offset: 2px;
  border-color: #14800a;
}

.ck-field input:disabled {
  background: #f7f7f3;
  color: #5f685f;
  cursor: not-allowed;
  opacity: 0.85;
}

.ck-field input[aria-invalid='true'] {
  border-color: #d6453a;
}

.ck-field input:-webkit-autofill,
.ck-field input:-webkit-autofill:hover,
.ck-field input:-webkit-autofill:focus {
  -webkit-text-fill-color: #141a16;
  box-shadow: 0 0 0 1000px #ffffff inset;
  transition: background-color 9999s ease-out;
}

.ck-hint {
  min-height: 0;
  font-size: 12px;
  line-height: 1.4;
  color: #c0392b;
}

.ck-field .ck-hint:empty,
.ck-form > .ck-hint:empty {
  display: none;
}

.ck-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}

.ck-accept label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  color: #141a16;
  cursor: pointer;
}

.ck-accept input {
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  margin: 1px 0 0;
  accent-color: #2fd80f;
  cursor: pointer;
}

.ck-accept input:focus-visible {
  outline: 2px solid #14800a;
  outline-offset: 2px;
}

.ck-accept a {
  color: #14800a;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ck-accept a:hover {
  color: #0f5f08;
}

.ck-accept input[aria-invalid='true'] {
  outline: 2px solid #d6453a;
  outline-offset: 2px;
}

.ck-alert {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid #f0b4ae;
  border-radius: 12px;
  background: #fff5f4;
  color: #8a2218;
  font-size: 14px;
}

/* Resumo da contratação */
.ck-sum {
  display: grid;
  gap: 6px;
  margin: 4px 0 0;
  padding: 14px 14px 12px;
  border: 1px solid #d9ded7;
  border-radius: 12px;
  background: #f7f7f3;
}

.ck-sum-title {
  margin: 0 0 6px;
  padding: 0 0 0 26px;
  font-family: var(--body);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: #141a16;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%2314800A' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 6h8M8 12h8M8 18h8'/%3E%3Cpath d='M3 6h.01M3 12h.01M3 18h.01'/%3E%3C/svg%3E")
    no-repeat left center / 18px 18px;
}

.ck-sum-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 0;
  font-size: 12.5px;
  line-height: 1.35;
  color: #5f685f;
}

.ck-sum-row strong {
  font-weight: 600;
  color: #141a16;
  text-align: right;
}

.ck-sum-save strong {
  color: #14800a;
  font-weight: 500;
}

.ck-sum-total {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid #d9ded7;
}

.ck-sum-total strong {
  color: #14800a;
  font-weight: 700;
}

.ck-note {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #5f685f;
  font-size: 12px;
  line-height: 1.4;
}

/* Confirmacao no proprio modal: sem card interno. A largura menor vale so neste estado. */
.ck-modal:has(.ck-done) {
  max-width: 440px;
  padding: 28px 24px 22px;
}

.ck-done {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 4px 0 0;
  border: 0;
  background: none;
}

.ck-done-hero {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.ck-done-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  margin-bottom: 4px;
  border-radius: 50%;
  background: rgba(47, 216, 15, 0.12);
  color: #14800a;
}

.ck-done-badge svg {
  display: block;
}

.ck-done-title {
  max-width: calc(100% - 48px);
  margin: 0;
  font-family: var(--body);
  font-size: 23px;
  font-weight: 650 !important;
  line-height: 1.25;
  letter-spacing: 0;
  text-transform: none !important;
  color: #141a16;
}

.ck-done-lead {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  color: #5f685f;
}

.ck-done-next {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #d9ded7;
  text-align: left;
}

.ck-done-kicker {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: #141a16;
}

.ck-done-next p {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: #5f685f;
}

.ck-done-time {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #5f685f !important;
}

.ck-done-clock {
  display: inline-flex;
  flex: 0 0 auto;
  margin-top: 2px;
  color: #14800a;
}

.ck-done-clock svg {
  display: block;
}

.ck-done-plan {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 16px 0 0;
  padding: 14px 16px;
  border: 1px solid #d9ded7;
  border-radius: 12px;
  background: #f7f7f3;
  font-size: 13px;
  line-height: 1.4;
  color: #5f685f;
}

.ck-done-plan strong {
  font-size: 14px;
  font-weight: 600;
  text-align: right;
  text-transform: none;
  color: #141a16;
}

/* Continuar herda .btn da landing (pílula 999px); força o raio do checkout light. */
.ck-modal .ck-nav-next.btn.fill {
  border-radius: 12px;
}

.ck-modal .ck-submit.btn.fill {
  width: 100%;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: #2fd80f;
  color: #141a16;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  box-shadow: none;
}

.ck-modal .ck-submit.btn.fill:hover {
  box-shadow: none;
  filter: none;
  background: #29c00d;
}

.ck-submit[disabled] {
  opacity: 0.6;
  cursor: progress;
  filter: none;
}

@media (max-width: 560px) {
  .ck-step,
  .ck-row {
    grid-template-columns: 1fr;
  }

  .ck-progress {
    gap: 6px;
    padding-right: 24px;
  }

  .ck-progress-item {
    gap: 5px;
    font-size: 11px;
  }

  .ck-progress-num {
    width: 20px;
    height: 20px;
    font-size: 10px;
  }

  .ck-progress-item::after {
    height: 2px;
  }

  .ck-progress-label {
    font-size: 10.5px;
  }

  .ck-nav {
    flex-wrap: wrap;
  }

  .ck-nav-back {
    width: 100%;
    min-width: 0;
  }

  .ck-nav .ck-nav-next,
  .ck-nav .ck-submit {
    width: 100%;
  }
}

/* Escolha do ciclo (mensal / 12 meses adiantados) — preservado se o JS voltar a montar. */
.ck-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 4px 0 0;
}

/* Rótulo legado de método (não usado no fluxo em 3 etapas). */
.ck-choice-label {
  display: none;
}

.ck-opt {
  display: grid;
  gap: 2px;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid #d9ded7;
  border-radius: 12px;
  background: #ffffff;
  color: #141a16;
  font-family: var(--body);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
}

.ck-opt:hover {
  border-color: #c5d0c2;
}

.ck-opt:focus-visible {
  outline: 2px solid #14800a;
  outline-offset: 2px;
}

.ck-opt-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ck-ico {
  display: inline-flex;
  flex: 0 0 auto;
  color: #14800a;
}

.ck-ico svg {
  display: block;
  width: 18px;
  height: 18px;
}

.ck-opt strong {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: #141a16;
}

.ck-opt small {
  font-size: 12px;
  line-height: 1.35;
  color: #5f685f;
}

.ck-opt.on {
  border-color: #2fd80f;
  background: #f4fbf1;
  box-shadow: none;
}

.ck-opt.on small {
  color: #5f685f;
}

@media (max-width: 560px) {
  .ck-choice {
    grid-template-columns: 1fr;
  }
}

/* ---------- Modal do checkout ----------
   O cartão do plano é o CTA; o formulário vive aqui dentro. */
.ck-overlay[hidden] {
  display: none !important;
}

.ck-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: safe center;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
  /* Fundo opaco em vez de backdrop-filter: a página tem um canvas animado em loop, e o blur
     de tela cheia sobre ele recompõe a cada frame e trava o renderer. */
  background: rgba(16, 23, 18, 0.55);
}

.ck-modal {
  position: relative;
  width: 100%;
  max-width: 620px;
  margin: auto;
  padding: 22px 24px 20px;
  border: 1px solid #d9ded7;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 24px 64px -28px rgba(16, 23, 18, 0.28);
  animation: ck-sobe 0.22s ease-out;
}

@keyframes ck-sobe {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ck-modal {
    animation: none;
  }
}

.ck-fechar {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d9ded7;
  border-radius: 12px;
  background: #ffffff;
  color: #5f685f;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}

.ck-fechar:focus-visible {
  outline: 2px solid #14800a;
  outline-offset: 2px;
}

.ck-fechar:hover {
  color: #141a16;
  border-color: #c5d0c2;
  background: #f7f7f3;
}

.ck-modal .ck {
  margin: 0;
}

/* O cartão do plano vira o gatilho: deixa claro que é clicável. */
.plan[data-plan-slug] .btn {
  cursor: pointer;
}

@media (max-width: 560px) {
  .ck-overlay {
    padding: 12px 10px;
  }

  .ck-modal {
    padding: 18px 14px 16px;
    border-radius: 14px;
  }

  .ck-modal:has(.ck-done) {
    padding: 26px 16px 18px;
  }

  .ck-opt {
    min-height: 0;
  }

  .ck-step-title,
  .ck-sum-title {
    font-size: 13.5px;
  }
}
