/* =========================================================
   Checkout — Estrelas e Abismos
   ========================================================= */

.page-checkout { background: var(--ink-1); }

/* Nav do checkout */
.page-checkout .nav__links,
.page-checkout .nav__cta { display: none; }

.checkout__back {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--bone-dim);
  font-family: var(--font-title);
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 10px 16px;
  border: 1px solid rgba(236, 221, 196, .15);
  border-radius: 4px;
  transition: color .2s ease, border-color .2s ease;
}
.checkout__back:hover {
  color: var(--bone);
  border-color: rgba(236, 221, 196, .4);
}
.checkout__back svg { width: 14px; height: 14px; }

/* =========================================================
   LAYOUT
   ========================================================= */
.checkout {
  padding: 120px 24px 64px;
  max-width: 1200px;
  margin: 0 auto;
}
.checkout__inner {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 48px;
  align-items: start;
}

.checkout__head { margin-bottom: 32px; }
.checkout__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  color: var(--bone);
  margin: 12px 0 8px;
  line-height: 1.05;
}
.checkout__sub {
  font-family: var(--font-body);
  font-size: 1.1rem;
  color: var(--bone-dim);
  line-height: 1.5;
}

/* =========================================================
   FORM
   ========================================================= */
.checkout__form {
  display: flex; flex-direction: column; gap: 32px;
}
.ck-group {
  border: 1px solid rgba(236, 221, 196, .1);
  border-radius: 8px;
  padding: 28px;
  background: rgba(20, 9, 10, .5);
}
.ck-group__title {
  font-family: var(--font-title);
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ember-glow);
  margin-bottom: 20px;
  padding: 0 4px;
}

.ck-field {
  display: flex; flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.ck-field:last-child { margin-bottom: 0; }

.ck-field label {
  font-family: var(--font-title);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--bone-dim);
  font-weight: 600;
}
.ck-opt {
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--bone-dim);
  opacity: .6;
  font-weight: 400;
}

.ck-field input,
.ck-field select {
  width: 100%;
  padding: 14px 16px;
  background: rgba(10, 6, 4, .65);
  border: 1px solid rgba(236, 221, 196, .15);
  border-radius: 4px;
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 1.05rem;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.ck-field input::placeholder {
  color: rgba(236, 221, 196, .3);
  font-style: italic;
}
.ck-field input:focus,
.ck-field select:focus {
  outline: none;
  border-color: var(--emerald);
  background: rgba(14, 58, 42, .15);
  box-shadow: 0 0 0 3px rgba(95, 255, 186, .12);
}
.ck-field input:invalid:not(:placeholder-shown) {
  border-color: rgba(196, 80, 30, .5);
}

.ck-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.ck-row:last-child { margin-bottom: 0; }
.ck-row .ck-field { margin-bottom: 0; }

.ck-row:has(.ck-field--cep)        { grid-template-columns: 160px 1fr; }
.ck-row:has(.ck-field--numero)     { grid-template-columns: 120px 1fr; }
.ck-row:has(.ck-field--uf)         { grid-template-columns: 1fr 1fr 90px; }

/* =========================================================
   PAGAMENTO
   ========================================================= */
.ck-pay {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.ck-pay__opt {
  cursor: pointer;
  display: block;
}
.ck-pay__opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.ck-pay__card {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px;
  border: 1px solid rgba(236, 221, 196, .15);
  border-radius: 6px;
  background: rgba(10, 6, 4, .55);
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.ck-pay__opt:hover .ck-pay__card {
  border-color: rgba(236, 221, 196, .3);
}
.ck-pay__opt input:checked + .ck-pay__card {
  border-color: var(--emerald);
  background: rgba(14, 58, 42, .25);
  box-shadow: 0 0 0 3px rgba(95, 255, 186, .12), inset 0 0 24px rgba(95, 255, 186, .08);
}
.ck-pay__opt input:focus-visible + .ck-pay__card {
  box-shadow: 0 0 0 3px rgba(95, 255, 186, .25);
}
.ck-pay__icon {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(95, 255, 186, .25);
  border-radius: 50%;
  color: var(--emerald-glow);
  flex-shrink: 0;
}
.ck-pay__icon svg { width: 20px; height: 20px; }
.ck-pay__label {
  display: flex; flex-direction: column; gap: 2px;
}
.ck-pay__label strong {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--bone);
  letter-spacing: .02em;
}
.ck-pay__label small {
  font-family: var(--font-title);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--bone-dim);
  opacity: .75;
}

.ck-card-fields {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(236, 221, 196, .08);
  animation: ckFade .3s ease both;
}
@keyframes ckFade {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   TERMOS + SUBMIT
   ========================================================= */
.ck-terms { padding: 0 4px; }
.ck-check {
  display: flex; align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--bone-dim);
}
.ck-check input {
  margin-top: 3px;
  width: 18px; height: 18px;
  accent-color: var(--emerald);
  flex-shrink: 0;
  cursor: pointer;
}

.ck-submit {
  width: 100%;
  justify-content: center;
  padding: 20px;
  font-size: 1.1rem;
}

/* =========================================================
   SELOS DE CONFIANÇA
   ========================================================= */
.ck-trust {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: -12px;
}
.ck-trust__badge {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(95, 255, 186, .2);
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(14, 58, 42, .25), rgba(10, 6, 4, .55));
  box-shadow: inset 0 0 24px rgba(95, 255, 186, .04);
}
.ck-trust__icon {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(95, 255, 186, .35);
  border-radius: 50%;
  color: var(--emerald-glow);
  background: rgba(14, 58, 42, .3);
  flex-shrink: 0;
}
.ck-trust__icon svg { width: 18px; height: 18px; }
.ck-trust__copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ck-trust__copy strong {
  font-family: var(--font-title);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--bone);
  font-weight: 600;
}
.ck-trust__copy small {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--bone-dim);
  line-height: 1.4;
}
.ck-trust__copy small b {
  color: var(--emerald-glow);
  font-weight: 600;
}

