
:root{
  --bf-azul:#0078C8;
  --bf-verde:#00B37E;
  --bf-verde-neon:#00E295;
  --bf-bg:#F7F9FC;
  --bf-texto:#0A2D4D;
  --bf-cinza:#555F6D;
  --bf-borda:#E3EAF1;
  --bf-danger:#D9534F;
  --max-width:1100px;
  --page-padding:28px;
}

/* reset */
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{
  font-family:"Poppins", Arial, sans-serif !important;
  background:var(--bf-bg);
  color:var(--bf-texto);
  padding:var(--page-padding);
  -webkit-font-smoothing:antialiased;
}

/* Layout */
.px-checkout-wrap{
  max-width:var(--max-width);
  margin:0 auto;
  display:grid;
  gap:20px;
  grid-template-columns:2fr 1.15fr;
  align-items:start;
}

/* Card base */
.px-card{
  background:#fff;
  border-radius:14px;
  border:1px solid var(--bf-borda);
  box-shadow:0 6px 18px rgba(0,0,0,.04);
  padding:18px;
  min-width:0;
}

/* Header */
.px-header{ text-align:left; margin-bottom:8px }
.px-header h1{ font-size:22px; font-weight:800; color:var(--bf-texto) }
.px-header p{ color:var(--bf-cinza); font-size:13px }

/* Form layout */
.px-form{ display:grid; gap:14px }
.row{ display:flex; gap:18px; align-items:flex-start; flex-wrap:wrap }

/* grid interno responsivo */
.px-grid{ display:grid; grid-template-columns:1fr 1fr; gap:12px }
.px-field{ display:flex; flex-direction:column; gap:6px }
.px-field.full{ grid-column:1 / -1 }
.px-field label{ font-size:13px; color:var(--bf-cinza); font-weight:700 }
.px-input{ padding:12px 14px; border-radius:10px; border:1px solid var(--bf-borda); background:#fff; font-size:15px; outline:none }
.px-input:focus{ box-shadow:0 0 0 4px rgba(0,120,200,.06); border-color:var(--bf-azul) }

/* Card preview */
.px-card-preview{
  width:100%;
  max-width:420px;
  height:210px;
  border-radius:14px;
  padding:18px;
  background:linear-gradient(135deg,var(--bf-azul),var(--bf-verde));
  color:#fff;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  box-shadow:0 12px 30px rgba(0,0,0,.12);
  transition:transform .18s;
}
.px-card-preview.small{ height:160px; padding:14px }
.px-card-chip{ width:44px; height:30px; background:rgba(255,255,255,.18); border-radius:6px; }
.px-card-number{ font-size:20px; letter-spacing:2px; font-weight:700 }
.px-card-name{ text-transform:uppercase; font-size:13px; margin-top:6px }
.px-card-row{ display:flex; justify-content:space-between; align-items:center; gap:10px }

/* Actions */
.px-actions{ display:flex; gap:10px; margin-top:6px; flex-wrap:wrap }
.px-btn{ display:inline-flex; align-items:center; gap:8px; justify-content:center;
  padding:12px 16px; border-radius:999px; border:none; background:linear-gradient(90deg,var(--bf-verde),var(--bf-azul));
  color:#fff; font-weight:700; cursor:pointer; box-shadow:0 8px 18px rgba(0,179,126,.28); }
.px-btn.ghost{ background:#fff; color:var(--bf-texto); border:1px solid var(--bf-borda); box-shadow:none }
.px-btn:disabled{ opacity:.6; cursor:not-allowed; transform:none }

/* Small hint and errors */
.px-hint{ font-size:13px; color:var(--bf-cinza) }
.px-error{ color:var(--bf-danger); font-weight:700; font-size:13px }

/* SUMMARY (aside) */
.px-aside{ position:sticky; top:24px; align-self:start }
.px-summary{ display:flex; flex-direction:column; gap:14px; padding:18px; border-radius:14px }
.px-summary .title{ font-weight:800; font-size:16px }
.px-summary-top{ display:flex; gap:12px; align-items:center }
.px-summary-img{ width:72px; height:72px; object-fit:cover; border-radius:8px; border:1px solid var(--bf-borda) }
.px-summary-info{ flex:1; display:flex; flex-direction:column; gap:6px }
.px-line{ display:flex; justify-content:space-between; color:var(--bf-cinza); font-size:14px }
.px-line.total{ font-weight:900; color:var(--bf-texto); font-size:18px }

/* Success overlay */
.px-success{
  display:none;
  position:fixed; inset:0; align-items:center; justify-content:center;
  background:rgba(0,0,0,.45); z-index:99999;
}
.px-success .box{ background:#fff; padding:20px; border-radius:12px; text-align:center; min-width:280px }
.px-success.show{ display:flex }

/* Input helper badges */
.badge{
  display:inline-flex; align-items:center; gap:6px; background:#fff; padding:6px 8px; border-radius:999px; font-weight:700; border:1px solid rgba(255,255,255,.12)
}
.card-brand{ font-weight:800; font-size:14px; text-transform:uppercase }

/* RESPONSIVE ADJUSTMENTS: mobile first improvements */
@media (max-width:980px){
  body{ padding:12px; } /* reduce page padding on mobile */
  .px-checkout-wrap{ grid-template-columns:1fr; padding-bottom:20px; max-width:100%; gap:12px }
  /* make the main card occupy full width of viewport (edge-to-edge feel) */
  .px-card{
    width:100%;
    max-width:100%;
    border-radius:8px;
    padding:16px;
  }
  /* Pull preview above form on mobile */
  .px-pull-preview-mobile{
    order: -1;
    margin-bottom:10px;
  }
  .px-card-preview{ max-width:100%; height:203px; padding:14px }
  .px-grid{ grid-template-columns:1fr }
  .px-aside{ position:relative; top:auto; margin-top:10px }
  .px-qr{ margin:0 auto; }

  /* Buttons become full-width stacks where appropriate */
  .px-actions{ flex-direction:column; gap:10px; align-items:stretch; }
  .px-actions .px-btn, .px-actions .px-btn.ghost{ width:100%; border-radius:12px; padding:12px; }
}

/* small tweaks to ensure the card scales nicely on very small screens */
@media (max-width:420px){
  .px-card-preview{ height:203px; padding:12px }
  .px-card-number{ font-size:18px }
  .px-card-name{ font-size:12px }
}

/* minor utility */
.muted { color:var(--bf-cinza); font-size:13px; }
.small { font-size:12px; color:var(--bf-cinza); }

.card-brand img {
  height: 28px;
  width: auto;
  object-fit: contain;
}

