:root {
  --green: #00895f;
  --green-dark: #006e4c;
  --green-deep: #07553f;
  --green-soft: #e8f5ef;
  --gold: #f2d273;
  --ink: #15221c;
  --muted: #68736d;
  --line: #e5e9e7;
  --surface: #ffffff;
  --page: #f4f7f5;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--page);
  color: var(--ink);
  font-family: Poppins, Arial, sans-serif;
}

body {
  margin: 0;
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.pix-header {
  background: var(--green);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  position: sticky;
  top: 0;
  z-index: 20;
}

.pix-header-inner {
  align-items: center;
  display: flex;
  height: 74px;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1180px;
  padding: 0 24px;
}

.brand {
  align-items: center;
  display: inline-flex;
  height: 52px;
  overflow: hidden;
}

.brand img {
  height: 64px;
  object-fit: contain;
  width: auto;
}

.secure-label {
  align-items: center;
  color: #fff;
  display: flex;
  font-size: 0.85rem;
  font-weight: 600;
  gap: 8px;
}

.secure-label svg {
  fill: currentColor;
  height: 20px;
  width: 20px;
}

.pix-shell {
  align-items: start;
  display: grid;
  gap: clamp(32px, 5vw, 70px);
  grid-template-columns: minmax(340px, 500px) minmax(420px, 560px);
  justify-content: center;
  margin: 0 auto;
  max-width: 1180px;
  padding: 42px 24px 70px;
}

.product-column {
  position: sticky;
  top: 110px;
}

.course-visual {
  aspect-ratio: 1;
  border-radius: 34px;
  box-shadow: 0 22px 58px rgba(4, 67, 47, 0.18);
  isolation: isolate;
  overflow: hidden;
  position: relative;
}

.course-visual > img {
  height: 100%;
  inset: 0;
  object-fit: cover;
  position: absolute;
  width: 100%;
  z-index: -2;
}

.course-gradient {
  background: linear-gradient(180deg, transparent 50%, rgba(223, 234, 229, 0.08) 58%, rgba(224, 232, 229, 0.96) 86%);
  inset: 0;
  position: absolute;
  z-index: -1;
}

.duration-badge {
  background: rgba(241, 247, 244, 0.88);
  border-radius: 999px;
  color: #152b23;
  font-size: clamp(0.82rem, 1.5vw, 1.05rem);
  font-weight: 800;
  padding: 12px 24px;
  position: absolute;
  right: 26px;
  top: 26px;
}

.course-visual h1 {
  bottom: 25px;
  color: #006246;
  font-size: clamp(1.35rem, 2.6vw, 2rem);
  font-weight: 900;
  left: 24px;
  line-height: 1.18;
  margin: 0;
  position: absolute;
  right: 24px;
  text-align: center;
}

.product-highlight {
  align-items: center;
  background: var(--surface);
  border: 4px solid #eef0ef;
  border-radius: 20px;
  color: #68706d;
  display: flex;
  margin-top: 28px;
  min-height: 82px;
  padding: 16px 26px;
}

.start-highlight {
  justify-content: center;
  gap: 13px;
}

.start-highlight svg {
  fill: var(--green-deep);
  height: 31px;
  width: 31px;
}

.start-highlight span {
  font-size: 1.08rem;
}

.start-highlight strong {
  color: var(--green-deep);
}

.urgency-highlight {
  flex-direction: column;
  justify-content: center;
  line-height: 1.18;
  min-height: 132px;
  text-align: center;
}

.urgency-highlight strong {
  color: var(--green);
  font-size: 1.5rem;
  font-weight: 900;
}

.urgency-highlight span {
  font-size: 1.2rem;
  margin-top: 5px;
}

.payment-column {
  min-width: 0;
}

.back-link {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 0.88rem;
  font-weight: 600;
  gap: 7px;
  margin: 2px 0 24px;
  text-decoration: none;
}

.back-link:hover {
  color: var(--green);
}

.back-link svg {
  fill: currentColor;
  height: 18px;
  width: 18px;
}

.payment-heading {
  align-items: center;
  display: grid;
  gap: 20px;
  grid-template-columns: 78px 1fr;
  margin-bottom: 26px;
}

.pix-symbol {
  align-items: center;
  background: var(--green-soft);
  border-radius: 50%;
  display: flex;
  height: 78px;
  justify-content: center;
  width: 78px;
}

.pix-symbol svg {
  fill: var(--green);
  height: 44px;
  width: 44px;
}

.eyebrow {
  color: var(--green);
  display: block;
  font-size: 0.77rem;
  font-weight: 800;
  margin-bottom: 5px;
}

.payment-heading h2 {
  font-size: clamp(1.75rem, 3.2vw, 2.55rem);
  letter-spacing: 0;
  line-height: 1.08;
  margin: 0 0 8px;
}

.payment-heading p {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.5;
  margin: 0;
}

.payment-total {
  align-items: center;
  background: var(--green);
  border-radius: 16px;
  color: #fff;
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 18px 22px;
}

.payment-total span {
  font-size: 0.9rem;
  font-weight: 500;
}

.payment-total strong {
  font-size: 1.5rem;
  font-weight: 800;
}

.identity-panel,
.pix-panel,
.loading-panel,
.error-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 12px 36px rgba(23, 58, 46, 0.08);
  padding: 26px;
}

