:root {
  --bg: #0a0a0a;
  --surface: #111111;
  --border: #222222;
  --border-focus: #a3e635;
  --text: #fafafa;
  --text-muted: #71717a;
  --accent: #a3e635;
  --error: #ef4444;
  --success: #22c55e;
  --input: #151515;
  --input-strong: #1a1a1a;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, sans-serif;
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0;
}

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

button,
select {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

h1,
h2,
p {
  margin: 0;
}

p {
  color: var(--text-muted);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

.page-shell {
  width: 100%;
  min-height: 100vh;
  display: grid;
  justify-items: center;
  align-items: start;
  padding: 1rem;
}

.checkout-surface,
.success-panel {
  width: min(100%, 480px);
  display: grid;
  gap: 1rem;
}

.brand-header {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
}

.brand span {
  color: var(--accent);
}

.secure-badge {
  width: fit-content;
  padding: 0.25rem 0.5rem;
  border: 1px solid rgba(163, 230, 53, 0.35);
  border-radius: 6px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
}

.offer-panel,
.form-section,
.pix-panel,
.success-panel {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.offer-panel {
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
}

.offer-copy {
  display: grid;
  gap: 0.5rem;
}

.section-label {
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
  text-transform: uppercase;
}

h1 {
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
}

h2 {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
}

.price-box {
  display: grid;
  gap: 0.15rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.price-box span {
  color: var(--text);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1;
}

.price-box small {
  min-height: 1.1rem;
  color: var(--text-muted);
}

.checkout-form {
  display: grid;
  gap: 1rem;
}

.form-section {
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

.section-heading {
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.step-index {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(163, 230, 53, 0.36);
  border-radius: 6px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

.field {
  min-width: 0;
  display: grid;
  gap: 0.4rem;
}

label {
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;
}

input,
select,
textarea,
.stripe-field {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--input);
  color: var(--text);
  outline: none;
  transition:
    border-color 150ms ease,
    background-color 150ms ease;
}

input,
select {
  padding: 0 0.75rem;
}

textarea {
  min-height: 112px;
  padding: 0.75rem;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
.stripe-field:focus-within {
  border-color: var(--border-focus);
  background: var(--input-strong);
}

input::placeholder {
  color: #52525b;
}

.field-with-status {
  position: relative;
  display: grid;
}

.field-with-status input {
  padding-right: 4.5rem;
}

.card-brand {
  position: absolute;
  top: 50%;
  right: 0.55rem;
  transform: translateY(-50%);
  max-width: 4rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #0d0d0d;
}

.segment {
  min-height: 38px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
}

.segment.active {
  background: var(--accent);
  color: #111111;
}

.payment-tab {
  display: grid;
  gap: 1rem;
  padding-top: 0.25rem;
}

.stripe-field {
  display: block;
  padding: 0.78rem 0.75rem;
  background: #1a1a1a;
}

.stripe-field .StripeElement {
  width: 100%;
}

.stripe-field iframe {
  width: 100% !important;
}

.pay-button,
.secondary-button {
  width: 100%;
  min-height: 46px;
  display: inline-grid;
  grid-template-columns: 1fr auto;
  place-items: center;
  gap: 0.75rem;
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 600;
}

.pay-button {
  background: var(--accent);
  color: #111111;
}

.secondary-button {
  grid-template-columns: 1fr;
  background: var(--input);
  color: var(--text);
  border-color: var(--border);
}

.message {
  min-height: 1.25rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  overflow-wrap: anywhere;
}

.error-message,
.field-error {
  color: var(--error);
}

.success-message {
  color: var(--success);
}

.field-error {
  min-height: 1rem;
  font-size: 0.75rem;
  line-height: 1.35;
}

.button-spinner,
.mini-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(17, 17, 17, 0.22);
  border-top-color: #111111;
  border-radius: 999px;
  animation: spin 800ms linear infinite;
}

.mini-spinner {
  position: absolute;
  top: 50%;
  right: 0.75rem;
  transform: translateY(-50%);
  border-color: var(--border);
  border-top-color: var(--accent);
}

.pix-panel {
  justify-items: stretch;
  gap: 0.85rem;
  padding: 1rem;
}

.pix-qr {
  width: min(100%, 260px);
  aspect-ratio: 1;
  justify-self: center;
  border-radius: 6px;
  background: #ffffff;
}

.countdown {
  color: var(--accent);
  font-weight: 600;
}

.success-shell {
  align-items: center;
}

.success-panel {
  justify-items: center;
  padding: 2rem 1.25rem;
  text-align: center;
}

.success-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(163, 230, 53, 0.42);
  border-radius: 6px;
  color: var(--accent);
  font-size: 2.25rem;
  font-weight: 600;
  line-height: 1;
}

.success-link {
  margin-top: 0.5rem;
}

@media (min-width: 520px) {
  .page-shell {
    align-items: center;
    padding: 2rem 1rem;
  }

  .offer-panel {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  .price-box {
    min-width: 150px;
    padding-top: 0;
    border-top: 0;
    text-align: right;
  }

  .field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field:not(.short-field) {
    grid-column: span 2;
  }
}

@keyframes spin {
  to {
    rotate: 360deg;
  }
}

.field-error {
  color: #ef4444;
  font-size: 0.8125rem;
  margin-top: 0.5rem;
}