.ck-trust__row {
  list-style: none;
  display: flex; flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: -8px;
  padding: 0;
}
.ck-trust__chip {
  display: inline-flex; align-items: center;
  padding: 6px 12px;
  border: 1px solid rgba(236, 221, 196, .12);
  border-radius: 999px;
  background: rgba(10, 6, 4, .45);
  font-family: var(--font-title);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--bone-dim);
  opacity: .85;
}

/* =========================================================
   RESUMO
   ========================================================= */
.checkout__summary { position: sticky; top: 120px; }

.ck-sum {
  border: 1px solid rgba(236, 221, 196, .1);
  border-radius: 8px;
  padding: 28px;
  background: linear-gradient(180deg, rgba(20, 9, 10, .7), rgba(10, 6, 4, .85));
  box-shadow: 0 12px 40px rgba(0, 0, 0, .4);
}
.ck-sum__title {
  font-family: var(--font-title);
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ember-glow);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(236, 221, 196, .08);
}
.ck-sum__item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}
.ck-sum__cover {
  width: 64px;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 122, 60, .15);
}
.ck-sum__info h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.5rem;
  color: var(--bone);
  line-height: 1;
  margin-bottom: 4px;
}
.ck-sum__info p {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--bone-dim);
  margin-bottom: 6px;
}
.ck-sum__qty {
  font-family: var(--font-title);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--bone-dim);
  opacity: .7;
}
.ck-sum__price {
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--bone);
  font-weight: 600;
  white-space: nowrap;
}

.ck-sum__row {
  display: flex; justify-content: space-between;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--bone-dim);
  padding: 10px 0;
}
.ck-sum__muted { opacity: .55; font-size: 0.9rem; font-style: italic; }
.ck-sum__row--total {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid rgba(236, 221, 196, .08);
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--bone);
}
.ck-sum__row--total span:last-child {
  color: var(--emerald-glow);
  font-size: 1.2rem;
  text-shadow: 0 0 16px rgba(95, 255, 186, .25);
}

.ck-sum__note {
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(236, 221, 196, .06);
  font-family: var(--font-title);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--bone-dim);
  opacity: .55;
  text-align: center;
}
.ck-sum__note svg { width: 12px; height: 12px; color: var(--ember-glow); }

/* =========================================================
   PAINEL DE PAGAMENTO (QR PIX / boleto / sucesso)
   ========================================================= */
.ck-pay-overlay {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(5, 3, 2, .82);
  backdrop-filter: blur(6px);
  z-index: 200;
  animation: ckFade .25s ease both;
}
/* Sem isto o overlay (display:flex) ignora o [hidden] e fica
   invisível mas POR CIMA da página, bloqueando todos os cliques
   — inclusive o botão Finalizar. */
