.checkout-page {
  background:
    radial-gradient(circle at top left, rgba(31, 111, 255, 0.06), transparent 26%),
    linear-gradient(180deg, #f4f7fc 0%, #eef3f9 100%);
  color: var(--cor-texto, #182033);
}

.checkout-shell {
  width: min(100% - 32px, 1280px);
  margin: 0 auto;
  padding: 28px 0 48px;
}

.checkout-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
  padding: 8px 4px 0;
}

.checkout-topbar h1 {
  margin: 0 0 8px;
  font-size: 40px;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: #10203a;
  font-weight: 900;
}

.checkout-topbar p {
  margin: 0;
  max-width: 620px;
  color: #667085;
  font-size: 15px;
  line-height: 1.6;
}

.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: start;
}

.checkout-main {
  display: grid;
  gap: 22px;
}

.checkout-sidebar {
  position: sticky;
  top: 24px;
}

.checkout-card {
  position: relative;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #dfe7f2;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(10px);
}

.checkout-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--cor-primaria, #1f6fff), rgba(31, 111, 255, 0.08));
  opacity: 0.9;
}

.checkout-card__body {
  padding: 24px;
}

.checkout-card h2 {
  margin: 0 0 18px;
  color: #152238;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 850;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field--full {
  grid-column: 1 / -1;
}

