:root {
  --page: #eef0f4;
  --panel: #ffffff;
  --ink: #333846;
  --muted: #747b88;
  --line: #d7d9df;
  --line-strong: #bcc2ce;
  --green: #19b72e;
  --green-dark: #109325;
  --blue: #0b66f0;
  --pix: #32c6a2;
  --danger: #c2410c;
  --shadow: 0 10px 28px rgba(31, 38, 52, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, Arial, sans-serif;
  color: var(--ink);
  background: var(--page);
}

button,
input,
select,
textarea {
  font: inherit;
}

.secure-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  color: #ffffff;
  background: linear-gradient(180deg, #20c83b, var(--green));
  box-shadow: 0 2px 8px rgba(10, 99, 28, 0.24);
  font-size: clamp(0.88rem, 2.8vw, 1.16rem);
  font-weight: 800;
  text-align: center;
}

.shield {
  position: relative;
  width: 22px;
  height: 24px;
  flex: 0 0 22px;
  background: #ffffff;
  clip-path: polygon(50% 0, 92% 14%, 86% 66%, 50% 100%, 14% 66%, 8% 14%);
}

.shield::after {
  content: "";
  position: absolute;
  inset: 6px 6px 7px;
  border-right: 3px solid var(--green);
  border-bottom: 3px solid var(--green);
  transform: rotate(40deg);
}

.checkout-shell {
  width: min(660px, 100%);
  margin: 0 auto;
  padding: 14px 10px 28px;
}

.brand-header {
  display: flex;
  justify-content: center;
  padding: 12px 18px 18px;
}

.brand-header img {
  display: block;
  width: min(180px, 39vw);
  height: auto;
}

.checkout-form {
  display: grid;
  gap: 18px;
}

.checkout-card {
  width: 100%;
  background: var(--panel);
  border: 1px solid #eceef3;
  box-shadow: var(--shadow);
}

.identify-card {
  padding: clamp(18px, 4vw, 26px);
}

.payment-card {
  padding: clamp(18px, 4vw, 24px);
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid #eef0f3;
}

.section-heading--payment {
  align-items: flex-start;
  margin-bottom: 22px;
  border-bottom: 0;
  padding-bottom: 0;
}

.step-number {
  width: 39px;
  height: 39px;
  flex: 0 0 39px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--blue);
  border-radius: 50%;
  font-size: 1.15rem;
  font-weight: 800;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  margin-bottom: 0;
  color: #4b5261;
  font-size: clamp(1.2rem, 4vw, 1.42rem);
  line-height: 1.25;
}

.section-heading p {
  margin: 6px 0 0;
  color: #6c7481;
  font-size: clamp(0.95rem, 3.5vw, 1.05rem);
  line-height: 1.35;
}

.field-stack,
.purchase-summary {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: #5e6572;
  font-size: clamp(0.93rem, 3vw, 1.02rem);
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 55px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--ink);
  padding: 14px 13px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #9aa0aa;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(11, 102, 240, 0.12);
}

input[readonly] {
  color: #5c6574;
  background: #f4f6f9;
}

.error-message {
  display: none;
  color: var(--danger);
  font-weight: 700;
}

.field.invalid input,
.field.invalid textarea {
  border-color: var(--danger);
}

.field.invalid .error-message {
  display: block;
}

.payment-method {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 26px 10px 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.approval {
  color: #72813f;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.selected-check {
  position: absolute;
  top: 20px;
  right: 12px;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--blue);
}

.selected-check::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 5px;
  width: 6px;
  height: 11px;
  border-right: 3px solid #ffffff;
  border-bottom: 3px solid #ffffff;
  transform: rotate(45deg);
}

.payment-method h3 {
  margin-bottom: 0;
  color: #565d6b;
  font-size: 1.06rem;
  font-weight: 600;
}

.pix-option {
  min-height: 82px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border: 2px solid #aeb8cb;
  border-radius: 6px;
  color: #556071;
  background: #f8fbff;
  font-weight: 600;
}

.pix-mark {
  position: relative;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: block;
}

.pix-mark i {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: var(--pix);
  transform: rotate(45deg);
}

.pix-mark i:nth-child(1) {
  left: 11px;
  top: 0;
}

.pix-mark i:nth-child(2) {
  right: 0;
  top: 11px;
}

.pix-mark i:nth-child(3) {
  left: 11px;
  bottom: 0;
}

.pix-mark i:nth-child(4) {
  left: 0;
  top: 11px;
}

.cpf-field {
  margin-top: 4px;
}

.purchase-summary {
  padding-top: 12px;
}

.purchase-summary h3 {
  margin: 0 0 2px;
  color: #424a58;
  font-size: clamp(1.05rem, 3.8vw, 1.18rem);
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 52px;
  border: 0;
  border-radius: 5px;
  padding: 0 18px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  width: 100%;
  color: #ffffff;
  background: #111827;
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.22);
}

.primary-button:hover {
  background: #000000;
}

.primary-button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.pix-result {
  margin-top: 18px;
  padding: clamp(18px, 4vw, 24px);
}

.pix-result[hidden] {
  display: none;
}

.pix-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.pix-header h2 {
  font-size: 1.2rem;
}

.amount-pill {
  white-space: nowrap;
  padding: 8px 10px;
  border-radius: 999px;
  background: #eaf8ee;
  color: var(--green-dark);
  font-weight: 800;
}

.qr-box {
  min-height: 184px;
  margin-bottom: 18px;
  padding: 14px;
  display: grid;
  place-items: center;
  border: 1px dashed #aab6c5;
  border-radius: 4px;
  background: #ffffff;
}

.qr-box img {
  width: min(220px, 100%);
  height: auto;
  display: block;
}

.qr-unavailable {
  width: min(154px, 70vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 16px;
  color: #596273;
  text-align: center;
  background: #f7f9fc;
  border: 1px solid #d9dee8;
  border-radius: 6px;
}

.qr-unavailable span {
  font-weight: 800;
}

.qr-unavailable small {
  line-height: 1.35;
}

.result-actions {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.secondary-button {
  color: #ffffff;
  background: #252b38;
}

.ghost-button {
  color: var(--green-dark);
  background: #eaf8ee;
}

.helper-text {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.admin-shell {
  padding-top: 14px;
}

.admin-card {
  padding: clamp(18px, 4vw, 26px);
}

.admin-feedback {
  min-height: 24px;
  font-weight: 700;
}

.admin-link {
  display: inline-flex;
  margin-top: 14px;
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.admin-link:hover {
  text-decoration: underline;
}

@media (min-width: 700px) {
  .checkout-shell {
    padding: 20px 16px 40px;
  }

  .checkout-card {
    border-radius: 2px;
  }

  .payment-method {
    padding-inline: 18px;
  }
}

@media (max-width: 430px) {
  .checkout-shell {
    padding-inline: 8px;
  }

  .brand-header {
    padding: 8px 18px 14px;
  }

  .brand-header img {
    width: min(130px, 38vw);
  }

  .identify-card,
  .payment-card,
  .pix-result {
    padding-inline: 14px;
  }

  .section-heading {
    gap: 10px;
  }

  .step-number {
    width: 37px;
    height: 37px;
    flex-basis: 37px;
  }

  .payment-method {
    padding-inline: 8px;
  }

  .pix-option {
    min-height: 78px;
    padding-inline: 14px;
  }

  .result-actions,
  .pix-header {
    grid-template-columns: 1fr;
    display: grid;
  }
}