.ck-pay-overlay[hidden] { display: none !important; }
.ck-pay-modal {
  position: relative;
  width: 100%; max-width: 440px;
  max-height: 90vh; overflow-y: auto;
  padding: 40px 32px 32px;
  border: 1px solid rgba(95, 255, 186, .25);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(20, 9, 10, .96), rgba(10, 6, 4, .98));
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6), inset 0 0 40px rgba(95, 255, 186, .05);
  text-align: center;
}
.ck-pay-modal__close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none;
  color: var(--bone-dim);
  font-size: 28px; line-height: 1;
  cursor: pointer;
  transition: color .2s ease;
}
.ck-pay-modal__close:hover { color: var(--bone); }

.ck-pay-state { display: flex; flex-direction: column; align-items: center; gap: 16px; }
/* hidden precisa vencer o display:flex acima, senão todos os estados
   aparecem empilhados (loading + pix + boleto + sucesso ao mesmo tempo). */
.ck-pay-state[hidden] { display: none !important; }
.ck-pay-modal__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.8rem;
  color: var(--bone);
  line-height: 1.1;
}
.ck-pay-modal__hint {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--bone-dim);
  line-height: 1.5;
}
.ck-pay-modal__hint--sm { font-size: 0.82rem; opacity: .8; }

.ck-pix-qr {
  width: 220px; height: 220px;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  box-shadow: 0 0 0 1px rgba(95, 255, 186, .2), 0 8px 24px rgba(0, 0, 0, .4);
}

.ck-copy {
  display: flex; width: 100%;
  border: 1px solid rgba(236, 221, 196, .15);
  border-radius: 6px;
  overflow: hidden;
}
.ck-copy input {
  flex: 1; min-width: 0;
  padding: 12px 14px;
  background: rgba(10, 6, 4, .65);
  border: none;
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 0.85rem;
  text-overflow: ellipsis;
}
.ck-copy input:focus { outline: none; }
.ck-copy__btn {
  padding: 0 18px;
  background: rgba(14, 58, 42, .4);
  border: none;
  border-left: 1px solid rgba(95, 255, 186, .2);
  color: var(--emerald-glow);
  font-family: var(--font-title);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s ease;
}
.ck-copy__btn:hover { background: rgba(14, 58, 42, .7); }

.ck-pay-modal__status {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-title);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--bone-dim);
}
.ck-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ember-glow);
  box-shadow: 0 0 8px var(--ember-glow);
  animation: ckPulse 1.4s ease-in-out infinite;
}
@keyframes ckPulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

.ck-spinner {
  width: 44px; height: 44px;
  border: 3px solid rgba(95, 255, 186, .15);
  border-top-color: var(--emerald-glow);
  border-radius: 50%;
  animation: ckSpin .8s linear infinite;
}
@keyframes ckSpin { to { transform: rotate(360deg); } }

.ck-success-icon {
  width: 64px; height: 64px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 2px solid var(--emerald-glow);
  color: var(--emerald-glow);
  box-shadow: 0 0 24px rgba(95, 255, 186, .35);
  animation: ckPop .4s cubic-bezier(.2, 1.4, .4, 1) both;
}
.ck-success-icon svg { width: 32px; height: 32px; }
@keyframes ckPop { from { transform: scale(0); } to { transform: scale(1); } }

#ck-boleto-link { width: 100%; justify-content: center; }

/* =========================================================
   MOBILE
   ========================================================= */
@media (max-width: 920px) {
  .checkout { padding: 100px 16px 48px; }
  .checkout__inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .checkout__summary {
    position: static;
    order: -1; /* resumo no topo no mobile, fica claro o que está comprando */
  }
  .ck-sum { padding: 20px; }
}

