:root {
  --page-bg: #f4f2ef;
  --card: #ffffff;
  --soft: #f5f3f0;
  --text: #111111;
  --muted: #5e5a55;
  --border: #bfbab4;
  --green: #00a63c;
  --green-hover: #008f34;
  --pix: #32bcad;
  --qr-placeholder: #c7c3bd;
  --danger: #b42318;
}

* { box-sizing: border-box; }

html { background: var(--page-bg); }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--page-bg);
  font-size: 14px;
}

button, input, textarea { font: inherit; }

.page-shell {
  width: min(100%, 640px);
  margin: 18px auto 0;
}

.checkout-card {
  background: var(--card);
  border: 1px solid #dedad5;
  border-radius: 16px 16px 24px 24px;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(0,0,0,.02);
}

.topbar {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  background: #f2f0ed;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13px;
}

.hotmart-brand svg {
  display: block;
  width: 73px;
  height: 21px;
}

.country {
  font-size: 10px;
  display: flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}
.country strong { font-size: 11px; }

.checkout-content { padding: 36px 24px 26px; }

.product-summary {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 16px;
  align-items: start;
  margin-bottom: 28px;
}

.product-cover {
  width: 72px;
  height: 72px;
  object-fit: cover;
}

.product-info h1 {
  margin: -3px 0 2px;
  font: 700 16px/1.15 Georgia, 'Times New Roman', serif;
}

.author { margin: 0 0 4px; color: #333; font: 12px/1.2 Georgia, 'Times New Roman', serif; }
.price { font: 700 19px/1.05 Georgia, 'Times New Roman', serif; margin: 0 0 2px; }
.payment-note { margin: 0 0 8px; font: 12px/1.2 Georgia, 'Times New Roman', serif; }
.description { margin: 0; max-width: 475px; color: #5f5b56; font-size: 12px; line-height: 1.28; }

h2 {
  margin: 0 0 10px;
  font: 700 16px/1.2 Georgia, 'Times New Roman', serif;
}

.form-section label,
.modal-card label {
  display: block;
  margin: 12px 0 8px;
  font-weight: 700;
  font-size: 13px;
}

input, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  color: #222;
  outline: none;
}

input {
  height: 37px;
  padding: 0 12px;
}

input:focus, textarea:focus { border-color: #6f6a64; box-shadow: 0 0 0 2px rgba(0,0,0,.04); }

.two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.phone-field {
  display: grid;
  grid-template-columns: 92px 1fr;
}

.phone-prefix {
  height: 37px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-right: 0;
  border-radius: 4px 0 0 4px;
  font-size: 11px;
  white-space: nowrap;
}

.phone-field input { border-radius: 0 4px 4px 0; }

.payment-section { margin-top: 32px; }

.payment-box {
  border: 1px solid #111;
  border-radius: 8px;
  overflow: hidden;
}

.payment-header {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  background: white;
}

.radio-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #111;
  position: relative;
}
.radio-dot::after {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: white;
  position: absolute;
  inset: 0;
  margin: auto;
}
.pix-icon { flex: 0 0 23px; }

.payment-body {
  background: var(--soft);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 22px;
  padding: 30px 16px 32px;
  align-items: center;
}

.payment-actions { padding-left: 0; }

.manual-release {
  min-height: 38px;
  margin: 0 0 24px;
  display: flex;
  gap: 12px;
  align-items: center;
  font: 600 11px/1.4 Arial, sans-serif;
}

.manual-release > span {
  font-size: 20px;
  font-weight: 400;
  color: #88847e;
}

.primary-button, .secondary-button {
  width: 100%;
  min-height: 38px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
  transition: .15s ease;
}

.primary-button {
  border: 1px solid var(--green);
  background: var(--green);
  color: #fff;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
}

.primary-button:hover { background: var(--green-hover); border-color: var(--green-hover); }
.primary-button:disabled { opacity: .65; cursor: wait; }

.secondary-button {
  margin-top: 14px;
  border: 1px solid var(--green);
  background: transparent;
  color: #007f2d;
}

.secondary-button:disabled {
  color: #8b8781;
  border-color: #c8c4be;
  cursor: not-allowed;
}

.button-qr-icon { width: 18px; height: 20px; }

.qr-preview {
  min-height: 190px;
  display: grid;
  place-items: center;
}

.qr-placeholder {
  width: 150px;
  height: 172px;
  color: var(--qr-placeholder);
}

.qr-image { width: 170px; height: 170px; object-fit: contain; background: white; }
.hidden { display: none !important; }

.form-message {
  min-height: 17px;
  margin-top: 10px;
  font-size: 12px;
}
.form-message.error { color: var(--danger); }
.form-message.success { color: #067a2f; }

.purchase-details { margin-top: 22px; }
.detail-row {
  min-height: 36px;
  border: 1px solid #ddd8d2;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 10px;
  font: 700 12px/1.2 Arial, sans-serif;
}
.secure-footer {
  text-align: center;
  color: #7c7770;
  font-size: 11px;
  padding: 26px 10px 2px;
}
.protected-by {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.protected-by svg {
  width: 71px;
  height: 20px;
  display: block;
}

.legal-footer {
  background: #0c0c0c;
  color: #f3f3f3;
  padding: 22px 22px 28px;
  font-size: 10px;
  line-height: 1.45;
}
.legal-footer p { margin: 0 0 8px; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.62); }

.modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 430px);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  background: white;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 20px 70px rgba(0,0,0,.28);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #4d4944;
}

.modal-card h2 { font-size: 20px; text-align: center; margin-top: 2px; }
.modal-subtitle { text-align: center; color: var(--muted); margin: 0 20px 14px; font-size: 13px; }
.modal-qr { display: block; width: 230px; height: 230px; object-fit: contain; margin: 0 auto 12px; }
.modal-card textarea { resize: none; padding: 10px; line-height: 1.3; font-size: 12px; }
.modal-card .primary-button { margin-top: 14px; }
.manual-modal-note { margin: 14px 0 0; color: #6c6761; font-size: 11px; text-align: center; }

@media (max-width: 680px) {
  .page-shell { width: 100%; margin: 0; }
  .checkout-card { border-left: 0; border-right: 0; border-top: 0; border-radius: 0 0 22px 22px; }
  .checkout-content { padding: 28px 18px 24px; }
  .topbar { padding: 0 18px; }
}

@media (max-width: 520px) {
  .product-summary { grid-template-columns: 72px 1fr; gap: 13px; }
  .description { grid-column: 1 / -1; margin-top: 2px; }
  .two-columns { grid-template-columns: 1fr; gap: 0; }
  .payment-body { grid-template-columns: 1fr; gap: 8px; padding: 24px 15px; }
  .qr-preview { min-height: 160px; order: -1; }
  .qr-placeholder { width: 132px; height: 151px; }
  .qr-image { width: 155px; height: 155px; }
  .manual-release { margin-top: 4px; margin-bottom: 18px; }
  .legal-footer { padding-left: 18px; padding-right: 18px; }
}