.identity-copy h3,
.error-panel strong {
  font-size: 1.18rem;
  margin: 0 0 4px;
}

.identity-copy p,
.error-panel p {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 20px;
}

#identity-form {
  display: grid;
  gap: 15px;
  grid-template-columns: 1fr 1fr;
}

.field {
  display: block;
}

.field-wide {
  grid-column: 1 / -1;
}

.field > span {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  margin: 0 0 6px 2px;
}

.field input {
  background: #fff;
  border: 1px solid #ced7d2;
  border-radius: 10px;
  color: var(--ink);
  font-size: 1rem;
  height: 52px;
  outline: 0;
  padding: 0 14px;
  width: 100%;
}

.field input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(0, 137, 95, 0.12);
}

.field.is-invalid input {
  border-color: #d92d20;
}

.field small {
  color: #b42318;
  display: block;
  font-size: 0.72rem;
  min-height: 17px;
  padding: 3px 2px 0;
}

.primary-button,
.secondary-button {
  border: 0;
  border-radius: 11px;
  cursor: pointer;
  font-weight: 800;
  min-height: 54px;
  padding: 12px 20px;
}

.primary-button {
  background: var(--green);
  color: #fff;
}

.primary-button:hover {
  background: var(--green-dark);
}

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

.secondary-button {
  background: var(--green-soft);
  color: var(--green-dark);
}

.loading-panel {
  align-items: center;
  display: flex;
  flex-direction: column;
  min-height: 220px;
  justify-content: center;
  text-align: center;
}

.loading-panel[hidden],
.identity-panel[hidden],
.pix-panel[hidden],
.error-panel[hidden] {
  display: none;
}

.spinner {
  animation: spin 0.8s linear infinite;
  border: 4px solid #dce9e3;
  border-radius: 50%;
  border-top-color: var(--green);
  height: 44px;
  margin-bottom: 16px;
  width: 44px;
}

.loading-panel strong {
  font-size: 1.05rem;
}

.loading-panel p {
  color: var(--muted);
  font-size: 0.83rem;
  margin: 4px 0 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.qr-wrap {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex;
  height: min(310px, 72vw);
  justify-content: center;
  margin: 0 auto 22px;
  max-width: 310px;
  padding: 14px;
  width: 100%;
}

.qr-wrap img,
.qr-wrap canvas {
  display: block;
  height: 100%;
  image-rendering: pixelated;
  object-fit: contain;
  width: 100%;
}

.qr-wrap img[hidden],
.qr-wrap canvas[hidden] {
  display: none;
}

.copy-area label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  margin: 0 0 7px 2px;
}

