/* ==========================================================================
   Checkout BCPay — demonstração
   Resumo do pedido no escuro (marca), pagamento no claro (confiança e leitura).
   ========================================================================== */
:root {
  --verde: #1CE000;
  --verde-claro: #9BFF8A;
  --verde-escuro: #0B7A00;
  --grafite: #0A0F0B;
  --laranja: #FF9600;
  --nevoa: #F3F6F2;
  --branco: #FFFFFF;
  --texto: #0A0F0B;
  --texto-2: #4A564C;
  --texto-3: #5F6B61; /* 5,6:1 sobre o branco (AA) */
  --borda: #DCE3DB;
  --campo: #F6F8F5;
  --f-display: "Sora", system-ui, sans-serif;
  --f-text: "Inter", system-ui, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--grafite); overflow-y: scroll; } /* barra fixa: a tela de aprovado não pula para o lado */
body {
  margin: 0;
  min-height: 100vh;
  font: 400 1rem/1.55 var(--f-text);
  color: var(--texto);
  background: var(--nevoa);
  -webkit-font-smoothing: antialiased;
}
h1, h2, p, ol, ul, dl, dd, fieldset { margin: 0; }
ol, ul { padding: 0; list-style: none; }
fieldset { border: 0; padding: 0; min-width: 0; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--verde-escuro); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- Faixa de demonstração ---------- */
.demo-bar {
  position: relative; z-index: 5;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 16px;
  background: #1A1F1B; color: #C9D3CA;
  font-size: 0.8125rem;
}
.demo-bar strong { color: #fff; font-weight: 600; }
.demo-bar__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--laranja); flex: none; }
.demo-bar p { flex: 1; min-width: 200px; }
.demo-bar a { color: var(--verde); font-weight: 600; text-decoration: none; }
.demo-bar a:hover { text-decoration: underline; }

/* ---------- Estrutura ---------- */
.co { display: grid; min-height: calc(100vh - 40px); }
@media (min-width: 960px) {
  .co { grid-template-columns: minmax(380px, 0.9fr) 1.1fr; }
}