.field label {
  color: #344054;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.field input,
.field select {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid #d7e0ec;
  border-radius: 14px;
  background: #fbfcfe;
  color: #182033;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.field input::placeholder,
.field select::placeholder {
  color: #98a2b3;
}

.field input:hover,
.field select:hover {
  border-color: #c4d4ea;
  background: #ffffff;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: rgba(31, 111, 255, 0.55);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(31, 111, 255, 0.12);
}

.field-inline {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.checkout-payment-panel {
  margin-top: 4px;
}

.checkout-summary__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0;
  color: #4a5568;
  font-size: 15px;
}

.checkout-summary__row strong {
  color: #162033;
  font-weight: 800;
}

.checkout-summary__row--total {
  margin-top: 10px;
  padding-top: 16px;
  border-top: 1px solid #e5ecf5;
  font-size: 20px;
}

.checkout-summary__row--total strong {
  color: var(--cor-primaria, #1f6fff);
  font-size: 26px;
  letter-spacing: -0.03em;
}

.checkout-actions {
  margin-top: 22px;
}

.checkout-actions .btn {
  width: 100%;
}

.checkout-feedback {
  margin-top: 16px;
  min-height: 22px;
  font-size: 14px;
  line-height: 1.5;
}

.checkout-feedback[data-type="success"] {
  color: #0f8b57;
}

.checkout-feedback[data-type="warning"] {
  color: #b96d00;
}

.checkout-feedback[data-type="error"] {
  color: #d92d20;
}

.checkout-feedback[data-type="info"] {
  color: #667085;
}

.checkout-item {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid #ebf0f6;
  align-items: center;
}

.checkout-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.checkout-item__image {
  width: 78px;
  height: 78px;
  border-radius: 18px;
  object-fit: cover;
  background: linear-gradient(180deg, #eff4fb 0%, #f9fbff 100%);
  border: 1px solid #e5ecf6;
  padding: 8px;
}

.checkout-item__title {
  margin: 0 0 6px;
  color: #152238;
  font-size: 17px;
  line-height: 1.3;
  font-weight: 800;
}

.checkout-item__meta {
  margin: 0;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.55;
}

.checkout-item__price {
  font-weight: 900;
  color: var(--cor-primaria, #1f6fff);
  white-space: nowrap;
  font-size: 20px;
  letter-spacing: -0.02em;
}

#checkoutFingerprintStatus {
  display: block;
  margin-top: 12px !important;
  color: #667085 !important;
  font-size: 12px;
  line-height: 1.45;
}

.checkout-loading[hidden] {
  display: none !important;
}

.checkout-loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(14, 22, 40, 0.34);
  backdrop-filter: blur(9px);
}

.checkout-loading__card {
  width: min(100%, 460px);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(31, 111, 255, 0.16);
  border-radius: 24px;
  box-shadow: 0 28px 70px rgba(16, 24, 40, 0.22);
  padding: 30px 28px 26px;
  text-align: center;
}

.checkout-loading__spinner {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 50%;
  border: 4px solid rgba(31, 111, 255, 0.14);
  border-top-color: var(--cor-primaria, #1f6fff);
  border-right-color: var(--cor-primaria-escura, #1257d6);
  animation: checkout-spin 0.85s linear infinite;
  box-shadow: inset 0 0 0 1px rgba(31, 111, 255, 0.05);
}

.checkout-loading__title {
  margin: 0 0 8px;
  color: #182033;
  font-size: 28px;
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 900;
}

.checkout-loading__message {
  margin: 0 0 16px;
  color: #667085;
  font-size: 14px;
  line-height: 1.6;
}

.checkout-loading__secure {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #f4f8ff;
  border: 1px solid #d8e7ff;
  color: #2759b4;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.checkout-loading__secure::before {
  content: "🔒";
  font-size: 14px;
}

body.checkout-loading-active {
  overflow: hidden;
}

@keyframes checkout-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1100px) {
  .checkout-topbar h1 {
    font-size: 34px;
  }

  .checkout-layout {
    grid-template-columns: 1fr 330px;
  }

  .checkout-card h2 {
    font-size: 24px;
  }
}

@media (max-width: 980px) {
  .checkout-layout {
    grid-template-columns: 1fr;
  }

  .checkout-sidebar {
    position: static;
  }
}

@media (max-width: 640px) {
  .checkout-shell {
    width: min(100% - 20px, 1280px);
    padding: 18px 0 32px;
  }

  .checkout-topbar {
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
  }

  .checkout-topbar h1 {
    font-size: 30px;
  }

  .checkout-card {
    border-radius: 18px;
  }

  .checkout-card__body {
    padding: 18px;
  }

  .checkout-card h2 {
    font-size: 22px;
    margin-bottom: 16px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .field-inline {
    grid-template-columns: 1fr;
  }

  .checkout-item {
    grid-template-columns: 64px 1fr;
  }

  .checkout-item__price {
    grid-column: 2;
    justify-self: start;
    font-size: 18px;
  }

  .checkout-summary__row--total strong {
    font-size: 22px;
  }

  .checkout-loading__card {
    padding: 24px 20px 22px;
    border-radius: 20px;
  }

  .checkout-loading__title {
    font-size: 24px;
  }
}

.pix-box {
  background: #fff;
  border: 1px solid #e0e6ef;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  margin-top: 12px;
}
/* ================================================================
   CHECKOUT — MODERNIZAÇÃO v3 (adicionado às correções)
   ================================================================ */

/* ── Visa/Master/Elo logos inline ──────────────────────────────── */
.checkout-accepted-brands {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.checkout-accepted-brands span {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f0f6fb;
  border: 1px solid #d7e0ec;
  color: #4474A3;
}

/* ── Secure badge on sidebar ───────────────────────────────────── */
.checkout-secure-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #f0faf5;
  border: 1px solid #b7dfcf;
  border-radius: 10px;
  margin-top: 14px;
  font-size: 12px;
  color: #0d7a4e;
  font-weight: 700;
}

/* ── Pix QR box aprimorado ─────────────────────────────────────── */
.pix-box {
  background: #f8fffe;
  border: 2px dashed #43d9ad;
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  margin-top: 12px;
}
.pix-box canvas, .pix-box img {
  max-width: 180px;
  border-radius: 12px;
  margin: 0 auto 12px;
  display: block;
}
.pix-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: #0d7a4e;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
  transition: background .18s;
}
.pix-copy-btn:hover { background: #0a5e3b; }
.pix-copy-btn.copied { background: #4474A3; }

/* ── Feedback de bandeira ──────────────────────────────────────── */
.card-brand-detect.detected {
  animation: brand-pop .25s ease;
}
@keyframes brand-pop {
  0%  { transform: scale(.97); opacity: .7; }
  60% { transform: scale(1.02); }
  100%{ transform: scale(1); opacity: 1; }
}

/* ── Melhorias mobile (até 480px) ─────────────────────────────── */
@media (max-width: 480px) {
  .checkout-topbar h1 { font-size: 26px; }
  .checkout-card__body { padding: 16px; }
  .checkout-summary__row--total strong { font-size: 20px; }

  /* Botão finalizar sticky no mobile */
  .checkout-sidebar .checkout-card {
   
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
    box-shadow: 0 -8px 32px rgba(3,30,54,.18);
  }
  .checkout-sidebar .checkout-card .checkout-card__body {
    padding: 16px 18px 20px;
  }
  .checkout-shell {
    padding-bottom: 200px; /* space for sticky sidebar */
  }
  /* Hide totals breakdown on mobile to keep sticky compact */
  .checkout-sidebar .checkout-summary__row:not(.checkout-summary__row--total) {
    font-size: 13px;
    padding: 4px 0;
  }
}

/* ── Campo inválido highlight ──────────────────────────────────── */
.field input.invalid,
.field select.invalid {
  border-color: var(--color-danger, #c0392b) !important;
  box-shadow: 0 0 0 3px rgba(192,57,43,.12) !important;
}

/* ── Spinner loading aprimorado ────────────────────────────────── */
.checkout-loading__steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
  text-align: left;
}
.checkout-loading__step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #667085;
  opacity: .5;
  transition: opacity .3s, color .3s;
}
.checkout-loading__step.active {
  opacity: 1;
  color: #1a3a5c;
  font-weight: 700;
}
.checkout-loading__step.done {
  opacity: 1;
  color: #0d7a4e;
}
.checkout-loading__step::before {
  content: "○";
  font-size: 12px;
}
.checkout-loading__step.active::before { content: "●"; }
.checkout-loading__step.done::before { content: "✓"; }