.copy-field {
  display: grid;
  gap: 9px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.copy-field input {
  background: #f5f7f6;
  border: 1px solid #dbe2df;
  border-radius: 10px;
  color: #5c6661;
  font-size: 0.78rem;
  min-width: 0;
  overflow: hidden;
  padding: 0 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-field button {
  align-items: center;
  background: var(--green);
  border: 0;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  display: flex;
  font-size: 0.82rem;
  font-weight: 700;
  gap: 8px;
  justify-content: center;
  min-height: 50px;
  padding: 0 16px;
}

.copy-field button svg {
  fill: currentColor;
  height: 18px;
  width: 18px;
}

.pix-instructions {
  display: grid;
  gap: 12px;
  list-style: none;
  margin: 24px 0;
  padding: 0;
}

.pix-instructions li {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 30px 1fr;
}

.pix-instructions li > span {
  align-items: center;
  background: var(--green-soft);
  border-radius: 50%;
  color: var(--green-dark);
  display: flex;
  font-size: 0.78rem;
  font-weight: 800;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.pix-instructions p {
  color: #45514b;
  font-size: 0.82rem;
  line-height: 1.4;
  margin: 0;
}

.payment-status {
  align-items: center;
  background: #f2f7f4;
  border-radius: 12px;
  display: grid;
  gap: 12px;
  grid-template-columns: 18px 1fr;
  padding: 14px 16px;
}

.status-pulse {
  animation: pulse 1.4s ease-out infinite;
  background: var(--green);
  border-radius: 50%;
  height: 10px;
  justify-self: center;
  width: 10px;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 137, 95, 0.32); }
  70% { box-shadow: 0 0 0 8px rgba(0, 137, 95, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 137, 95, 0); }
}

.payment-status strong,
.payment-status small {
  display: block;
}

.payment-status strong {
  color: var(--green-dark);
  font-size: 0.83rem;
}

.payment-status small {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.35;
  margin-top: 2px;
}

.payment-status.is-approved {
  background: var(--green);
  color: #fff;
}

.payment-status.is-approved .status-pulse {
  animation: none;
  background: #fff;
}

.payment-status.is-approved strong,
.payment-status.is-approved small {
  color: #fff;
}

.error-panel {
  text-align: center;
}

.support-note {
  align-items: start;
  color: var(--muted);
  display: grid;
  gap: 12px;
  grid-template-columns: 30px 1fr;
  margin-top: 20px;
  padding: 0 8px;
}

.support-note svg {
  fill: var(--green);
  height: 28px;
  width: 28px;
}

.support-note p {
  font-size: 0.78rem;
  line-height: 1.55;
  margin: 0;
}

.support-note strong {
  color: var(--ink);
}

@media (max-width: 900px) {
  .pix-shell {
    grid-template-columns: minmax(0, 560px);
    padding-top: 24px;
  }

  .product-column {
    position: static;
  }

  .course-visual {
    border-radius: 28px;
  }

  .payment-column {
    padding-top: 8px;
  }
}

@media (max-width: 560px) {
  .pix-header-inner {
    height: 62px;
    padding: 0 16px;
  }

  .brand {
    height: 44px;
  }

  .brand img {
    height: 54px;
  }

  .secure-label span {
    font-size: 0.72rem;
  }

  .pix-shell {
    gap: 30px;
    padding: 12px 10px 48px;
  }

  .course-visual {
    border-radius: 30px;
  }

  .duration-badge {
    font-size: 0.8rem;
    padding: 10px 20px;
    right: 20px;
    top: 20px;
  }

  .course-visual h1 {
    bottom: 23px;
    font-size: clamp(1.18rem, 6.1vw, 1.65rem);
    left: 14px;
    right: 14px;
  }

  .product-highlight {
    border-width: 4px;
    margin-top: 26px;
  }

  .start-highlight {
    min-height: 82px;
    padding-inline: 14px;
  }

  .start-highlight span {
    font-size: 1rem;
  }

  .urgency-highlight {
    min-height: 144px;
  }

  .urgency-highlight strong {
    font-size: 1.45rem;
  }

  .urgency-highlight span {
    font-size: 1.18rem;
  }

  .payment-column {
    padding: 0 4px;
  }

  .back-link {
    margin-left: 4px;
  }

  .payment-heading {
    display: block;
    text-align: center;
  }

  .pix-symbol {
    height: 72px;
    margin: 0 auto 14px;
    width: 72px;
  }

  .payment-heading h2 {
    font-size: 2rem;
  }

  .payment-total {
    padding: 16px;
  }

  .payment-total strong {
    font-size: 1.3rem;
  }

  .identity-panel,
  .pix-panel,
  .loading-panel,
  .error-panel {
    border-radius: 18px;
    padding: 18px;
  }

  #identity-form {
    grid-template-columns: 1fr;
  }

  .field-wide {
    grid-column: auto;
  }

  .field input {
    font-size: 16px;
  }

  .copy-field {
    grid-template-columns: 1fr;
  }

  .copy-field input {
    height: 48px;
  }

  .copy-field button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
