/* Janela de pagamento de /planos: forma de pagamento (cartão ou Pix) e o pagamento ali mesmo, sem a página da Stripe. */

.plan__methods { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 12px 0 0; color: var(--muted); font-size: 13px; }
.plan__methods .i { width: 16px; height: 16px; }
.plan__methods .i + .i { color: #32bcad; }
.plan__methods span { margin-inline-start: 2px; }

html:has(dialog.checkout[open]) { overflow: hidden; }

.checkout {
  width: min(100% - 32px, 520px);
  max-height: min(100dvh - 32px, 860px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  overscroll-behavior: contain;
}
.checkout[open] { animation: checkout-in .18s ease-out; }
.checkout::backdrop { background: rgba(15, 23, 42, .55); backdrop-filter: blur(3px); }

@keyframes checkout-in {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: none; }
}

.checkout__head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #f5f8ff, #ffffff);
}
.checkout__head img { flex: none; border-radius: 11px; box-shadow: 0 6px 16px -6px rgba(37, 99, 235, .55); }
.checkout__title { display: flex; flex: 1; flex-direction: column; min-width: 0; line-height: 1.3; }
.checkout__title strong { font-size: 17px; letter-spacing: -.01em; }
.checkout__title span { color: var(--muted); font-size: 13px; }
.checkout__close {
  display: inline-grid;
  flex: none;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.checkout__close:hover { border-color: var(--border); background: var(--surface-2); color: var(--text); }
.checkout__close .i { width: 18px; height: 18px; }

.checkout__step { display: grid; gap: 18px; padding: 20px; }
.checkout__step[hidden] { display: none; }
.checkout__group { display: grid; gap: 10px; min-width: 0; margin: 0; padding: 0; border: 0; }
.checkout__group[hidden] { display: none; }
.checkout__group legend { margin-bottom: 10px; padding: 0; color: var(--text-soft); font-size: 13px; font-weight: 650; letter-spacing: .01em; }

.method {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.method:hover { border-color: var(--border-strong); }
.method input, .month input { position: absolute; opacity: 0; pointer-events: none; }
/* is-selected vem do planos.js: o :has(input:checked) do Chromium não se atualiza na lista que nasce escondida. */
.method.is-selected { border-color: var(--accent); background: #f8faff; box-shadow: 0 0 0 1px var(--accent); }
.method:has(input:focus-visible), .month:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.method:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.method__icon {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid #d6e2ff;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}
.method__icon .i { width: 22px; height: 22px; }
.method__icon--pix { border-color: #c4ece7; background: #ecfaf8; color: #32bcad; }
.method__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.method__text strong { font-size: 15px; }
.method__text small { color: var(--muted); font-size: 13px; }
.method__price { color: var(--text-soft); font-size: 13px; font-weight: 650; white-space: nowrap; }

.months { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.month {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.month:hover { border-color: var(--border-strong); }
.month.is-selected { border-color: var(--accent); background: #f8faff; box-shadow: 0 0 0 1px var(--accent); }
.month__n { font-size: 14px; font-weight: 650; }
.month__price { color: var(--muted); font-size: 12px; white-space: nowrap; }

.checkout__note { display: flex; align-items: flex-start; gap: 8px; margin: 2px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.checkout__note .i { flex: none; width: 16px; height: 16px; margin-top: 1px; }

.checkout__total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
  color: var(--text-soft);
  font-size: 14px;
}
.checkout__total strong { color: var(--text); font-size: 22px; font-weight: 750; letter-spacing: -.02em; }

.checkout__step .button--large { gap: 8px; }
.checkout__error { margin: 0; }
.checkout__error[hidden] { display: none; }

.checkout__trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; margin: 0; padding: 0; color: var(--muted); font-size: 12.5px; list-style: none; }
.checkout__trust li { display: flex; align-items: center; gap: 6px; }
.checkout__trust .i { width: 15px; height: 15px; color: var(--success); }

.checkout__pay { display: grid; gap: 16px; padding: 16px 20px 20px; }
.checkout__pay[hidden] { display: none; }
.checkout__back { justify-self: start; margin: 0; }
.checkout__back[hidden] { display: none; }
.checkout__back .i { width: 16px; height: 16px; }
.checkout__card, .checkout__pix { display: grid; gap: 16px; }
.checkout__card[hidden], .checkout__pix[hidden] { display: none; }
.checkout__card .button--large { gap: 8px; }
.checkout__stripe { min-height: 120px; }
.checkout__loading { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0; padding: 48px 0; color: var(--muted); font-size: 14px; }
.checkout__loading[hidden] { display: none; }
.i.spin { width: 20px; height: 20px; color: var(--accent); animation: checkout-spin .8s linear infinite; }

/* Pix: QR e passos lado a lado; o código "copia e cola" embaixo, com o botão de copiar. */
.pix { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 20px; }
.pix__qr {
  display: grid;
  width: 224px;
  height: 224px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow: 0 0 0 4px #ecfaf8;
}
.pix__qr img { display: block; width: 208px; height: 208px; }
.pix__qr img[hidden] { display: none; }
.pix__steps { display: grid; gap: 12px; margin: 0; padding: 0; counter-reset: pix; list-style: none; color: var(--text-soft); font-size: 14px; line-height: 1.45; }
.pix__steps li { position: relative; padding-inline-start: 34px; counter-increment: pix; }
.pix__steps li::before {
  content: counter(pix);
  position: absolute;
  inset-inline-start: 0;
  top: -1px;
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: #ecfaf8;
  color: #1f8f84;
  font-size: 13px;
  font-weight: 700;
}
.pix__label { margin-bottom: -8px; color: var(--text-soft); font-size: 13px; font-weight: 650; }
.pix__code { display: flex; gap: 8px; }
.pix__code input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  color: var(--text);
  font: 13px/1.3 ui-monospace, "Cascadia Mono", Consolas, monospace;
  text-overflow: ellipsis;
}
.pix__code .button { flex: none; gap: 6px; }
.pix__code .i { width: 16px; height: 16px; }
.pix__wait { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: 14px; }
.pix__wait[hidden], .pix__expired[hidden] { display: none; }
.pix__wait .i.spin { width: 16px; height: 16px; color: #32bcad; }
.pix__timer { margin-inline-start: auto; font-variant-numeric: tabular-nums; }
.pix__expired { margin: 0; }

.checkout__done { display: grid; justify-items: center; gap: 8px; padding: 36px 8px; text-align: center; }
.checkout__done[hidden] { display: none; }
.checkout__done strong { font-size: 19px; }
.checkout__done > span:last-child { color: var(--muted); font-size: 14px; }
.checkout__done-icon {
  display: inline-grid;
  width: 56px;
  height: 56px;
  margin-bottom: 6px;
  place-items: center;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  animation: checkout-in .25s ease-out;
}
.checkout__done-icon .i { width: 28px; height: 28px; stroke-width: 2.5; }

@keyframes checkout-spin { to { transform: rotate(360deg); } }

@media (max-width: 560px) {
  .checkout { width: 100%; max-width: 100%; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; }
  .checkout__head, .checkout__step { padding-inline: 16px; }
  .checkout__pay { padding-inline: 16px; }
  .months { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pix { grid-template-columns: 1fr; justify-items: center; }
  .method { grid-template-columns: auto 1fr; }
  .method__price { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  .checkout[open] { animation: none; }
  .i.spin { animation-duration: 2s; }
}