/* ---------- Resumo (escuro) ---------- */
.summary {
  position: relative;
  background:
    radial-gradient(90% 60% at 0% 100%, rgba(28, 224, 0, 0.22), transparent 60%),
    radial-gradient(60% 40% at 100% 0%, rgba(28, 224, 0, 0.1), transparent 70%),
    var(--grafite);
  color: #F3F6F2;
  overflow: hidden;
}
.summary__inner {
  display: flex; flex-direction: column; gap: 20px;
  padding: 20px 16px;
  max-width: 460px; margin-left: auto; width: 100%;
}
@media (min-width: 960px) {
  .summary__inner { position: sticky; top: 0; min-height: calc(100vh - 40px); padding: 56px 56px 40px; }
}
.store { display: flex; align-items: center; gap: 12px; }
.store__logo {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 12px;
  background: #F3E3C7; color: #5A3A12;
  font: 700 0.875rem/1 var(--f-display);
}
.store__name { font-weight: 600; }
.store__sub { font-size: 0.8125rem; color: #8E9A90; }

.summary__toggle {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; padding: 14px 16px;
  border: 0; border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  color: #C9D3CA; font-size: 0.9375rem; cursor: pointer;
}
.summary__toggle strong { color: #fff; font-variant-numeric: tabular-nums; }
.summary__body { overflow: hidden; }
.summary__body[hidden] { display: none; }
@media (min-width: 960px) {
  .summary__toggle { display: none; }
  .summary__body, .summary__body[hidden] { display: block; height: auto !important; }
}
.summary__label { font: 500 0.9375rem/1.2 var(--f-text); color: #8E9A90; margin-top: 8px; }
.summary__total {
  font: 600 clamp(2.5rem, 5vw, 3.25rem)/1.05 var(--f-display);
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  margin: 6px 0 28px;
}
.items { display: grid; gap: 14px; margin-bottom: 24px; }
.item { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 14px; }
.item__img {
  width: 52px; height: 52px; border-radius: 14px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  font-size: 1.5rem;
}
.item__name { font-weight: 500; line-height: 1.3; }
.item__qty { font-size: 0.8125rem; color: #8E9A90; }
.item__price { font-weight: 600; font-variant-numeric: tabular-nums; }
.totals { display: grid; gap: 10px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, 0.1); font-size: 0.9375rem; }
.totals div { display: flex; justify-content: space-between; color: #A9B6AB; }
.totals dd { font-variant-numeric: tabular-nums; }
.totals__sum { padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.totals__sum dt, .totals__sum dd { color: #fff; font-weight: 600; }

.powered { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 20px; font-size: 0.8125rem; color: #8E9A90; }
.powered strong { color: #fff; }
.powered__mark { width: 22px; height: 24px; padding: 4px; border-radius: 7px; background: var(--verde); color: var(--grafite); }

/* ---------- Pagamento (claro) ---------- */
.pay { background: var(--branco); }
.pay__inner {
  max-width: 560px;
  padding: 28px 16px 48px;
}
/* tablet em pé (uma coluna): resumo e pagamento centralizados e da mesma largura */
@media (max-width: 959.98px) {
  .summary__inner, .pay__inner { max-width: 560px; margin-inline: auto; }
}
@media (min-width: 960px) {
  .pay { box-shadow: -30px 0 80px -40px rgba(10, 15, 11, 0.35); }
  .pay__inner { padding: 56px 56px 64px; }
}
.group { margin-bottom: 28px; }
.group__title {
  display: flex; align-items: center; gap: 8px;
  font: 600 1.125rem/1.3 var(--f-display);
  letter-spacing: -0.02em;
  margin-bottom: 14px; padding: 0;
}
.tag {
  font: 500 0.75rem/1 var(--f-text);
  letter-spacing: 0;
  padding: 4px 8px; border-radius: 999px;
  background: #FFF1DC; color: #8A4B00;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 6px; grid-column: span 2; font-size: 0.8125rem; font-weight: 500; color: var(--texto-2); }
@media (min-width: 520px) { .field { grid-column: span 1; } .field--full { grid-column: span 2; } }
.field input, .field select {
  width: 100%; height: 48px; padding: 0 14px;
  border: 0; border-radius: 12px;
  background: var(--campo);
  box-shadow: inset 0 0 0 1px var(--borda);
  font-size: 1rem; font-weight: 500; color: var(--texto);
  transition: box-shadow 0.2s ease, background-color 0.2s ease;
}
.field input[readonly] { color: var(--texto-2); cursor: default; }
.field input:focus, .field select:focus { outline: none; background: #fff; box-shadow: inset 0 0 0 2px var(--grafite); }
.field select {
  appearance: none; -webkit-appearance: none; cursor: pointer; color: var(--texto);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%230A0F0B' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 40px;
}
.field__hint { font-size: 0.8125rem; font-weight: 400; color: var(--texto-3); min-height: 1.2em; }

/* Seletor de forma de pagamento */
.seg {
  position: relative;
  display: grid; grid-template-columns: repeat(2, 1fr);
  padding: 4px; border-radius: 14px;
  background: #EEF2ED;
  margin-bottom: 16px;
}
.seg__thumb {
  position: absolute; top: 4px; bottom: 4px; left: 4px;
  width: calc((100% - 8px) / 2);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(10, 15, 11, 0.08), 0 4px 14px -4px rgba(10, 15, 11, 0.16);
  transition: transform 0.5s var(--ease-out);
}
.seg__btn {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px;
  border: 0; background: none; cursor: pointer;
  font-weight: 600; font-size: 0.9375rem; color: var(--texto-2);
  border-radius: 10px;
  transition: color 0.25s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.seg__btn:active { transform: scale(0.97); }
.seg__btn[aria-selected="true"] { color: var(--texto); }
.seg__btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.seg__btn[aria-selected="true"] svg { stroke: var(--verde-escuro); }

.methods { position: relative; overflow: hidden; }
.method {
  padding: 18px;
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px var(--borda);
}
.method[hidden] { display: none; }

/* Pix */
.pix { display: grid; gap: 18px; align-items: center; }
@media (min-width: 520px) { .pix { grid-template-columns: auto 1fr; } }
.pix__qr { justify-self: center; padding: 10px; border-radius: 16px; background: #fff; box-shadow: 0 0 0 1px var(--borda), 0 12px 30px -16px rgba(10, 15, 11, 0.35); }
.qr { width: 156px; aspect-ratio: 1; display: grid; grid-template-columns: repeat(21, 1fr); }
.qr i { background: var(--grafite); border-radius: 1px; }
.qr i.o { background: transparent; }
.pix__title { font-weight: 600; margin-bottom: 8px; }
.pix__steps { counter-reset: s; display: grid; gap: 6px; font-size: 0.875rem; color: var(--texto-2); }
.pix__steps li { counter-increment: s; display: grid; grid-template-columns: 22px 1fr; gap: 6px; }
.pix__steps li::before {
  content: counter(s);
  display: grid; place-items: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: #E7F9E3; color: var(--verde-escuro);
  font-size: 0.6875rem; font-weight: 700;
}
.pix__timer { margin-top: 10px; font-size: 0.8125rem; color: var(--texto-3); }
.pix__timer strong { color: #B35F00; font-variant-numeric: tabular-nums; }
.copy { display: flex; gap: 8px; margin-top: 16px; }
.copy__input {
  flex: 1; min-width: 0; height: 46px; padding: 0 12px;
  border: 0; border-radius: 12px; background: var(--campo);
  box-shadow: inset 0 0 0 1px var(--borda);
  font: 500 0.8125rem/1 ui-monospace, "SF Mono", Menlo, monospace; color: var(--texto-2);
}
.copy__btn {
  flex: none; height: 46px; padding: 0 16px;
  border: 0; border-radius: 12px; cursor: pointer;
  background: var(--grafite); color: #fff; font-weight: 600; font-size: 0.875rem;
  transition: transform 0.15s ease, background-color 0.2s ease;
}
.copy__btn:active { transform: scale(0.97); }
.copy__btn.is-done { background: var(--verde-escuro); }

/* Cartão */
.card-wrap { perspective: 1200px; margin: 4px 0 20px; }
.ccard {
  position: relative;
  width: min(340px, 100%); aspect-ratio: 1.586;
  margin-inline: auto;
  transform-style: preserve-3d;
  transition: transform 0.8s var(--ease-out);
}
.ccard.is-flipped { transform: rotateY(180deg); }
.ccard__face {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 20px;
  border-radius: 18px;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  color: #fff;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(28, 224, 0, 0.55), transparent 55%),
    linear-gradient(135deg, #0A0F0B 0%, #14301A 100%);
  box-shadow: 0 30px 50px -24px rgba(10, 15, 11, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  overflow: hidden;
}
.ccard__top { display: flex; justify-content: space-between; align-items: center; }
.ccard__chip { width: 40px; height: 30px; border-radius: 7px; background: linear-gradient(135deg, #E9D9A6, #B89B52); }
.ccard__mark { width: 30px; height: 33px; color: var(--verde); }
.ccard__number { font: 500 clamp(1.05rem, 4.4vw, 1.375rem)/1 var(--f-display); letter-spacing: 0.08em; font-variant-numeric: tabular-nums; }
.ccard__bottom { display: flex; justify-content: space-between; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.04em; }
.ccard__bottom small, .ccard__cvv small { display: block; font-size: 0.625rem; font-weight: 500; letter-spacing: 0.06em; opacity: 0.6; margin-bottom: 2px; }
.ccard__back { transform: rotateY(180deg); justify-content: center; gap: 18px; padding: 20px 0; }
.ccard__stripe { height: 40px; background: #050806; }
.ccard__cvv { align-self: flex-end; margin-right: 20px; padding: 6px 12px; border-radius: 6px; background: #fff; color: var(--grafite); font-weight: 700; letter-spacing: 0.1em; }

/* Botão de pagar */
.pay-btn {
  position: relative;
  display: grid; place-items: center;
  width: 100%; height: 58px;
  border: 0; border-radius: 16px; cursor: pointer;
  background: var(--verde); color: var(--grafite);
  font: 600 1.0625rem/1 var(--f-text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 14px 30px -14px rgba(28, 224, 0, 0.9);
  transition: transform 0.15s ease, background-color 0.2s ease, box-shadow 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}
.pay-btn:hover { background: #3BF01F; }
.pay-btn:active { transform: scale(0.985); }
.pay-btn__label { grid-area: 1 / 1; transition: opacity 0.2s ease, transform 0.3s var(--ease-out); font-variant-numeric: tabular-nums; }
.pay-btn__spinner {
  grid-area: 1 / 1;
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid rgba(10, 15, 11, 0.25); border-top-color: var(--grafite);
  opacity: 0; transform: scale(0.6);
  transition: opacity 0.2s ease, transform 0.3s var(--ease-out);
}
.pay-btn.is-loading { cursor: progress; }
.pay-btn.is-loading .pay-btn__label { opacity: 0; transform: translateY(-6px); }
.pay-btn.is-loading .pay-btn__spinner { opacity: 1; transform: scale(1); animation: spin 0.8s linear infinite; }
/* "from" explícito: sem ele o giro parte do scale(1) do estado de carregando e o navegador
   interpola como matriz; 0° e 360° dão a mesma matriz, e o círculo fica parado */
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.fine { margin-top: 12px; font-size: 0.8125rem; color: var(--texto-3); text-align: center; }

/* ---------- Sucesso ---------- */
.done { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 24px; }
.done[hidden] { display: none; }
.done__badge { width: 96px; height: 96px; margin-bottom: 22px; border-radius: 50%; background: #E7F9E3; display: grid; place-items: center; box-shadow: 0 0 0 10px rgba(28, 224, 0, 0.08); }
.done__badge svg { width: 80px; height: 80px; }
.done__ring { fill: var(--verde); stroke: var(--verde); stroke-width: 2; stroke-dasharray: 1 1; }
.done__check { fill: none; stroke: var(--grafite); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 1; }
.done__title { font: 600 clamp(1.75rem, 4vw, 2.25rem)/1.1 var(--f-display); letter-spacing: -0.04em; outline: none; }
.done__sub { margin-top: 8px; color: var(--texto-2); }
.receipt {
  width: 100%; margin: 28px 0;
  padding: 6px 18px;
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px var(--borda);
  text-align: left;
}
.receipt div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px dashed var(--borda); font-size: 0.9375rem; }
.receipt div:last-child { border-bottom: 0; }
.receipt dt { color: var(--texto-3); }
.receipt dd { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.done__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.ghost-btn, .link-btn {
  display: inline-flex; align-items: center; height: 48px; padding: 0 20px;
  border-radius: 999px; font-weight: 600; font-size: 0.9375rem; text-decoration: none; cursor: pointer;
  transition: transform 0.15s ease, background-color 0.2s ease;
}
.ghost-btn { border: 0; background: #EEF2ED; color: var(--texto); }
.ghost-btn:hover { background: #E3E9E2; }
.link-btn { background: var(--grafite); color: #fff; }
.link-btn:hover { background: #1C261E; }
.ghost-btn:active, .link-btn:active { transform: scale(0.97); }

/* ---------- Computador: mais compacto, para a tela inteira caber sem rolar ---------- */
@media (min-width: 960px) {
  .summary__inner { padding: 40px 56px 32px; }
  .summary__total { margin-bottom: 22px; }
  .pay__inner { padding: 40px 56px 24px; }
  .group { margin-bottom: 16px; }
  .group__title { margin-bottom: 10px; }
  .grid-2 { gap: 10px; }
  .field { gap: 4px; }
  .field input, .field select { height: 42px; }
  .seg { margin-bottom: 12px; }
  .seg__btn { height: 40px; }
  .method { padding: 16px; }
  .pix { gap: 16px; }
  .qr { width: 140px; }
  .pix__title { margin-bottom: 6px; }
  .pix__steps { gap: 4px; }
  .pix__timer { margin-top: 8px; }
  .copy { margin-top: 14px; }
  .copy__input, .copy__btn { height: 44px; }
  /* Cartão ao lado dos campos (número, validade, CVV); parcelas embaixo, na largura toda.
     Assim a aba Cartão fica da altura da aba Pix e a página não cresce ao trocar. */
  #painel-card:not([hidden]) {
    display: grid;
    grid-template-columns: 188px 1fr 1fr;
    column-gap: 12px; row-gap: 10px;
  }
  #painel-card .grid-2 { display: contents; }
  #painel-card .card-wrap { grid-column: 1; grid-row: 1 / span 2; align-self: center; margin: 0; }
  #painel-card .field:nth-child(1) { grid-column: 2 / span 2; grid-row: 1; }
  #painel-card .field:nth-child(2) { grid-column: 2; grid-row: 2; }
  #painel-card .field:nth-child(3) { grid-column: 3; grid-row: 2; }
  #painel-card .field:nth-child(4) { grid-column: 1 / -1; grid-row: 3; }
  .ccard { width: 100%; }
  .ccard__face { padding: 12px; border-radius: 12px; }
  .ccard__chip { width: 26px; height: 20px; border-radius: 5px; }
  .ccard__mark { width: 20px; height: 22px; }
  .ccard__number { font-size: 0.75rem; letter-spacing: 0.03em; white-space: nowrap; }
  .ccard__bottom { font-size: 0.625rem; letter-spacing: 0.02em; }
  .ccard__bottom small, .ccard__cvv small { font-size: 0.5rem; }
  .ccard__back { padding: 12px 0; gap: 8px; }
  .ccard__stripe { height: 24px; }
  .ccard__cvv { margin-right: 12px; padding: 3px 8px; font-size: 0.8125rem; }
  .pay-btn { height: 54px; }
  .fine { margin-top: 10px; }
}
/* coluna de pagamento mais estreita: menos margem lateral para o número do cartão caber */
@media (min-width: 960px) and (max-width: 1199.98px) {
  .pay__inner { padding-left: 32px; padding-right: 32px; }
  .summary__inner { padding-left: 32px; padding-right: 32px; }
}
/* notebooks (tela baixa): aperta mais um pouco para continuar sem rolagem */
@media (min-width: 960px) and (max-height: 820px) {
  .summary__inner { padding-top: 24px; padding-bottom: 20px; }
  .summary__total { margin-bottom: 16px; }
  .items { gap: 10px; margin-bottom: 18px; }
  .item__img { width: 44px; height: 44px; border-radius: 12px; font-size: 1.25rem; }
  .item { grid-template-columns: 44px 1fr auto; }
  .pay__inner { padding-top: 24px; padding-bottom: 16px; }
  .group { margin-bottom: 12px; }
  .group__title { margin-bottom: 8px; font-size: 1.0625rem; }
  .field input, .field select { height: 38px; }
  .seg { margin-bottom: 10px; }
  .seg__btn { height: 36px; }
  .method { padding: 12px; }
  .qr { width: 120px; }
  .pix__steps { font-size: 0.8125rem; }
  .copy { margin-top: 10px; }
  .copy__input, .copy__btn { height: 40px; }
  #painel-card:not([hidden]) { row-gap: 8px; }
  .pay-btn { height: 48px; border-radius: 14px; }
  .fine { margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
