/* Reset e base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Roboto', sans-serif;
  font-size: 16px;
  line-height: 24px;
  color: #212529;
  background-color: #f5f5f5;
  padding-bottom: 48px;
}

/* ─── Barra de countdown ─────────────────────────────────────────────────────── */
#countdown-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background-color: #fa0000;
  color: #fff;
  text-align: center;
  padding: 10px 16px;
  font-size: 16px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
#countdown-bar strong { font-weight: 700; }

/* ─── Barra do produto ───────────────────────────────────────────────────────── */
#product-bar {
  background: #fff;
  border-bottom: 1px solid #e9ecef;
  margin-top: 46px;
}
#product-bar .inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 10px 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}
#product-bar .label {
  font-size: 11px;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
#product-bar .name {
  font-size: 14px;
  color: #212529;
  font-weight: 500;
}

/* ─── Hero banner ────────────────────────────────────────────────────────────── */
#hero {
  max-width: 1140px;
  margin: 0 auto;
  padding: 16px 15px 0;
}
#hero img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

/* ─── Layout principal ───────────────────────────────────────────────────────── */
#main-content {
  max-width: 1140px;
  margin: 24px auto 0;
  padding: 0 15px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}

/* ─── Seções do formulário ───────────────────────────────────────────────────── */
.form-section {
  background: #fff;
  border-radius: 4px;
  margin-bottom: 16px;
  overflow: hidden;
}
.form-section-header {
  padding: 12px 16px;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  align-items: center;
  gap: 10px;
}
.step-badge {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #7dd063;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.form-section-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #212529;
}
.form-section-body { padding: 16px; }

/* ─── Campos ─────────────────────────────────────────────────────────────────── */
.field-group { margin-bottom: 12px; }
.field-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #212529;
  margin-bottom: 4px;
}
.field-group input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d5d5d5;
  border-radius: 4px;
  font-size: 16px;
  color: #495057;
  background: #fff;
  outline: none;
  font-family: inherit;
  line-height: 24px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field-group input:focus {
  border-color: #7dd063;
  box-shadow: 0 0 0 2px rgba(125, 208, 99, 0.2);
}
.field-group input::placeholder { color: #adb5bd; }

/* ─── PIX tab ────────────────────────────────────────────────────────────────── */
.pix-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 2px solid #7dd063;
  border-radius: 4px;
  padding: 8px 20px;
  margin-bottom: 20px;
  background: #f8fff6;
  font-size: 14px;
  color: #7dd063;
  font-weight: 600;
}

/* ─── Benefícios PIX ─────────────────────────────────────────────────────────── */
.pix-benefits { margin-bottom: 20px; }
.pix-benefit {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 15px;
  color: #212529;
}
.pix-benefit:last-child { border-bottom: none; }
.pix-benefit .num { color: #7dd063; font-weight: 700; flex-shrink: 0; }

/* ─── Botão finalizar ────────────────────────────────────────────────────────── */
#btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: #71c358;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 13px 16px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 3.2px 0 0 #57ab3d;
  margin-top: 16px;
  font-family: inherit;
  transition: background-color 0.2s, opacity 0.2s;
}
#btn-submit:hover { background: #65b34e; }
#btn-submit:disabled { background: #a0d48a; box-shadow: none; cursor: not-allowed; }

.security-text {
  margin-top: 10px;
  text-align: center;
  font-size: 13px;
  color: #71c358;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.digital-text {
  margin-top: 8px;
  text-align: center;
  font-size: 13px;
  color: #6c757d;
}

/* ─── Resumo da compra ───────────────────────────────────────────────────────── */
#order-summary {
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
  position: sticky;
  top: 70px;
}
#order-summary .summary-header {
  padding: 10px 16px;
  background: #e9ecef;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #212529;
}
#order-summary .summary-body { padding: 16px; }
.summary-product {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.summary-product img {
  width: 72px; height: 72px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #e9ecef;
  flex-shrink: 0;
}
.summary-product .info .product-name { font-weight: 700; font-size: 15px; color: #212529; }
.summary-product .info .product-sub  { font-size: 13px; color: #6c757d; margin-top: 4px; }
.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #212529;
  margin-bottom: 12px;
}
.summary-divider { border: none; border-top: 1px solid #e9ecef; margin: 12px 0; }
.summary-total {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 700;
  color: #212529;
}

/* ─── Área do QR Code ────────────────────────────────────────────────────────── */
#pix-area { display: none; text-align: center; }
#pix-area.visible { display: block; }
#qrcode-img {
  border: 2px solid #7dd063;
  border-radius: 8px;
  padding: 12px;
  display: inline-block;
  margin-bottom: 16px;
  background: #fff;
}
#qrcode-img img { display: block; }
.pix-code-box {
  background: #f8f9fa;
  border: 1px solid #d5d5d5;
  border-radius: 4px;
  padding: 10px 12px;
  font-size: 11px;
  word-break: break-all;
  color: #495057;
  margin-bottom: 12px;
  text-align: left;
  max-height: 80px;
  overflow: auto;
}
#btn-copy {
  width: 100%;
  background: #71c358;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 10px 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 3.2px 0 0 #57ab3d;
  font-family: inherit;
  transition: background-color 0.2s;
}
#btn-copy:hover { background: #65b34e; }
.pix-waiting {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #888;
  font-size: 13px;
}
.pix-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #ffc107;
  animation: pulse 1.5s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ─── Mensagem de erro ───────────────────────────────────────────────────────── */
#error-msg {
  display: none;
  background: #fff5f5;
  border: 1px solid #fa0000;
  border-radius: 4px;
  padding: 12px 16px;
  color: #fa0000;
  font-size: 14px;
  margin-bottom: 16px;
}
#error-msg.visible { display: block; }

/* ─── Pagamento confirmado ───────────────────────────────────────────────────── */
#success-area {
  display: none;
  text-align: center;
  padding: 32px 24px;
  background: #f0fff0;
  border-radius: 8px;
  border: 2px solid #71c358;
}
#success-area.visible { display: block; }
#success-area .check { font-size: 56px; margin-bottom: 16px; }
#success-area h2 { color: #40a020; font-size: 22px; font-weight: 700; margin-bottom: 12px; }
#success-area p  { color: #555; font-size: 16px; }

/* ─── Footer ─────────────────────────────────────────────────────────────────── */
#footer-wrap {
  max-width: 1140px;
  margin: 32px auto 0;
  padding: 0 15px;
}
.footer-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid #e9ecef;
}
.footer-support .label { font-size: 11px; color: #6c757d; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.footer-support a { color: #212529; text-decoration: none; font-size: 14px; }
.secure-badge {
  background: #71c358;
  color: #fff;
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.footer-legal {
  text-align: center;
  font-size: 12px;
  color: #6c757d;
  padding-top: 16px;
  border-top: 1px solid #e9ecef;
  line-height: 20px;
}
.footer-legal a { color: #0078d7; }
.footer-legal .small { font-size: 11px; color: #aaa; margin-top: 6px; }

/* ─── Spinner ────────────────────────────────────────────────────────────────── */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Responsivo ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  #main-content {
    grid-template-columns: 1fr;
  }
  #order-summary {
    position: static;
    order: -1;
  }
  .footer-main {
    flex-direction: column;
    align-items: flex-start;
  }
}
