html, body {
  max-width: 100vw;
  overflow-x: hidden;
}
body {
  background: #f5f5f5;
  margin: 0;
  padding: 0;
  font-family: 'Inter', Arial, sans-serif;
  color: #222;
}

.checkout-wrapper {
  max-width: 100vw;
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
  background: #fff;
  min-height: 100vh;
  box-shadow: 0 2px 24px #0001;
  border-right: 1px solid #ededed;
  border-left: 1px solid #ededed;
  display: flex;
  flex-direction: column;
}
.ch-logo {
  width: 90px;
  margin: 34px 0 18px 22px;
}

.stepbar {
  width: 100%;
  padding: 22px 22px 14px 22px;
  background: #ffffff;
  border-bottom: 1px solid #ededed;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}
.steps,
.step-labels {
  width: 100%;
  max-width: 340px;
  margin-left: auto;
  margin-right: auto;
}

.steps {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.step {
  display: flex;
  align-items: center;
  gap: 5px;
}
.step-circle {
  width: 26px;
  height: 26px;
  background: #bbb;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 600;
  border: 2px solid #bbb;
  transition: background .2s, border .2s;
}
.step.active .step-circle {
  background: #3483fa;
  border: 2px solid #3483fa;
  color: #fff;
}
.step.done .step-circle {
  background: #00a650;
  border: 2px solid #00a650;
  color: #fff;
}
.step-bar {
  height: 2px;
  width: 46px;
  background: #ededed;
  margin: 0 4px;
  border-radius: 2px;
}
.step.active ~ .step-bar,
.step.done ~ .step-bar {
  background: #3483fa;
}
.step-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0;
  font-size: .94rem;
  color: #666;
  font-weight: 500;
}
.step-labels span.active {
  color: #3483fa;
  font-weight: 700;
}

.checkout-form {
  padding: 24px 18px 12px 18px;
  flex: 1 1 auto;
  min-height: 410px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background: #fff;
  border-radius: 10px;
}
.step-num-title {
  font-size: 1.15rem;
  font-weight: bold;
  color: #222;
  margin-bottom: 7px;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.step-num-title span {
  display: inline-block;
  width: 24px;
  height: 24px;
  background: #3483fa;
  border-radius: 50%;
  color: #fff;
  font-weight: 600;
  text-align: center;
  line-height: 24px;
  font-size: 1.05rem;
  margin-right: 4px;
}
.step-desc {
  color: #888;
  font-size: .98rem;
  margin-bottom: 22px;
  margin-top: 0;
  line-height: 1.37;
}
.form-label {
  font-size: .96rem;
  font-weight: 600;
  color: #222;
  margin-bottom: 4px;
  margin-top: 16px;
  display: block;
}
.form-field {
  width: 100%;
  padding: 14px 14px;
  font-size: 1.02rem;
  border-radius: 11px;
  border: 1.4px solid #ddd;
  background: #fafafd;
  color: #222;
  margin-bottom: 10px;
  outline: none;
  box-sizing: border-box;
  font-family: inherit;
  transition: border .16s, background .15s;
}
.form-field:focus {
  border: 1.7px solid #3483fa;
  background: #fff;
}
.form-field.error {
  border: 1.7px solid #e10000;
  background: #fff4f4;
}

.cpf-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.cpf-row .form-field {
  flex: 1;
  margin-bottom: 0;
}

.cell-row {
  display: flex;
  gap: 0;
  align-items: center;
  margin-bottom: 12px;
}
.cell-ddi {
  background: #f2f2f2;
  color: #888;
  font-weight: 600;
  border-radius: 11px 0 0 11px;
  border: 1.4px solid #ddd;
  border-right: none;
  width: 44px;
  padding: 14px 0;
  font-size: 1.05rem;
  text-align: center;
  outline: none;
}
.cell-input {
  border-radius: 0 11px 11px 0;
  border-left: none;
  margin-bottom: 0;
  flex: 1;
}

.checkout-btn {
  width: 100%;
  background: #3483fa;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 16px 0;
  font-size: 1.06rem;
  font-weight: bold;
  letter-spacing: 0.01em;
  margin-top: 18px;
  cursor: pointer;
  transition: background .17s;
  box-shadow: 0 2px 12px #3483fa22;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.checkout-btn:hover, .checkout-btn:focus {
  background: #2968c8;
  color: #fff;
}
.checkout-btn svg {
  width: 21px;
  height: 21px;
  margin-left: 3px;
  fill: #fff;
  transition: fill .13s;
}

.err-msg {
  color: #e10000;
  font-size: .97rem;
  margin-top: 8px;
  margin-bottom: 0;
  text-align: left;
  display: none;
}
.err-msg.active { display: block; }

.hidden { display: none !important; }

@media (min-width: 540px) {
  .checkout-wrapper { border-radius: 18px; margin: 32px auto; max-width: 390px; }
  .stepbar, .step-labels { width: 80%; }
}
@media (max-width: 420px) {
  .checkout-wrapper { border-radius: 0; }
  .stepbar, .step-labels { width: 99vw; }
}

.shipping-options {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 10px 0 0 0;
}
.shipping-option {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1.7px solid #bbb;
  border-radius: 8px;
  padding: 13px 12px 13px 12px;
  margin-bottom: 0;
  cursor: pointer;
  transition: border .15s, box-shadow .18s;
  position: relative;
  user-select: none;
  box-shadow: 0 1px 8px #0000;
}
.shipping-option.selected,
.shipping-option:has(input:checked) {
  border: 2px solid #3483fa;
  box-shadow: 0 2px 8px #3483fa10;
  background: #eaf1fb;
}
.shipping-option input[type="radio"] {
  margin-right: 14px;
  accent-color: #3483fa;
  width: 19px;
  height: 19px;
}
.shipping-main {
  flex: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  font-size: 1.01rem;
}
.shipping-sub {
  font-size: .92rem;
  color: #666;
  font-weight: 400;
}
.shipping-price {
  min-width: 54px;
  text-align: right;
  font-size: 1.01rem;
  font-weight: 600;
  color: #222;
  margin-left: 18px;
}
.shipping-price.verde {
  color: #00a650;
}

.checkout-btn:disabled,
.checkout-btn[disabled] {
  background: #b5b5b5 !important;
  color: #fff !important;
  cursor: not-allowed !important;
  opacity: 0.85;
  box-shadow: none;
}

.payment-methods {
  margin: 0 0 10px 0;
}
.pm-label {
  display: block;
  background: #fff;
  border: 1.7px solid #bbb;
  border-radius: 8px;
  padding: 16px 14px 6px 14px;
  margin-bottom: 0;
  cursor: pointer;
  position: relative;
  margin-top: 0;
  transition: border .18s, box-shadow .18s;
}
.pm-label input[type="radio"] {
  accent-color: #3483fa;
  width: 19px;
  height: 19px;
  margin-right: 8px;
  vertical-align: middle;
}
.pm-label .pm-title {
  font-weight: 600;
  font-size: 16.5px;
  color: #222;
  margin-right: 12px;
}
.pm-flags {
  height: 18px;
  margin-left: 18px;
  margin-bottom: 3px;
  vertical-align: middle;
  transition: opacity .18s;
}
.pm-card-fields,
.pm-pix-fields {
  margin: 11px 0 2px 0;
  padding-bottom: 6px;
  transition: all .15s;
}
.pm-card-row {
  display: flex;
  gap: 7px;
  margin: 5px 0 10px 0;
}
.pix-discount {
  display: inline-block;
  background: #00a650;
  color: #fff;
  font-size: 10.5px;
  border-radius: 4px;
  padding: 1px 6px;
  margin-right: 7px;
  position: relative;
  top: -3px;
}
.pay-btn {
  width: 100%;
  font-size: 17px;
  padding: 11px 0 9px 0;
  border-radius: 7px;
  border: none;
  margin-bottom: 0;
  margin-top: 6px;
  transition: filter .15s;
  background: #3483fa;
  color: #fff;
}
.pay-btn:active { filter: brightness(.92);}
.pm-pix-fields { margin-top: 13px; }
.pm-pix-fields .pix-infos { margin-bottom: 5px; }

.pm-label.selected,
.pm-label:has(input:checked) {
  border: 2px solid #3483fa;
  box-shadow: 0 2px 8px #3483fa10;
  background: #eaf1fb;
}
.pm-label:not(.selected):not(:has(input:checked)) {
  opacity: .93;
}
.pm-label .form-field { margin-bottom:8px; }
.pm-label:not(.selected) .pm-flags,
.pm-label:not(:has(input:checked)) .pm-flags {
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
}
.pm-label.selected .pm-flags,
.pm-label:has(input:checked) .pm-flags {
  opacity: 1;
}

@media (min-width: 900px) {
  body {
    background: #f5f5f5;
  }
  .checkout-wrapper {
    max-width: 700px;
    min-width: 480px;
    margin: 38px auto 38px auto;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 2px 32px #0002, 0 1.5px 0 #ededed;
    padding: 42px 54px 36px 54px;
    border-left: none;
    border-right: none;
    display: block;
  }
  .ch-logo {
    width: 110px;
    margin: 0 0 32px 0;
    display: block;
  }
  .stepbar {
    width: 100%;
    padding: 32px 0 18px 0;
    border-radius: 13px 13px 0 0;
    margin-bottom: 24px;
  }
  .checkout-form {
    padding: 24px 12px 12px 12px;
    max-width: 570px;
    margin: 0 auto;
    font-size: 1.07rem;
  }
  .form-label {
    font-size: 1.09rem;
  }
  .form-field {
    padding: 18px 16px;
    font-size: 1.1rem;
    border-radius: 13px;
  }
  .checkout-btn, .pay-btn {
    font-size: 1.13rem;
    padding: 17px 0 13px 0;
    border-radius: 10px;
  }
  .payment-methods, .shipping-options {
    font-size: 1.03rem;
  }
  .pm-label, .shipping-option {
    padding: 18px 18px 10px 18px;
    font-size: 1.07rem;
  }
  .pm-card-fields, .pm-pix-fields {
    font-size: 1.07rem;
    margin: 16px 0 2px 0;
  }
}

@media (min-width: 1300px) {
  .checkout-wrapper {
    max-width: 850px;
    padding: 54px 90px 40px 90px;
  }
  .checkout-form {
    max-width: 700px;
  }
}

#payment-loading-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.88);
  z-index: 30;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity .25s;
}
#payment-loading-content {
  text-align: center;
}
#payment-loading-icon.spinner {
  width: 54px; height: 54px;
  margin: 0 auto 18px auto;
  border: 5px solid #3483fa44;
  border-top: 5px solid #3483fa;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  100% { transform: rotate(360deg);}
}
#payment-loading-icon.error {
  border: none;
  width: 54px; height: 54px;
  margin: 0 auto 18px auto;
  color: #e10000;
  font-size: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#payment-loading-icon.success {
  border: none;
  width: 54px; height: 54px;
  margin: 0 auto 18px auto;
  color: #00a650;
  font-size: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#payment-loading-text {
  font-size: 1.15rem;
  color: #252525;
}
#payment-loading-overlay.hidden {
  display: none;
}

.card-btn:disabled {
  background: #b5b5b5 !important;
  color: #fff !important;
  cursor: not-allowed !important;
  opacity: 0.85;
  box-shadow: none;
}

#pix-area {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px #0001;
  padding: 28px 18px 24px 18px;
  margin: 22px 0;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}
.pix-title {
  text-align:center;
  margin:0 0 14px 0;
  font-size: 1.2rem;
  color: #00a650;
}
#pix-qrcode {
  width: 100%;
  max-width: 200px;
  margin-left: auto;
  margin-right: auto;
  display: block;
}
input, button, select, textarea {
  max-width: 100%;
  box-sizing: border-box;
}
img, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 480px) {
  #pix-area {
    padding: 20px 5vw 18px 5vw;
    max-width: 90vw;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 420px) {
  .stepbar, .step-labels { width: 99vw; }
}

@media (max-width: 480px) {
  #step3.checkout-form {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .step-num-title,
  .step-desc {
    padding-left: 18px;
    padding-right: 18px;
  }
  #pix-area {
    padding: 20px 18px 18px 18px;
    max-width: 98vw;
    margin-left: auto;
    margin-right: auto;
  }
}