@media (max-width: 640px) {
  .checkout__title { font-size: 2rem; }
  .checkout__sub   { font-size: 1rem; }

  .ck-group { padding: 20px 18px; }
  .ck-group__title { font-size: 11px; letter-spacing: .18em; }

  .ck-row {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 16px;
  }
  /* nas linhas com campos curtos (CEP/número/UF) mantém uma linha quando faz sentido */
  .ck-row:has(.ck-field--cep) {
    grid-template-columns: 1fr;
  }
  .ck-row:has(.ck-field--numero) {
    grid-template-columns: 100px 1fr;
  }
  .ck-row:has(.ck-field--uf) {
    grid-template-columns: 1fr 90px;
  }
  .ck-row:has(.ck-field--uf) .ck-field:nth-child(2) {
    grid-column: 1 / -1; /* cidade ocupa a linha inteira */
  }
  .ck-row:has(.ck-field--uf) .ck-field:first-child {
    grid-column: 1 / -1; /* bairro ocupa a linha inteira */
  }
  .ck-row:has(.ck-field--uf) .ck-field:last-child {
    grid-column: 2 / 3;
  }

  .ck-field input,
  .ck-field select {
    padding: 14px;
    font-size: 16px; /* >= 16px evita zoom no iOS */
  }

  .ck-pay__card { padding: 14px 16px; gap: 12px; }
  .ck-pay__icon { width: 36px; height: 36px; }
  .ck-pay__icon svg { width: 18px; height: 18px; }
  .ck-pay__label strong { font-size: 1rem; }

  .ck-submit { padding: 18px; font-size: 1rem; }

  .ck-trust { grid-template-columns: 1fr; gap: 10px; }
  .ck-trust__badge { padding: 12px 14px; }
  .ck-trust__copy small { font-size: 0.8rem; }

  .ck-sum__title { font-size: 11px; letter-spacing: .18em; }
  .ck-sum__info h3 { font-size: 1.3rem; }

  .page-checkout .nav { padding: 14px 16px; }
  .checkout__back { padding: 8px 12px; font-size: 11px; }
  .checkout__back span { display: none; }
}

/* =========================================================
   PÁGINA /download — área protegida de download
   ========================================================= */
.dl {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 24px 64px;
}
.dl__card {
  width: 100%;
  max-width: 520px;
  text-align: center;
  background: rgba(20, 14, 10, .72);
  border: 1px solid rgba(236, 221, 196, .12);
  border-radius: 10px;
  padding: 48px 40px;
  backdrop-filter: blur(6px);
}
.dl-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.dl-state .ck-spinner,
.dl-state .ck-success-icon { margin: 8px auto; }
.dl__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--bone);
  line-height: 1.1;
  margin: 0;
}
.dl__hint {
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--bone-dim);
  line-height: 1.55;
  margin: 0;
}
.dl__hint--sm { font-size: .9rem; opacity: .8; }
.dl__hint strong { color: var(--bone); }
.dl__btns {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-top: 8px;
}
.dl__btns .btn { width: 100%; justify-content: center; }
.dl__btns .btn[disabled] { opacity: .45; cursor: not-allowed; }
.dl__lock {
  width: 60px; height: 60px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 2px solid rgba(236, 221, 196, .3);
  color: var(--bone-dim);
}
.dl__lock svg { width: 28px; height: 28px; }
#dl-msg { color: var(--ember, #ff8a5c); }

@media (max-width: 640px) {
  .dl { padding: 90px 16px 48px; }
  .dl__card { padding: 36px 24px; }
}

/* =========================================================
   SUPORTE TÉCNICO (WhatsApp)
   ========================================================= */

/* Link de suporte dentro da tela de erro do modal */
.ck-support-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  color: #25d366;
  font-family: var(--font-title);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 10px 16px;
  border: 1px solid rgba(37, 211, 102, .4);
  border-radius: 4px;
  transition: background .2s ease, color .2s ease;
}
.ck-support-link:hover { background: rgba(37, 211, 102, .12); }
.ck-support-link svg { width: 16px; height: 16px; }

/* Botão flutuante fixo de suporte (canto inferior direito) */
.ck-support-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: #25d366;
  color: #0a2e16;
  font-family: var(--font-title);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 40px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .35), 0 0 0 1px rgba(37, 211, 102, .5);
  transition: transform .18s ease, box-shadow .18s ease;
}
.ck-support-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .45), 0 0 0 1px rgba(37, 211, 102, .7);
}
.ck-support-fab svg { width: 18px; height: 18px; }

@media (max-width: 640px) {
  .ck-support-fab { right: 14px; bottom: 14px; padding: 12px; }
  .ck-support-fab span { display: none; } /* só o ícone no mobile, não cobre o form */
}
