*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  background: #f5f5f5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background: #fff;
  border-bottom: 1px solid #d9e2f2;
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
}

main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 24px 60px;
}

.card {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07), 0 8px 32px rgba(0,0,0,0.06);
  overflow: hidden;
}

.card-banner {
  background: #003a8f;
  padding: 32px 28px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.card-banner::before {
  content: '';
  position: absolute;
  width: 200px; height: 200px;
  border-radius: 50%;
  border: 20px solid rgba(221, 221, 221, 0.08);
  top: -60px; right: -60px;
}
.card-banner::after {
  content: '';
  position: absolute;
  width: 120px; height: 120px;
  border-radius: 50%;
  border: 20px solid rgba(221, 221, 221, 0.08);
  bottom: -30px; left: -30px;
}

.check-circle {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.banner-title {
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  text-align: center;
  position: relative;
  z-index: 1;
  line-height: 1.4;
}

.card-body {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.info-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #eef2f7;
}
.info-row:last-of-type { border-bottom: none; }

.info-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #003a8f;
  flex-shrink: 0;
}

.info-dot.gray { background: #b8c2cc; }

.info-text {
  font-size: 14px;
  color: #555;
  line-height: 1.5;
}

.info-text strong {
  color: #1a1a1a;
  font-weight: 600;
}

.divider {
  height: 1px;
  background: #eef2f7;
  margin: 4px 0 20px;
}

.btn-confirmar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: #003a8f;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  border: none;
  border-radius: 12px;
  padding: 17px 22px;
  cursor: pointer;
  text-transform: uppercase;
  transition: background 0.15s, transform 0.1s;
  font-family: 'Inter', sans-serif;
  margin-top: 8px;
}
.btn-confirmar:hover { background: #002f6c; }
.btn-confirmar:active { transform: scale(0.99); }

.btn-arrow {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
}

.powered {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
  font-size: 12px;
  color: #9aa4af;
}

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(3px);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.overlay.active { display: flex; }

.loading-card {
  background: #fff;
  border-radius: 20px;
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 320px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  animation: slide-up 0.3s cubic-bezier(.22,.68,0,1.2) both;
}

@keyframes slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.loading-icon {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: #eef4ff;
  display: flex; align-items: center; justify-content: center;
}

@keyframes spin { to { transform: rotate(360deg); } }
.spinner-ring {
  width: 32px; height: 32px;
  border: 3px solid #bfd0f2;
  border-top-color: #003a8f;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-title {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
  text-align: center;
}

.loading-sub {
  font-size: 13px;
  color: #888;
  margin-top: -12px;
  text-align: center;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: #eef2f7;
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #003a8f, #0057d8);
  border-radius: 99px;
  transition: width 0.4s ease;
}

.progress-label {
  font-size: 12px;
  color: #9aa4af;
  align-self: flex-end;
  margin-top: -12px;
}

.error-banner {
  background: linear-gradient(135deg, #003a8f, #0057d8) !important;
}

.error-icon-wrap {
  width: 66px; height: 66px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.4);
  display: flex; align-items: center; justify-content: center;
}

.error-desc {
  font-size: 14px;
  color: #444;
  line-height: 1.6;
  margin-bottom: 16px;
}

.error-info-box {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #fffbe6;
  border: 1px solid #ffe58f;
  border-radius: 10px;
  padding: 14px;
  font-size: 13.5px;
  color: #1a1a1a;
  line-height: 1.55;
  margin-bottom: 20px;
}

.btn-frete { margin-top: 0 !important; }

.cta-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 12px;
  color: #6b7280;
  background: #f7f9fc;
  border-radius: 99px;
  padding: 7px 16px;
  width: fit-content;
  align-self: center;
  margin-left: auto;
  margin-right: auto;
}

@keyframes pop-in {
  0%   { transform: scale(0.5); opacity: 0; }
  70%  { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}
.check-circle { animation: pop-in 0.5s cubic-bezier(.36,.07,.19,.97) both; }

@keyframes shimmer {
  0%   { opacity: 0.4; }
  50%  { opacity: 1; }
  100% { opacity: 0.4; }
}
.shimmer { animation: shimmer 1.6s ease-in-out infinite; }

.pix-banner {
  background: linear-gradient(135deg, #003a8f, #0057d8) !important;
  padding: 24px 28px 22px;
  gap: 10px;
}

.banner-row {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 1;
  width: 100%;
}

.pix-icon-wrap {
  width: 48px; height: 48px;
  min-width: 48px;
  border-radius: 12px;
  background: rgba(255,255,255,0.18);
  border: 1.5px solid rgba(255,255,255,0.4);
  display: flex; align-items: center; justify-content: center;
  animation: pop-in 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

.banner-text { display: flex; flex-direction: column; gap: 2px; }

.banner-title-sm {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.banner-subtitle {
  font-size: 12px;
  color: rgba(255,255,255,0.72);
}

.timer-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(0,0,0,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  position: relative; z-index: 1;
  width: 100%;
  justify-content: space-between;
}

.timer-left { display: flex; align-items: center; gap: 7px; }

.timer-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #ffcc00;
  box-shadow: 0 0 6px #ffcc00;
  animation: pulse-dot 1s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.7); }
}

.timer-val {
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}

.value-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fffbe6;
  border: 1px solid #ffe58f;
  border-radius: 10px;
  padding: 12px 16px;
}

.value-label { font-size: 13px; color: #555; }
.value-amount { font-size: 18px; font-weight: 700; color: #003a8f; }

.or-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0;
}
.or-divider::before, .or-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #ebebeb;
}
.or-divider span { font-size: 11px; color: #9aa4af; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }

.pix-main {
  display: flex;
  gap: 16px;
  align-items: stretch;
  flex-direction: column;
}

.qr-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: #f9fbff;
  border: 1px solid #d9e2f2;
  border-radius: 12px;
  padding: 16px;
  flex: 0 0 auto;
}

.qr-box {
  position: relative;
  width: 150px; height: 150px;
}

.qr-corner {
  position: absolute;
  width: 16px; height: 16px;
  border-color: #003a8f;
  border-style: solid;
  border-width: 0;
}
.qr-corner.tl { top: -2px; left: -2px; border-top-width: 3px; border-left-width: 3px; border-radius: 4px 0 0 0; }
.qr-corner.tr { top: -2px; right: -2px; border-top-width: 3px; border-right-width: 3px; border-radius: 0 4px 0 0; }
.qr-corner.bl { bottom: -2px; left: -2px; border-bottom-width: 3px; border-left-width: 3px; border-radius: 0 0 0 4px; }
.qr-corner.br { bottom: -2px; right: -2px; border-bottom-width: 3px; border-right-width: 3px; border-radius: 0 0 4px 0; }

.qr-hint { font-size: 11px; color: #999; text-align: center; line-height: 1.4; }

.code-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.code-side-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.7px;
  color: #7b8794;
  text-transform: uppercase;
}

.pix-code-box {
  flex: 1;
  background: #f4f7fb;
  border: 1px solid #d9e2f2;
  border-radius: 10px;
  padding: 12px;
  font-size: 10.5px;
  color: #555;
  font-family: 'Courier New', monospace;
  word-break: break-all;
  line-height: 1.6;
  user-select: all;
  min-height: 80px;
}

  .btn-copiar {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      width: 100%;
      background: #22a04a;
      color: #fff;
      font-size: 13px;
      font-weight: 700;
      letter-spacing: 0.6px;
      border: none;
      border-radius: 10px;
      padding: 13px 18px;
      cursor: pointer;
      text-transform: uppercase;
      transition: background 0.15s, transform 0.1s;
      font-family: 'Inter', sans-serif;
    }
    .btn-copiar:hover { background: #1a8038; }
    .btn-copiar:active { transform: scale(0.99); }
    .btn-copiar.copied { background: #155f2c; }

.copy-icon { flex-shrink: 0; transition: transform 0.2s; }
.btn-copiar.copied .copy-icon { display: none; }
.check-icon { display: none; flex-shrink: 0; }
.btn-copiar.copied .check-icon { display: block; }

.expiry-box {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #fffbe6;
  border: 1px solid #ffe58f;
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 12px;
  color: #8c6d1f;
  line-height: 1.5;
}

.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.7px;
  color: #7b8794;
  text-transform: uppercase;
}

.steps-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid #d9e2f2;
  border-radius: 12px;
  overflow: hidden;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 13px;
  border-bottom: 1px solid #eef2f7;
}
.step-item:last-child { border-bottom: none; }

.step-num {
  min-width: 20px; height: 20px;
  border-radius: 50%;
  background: #003a8f;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}

.step-text { font-size: 12.5px; color: #555; line-height: 1.5; }
.step-text strong { color: #1a1a1a; font-weight: 600; }

.powered-green {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11.5px;
  color: #9aa4af;
}

.gen-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(3px);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
}

.gen-card {
  background: #fff;
  border-radius: 20px;
  padding: 32px 36px;
  display: flex; flex-direction: column;
  align-items: center; gap: 18px;
  width: 290px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  animation: slide-up 0.3s cubic-bezier(.22,.68,0,1.2) both;
}

.gen-icon {
  width: 58px; height: 58px;
  border-radius: 50%;
  background: #eef4ff;
  display: flex; align-items: center; justify-content: center;
}

.spinner-green {
  width: 28px; height: 28px;
  border: 3px solid #bfd0f2;
  border-top-color: #003a8f;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.gen-title { font-size: 15px; font-weight: 700; color: #1a1a1a; }
.gen-sub { font-size: 12px; color: #888; margin-top: -10px; }

.gen-steps { width: 100%; display: flex; flex-direction: column; gap: 7px; }

.gen-step {
  display: flex; align-items: center; gap: 9px;
  font-size: 12.5px; color: #9aa4af; transition: color 0.3s;
}
.gen-step.done { color: #003a8f; }
.gen-step.active { color: #1a1a1a; font-weight: 500; }

.gen-step-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #e0e0e0; flex-shrink: 0; transition: background 0.3s;
}
.gen-step.done .gen-step-dot { background: #003a8f; }
.gen-step.active .gen-step-dot { background: #ffcc00; animation: pulse-dot 0.8s ease-in-out infinite; }

@keyframes slide-up {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

@keyframes fade-in-up {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.pix-page { animation: fade-in-up 0.35s ease both; }

#pixPage .card-body { gap: 12px; }

#qrCanvas {
  width: 150px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#qrCanvas img,
#qrCanvas canvas {
  width: 150px !important;
  height: 150px !important;
  display: block;
}