:root {
  --blue: #1769e0;
  --blue-dark: #0b2559;
  --blue-soft: #eaf2ff;
  --bg: #f6f8fc;
  --card: #ffffff;
  --green: #16a36a;
  --green-soft: #eaf8f1;
  --text: #1d2738;
  --muted: #697589;
  --muted-soft: #8b95a7;
  --line: #e3e8f2;
  --line-strong: #d4dceb;
  --danger: #c94a4a;
  --shadow: 0 10px 28px rgba(11, 37, 89, 0.08);
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
}

button,
input {
  font: inherit;
}

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

.sprite {
  display: none;
}

.page-shell {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
}

.app {
  min-height: 100vh;
  padding: 20px 16px 34px;
}

.app-header {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 42px;
}

.app[data-step="1"] .app-header {
  grid-template-columns: 1fr auto;
}

.back-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  color: var(--blue-dark);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: 0 5px 16px rgba(11, 37, 89, 0.05);
  cursor: pointer;
}

.back-button svg {
  width: 19px;
  height: 19px;
}

.app[data-step="1"] .back-button {
  display: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  justify-self: start;
  color: var(--blue);
}

.app:not([data-step="1"]) .brand {
  justify-self: center;
}

.brand-icon {
  width: 21px;
  height: 25px;
}

.brand span {
  color: var(--blue-dark);
  font-size: 17px;
  font-weight: 700;
  font-style: italic;
  line-height: 1;
  letter-spacing: 0;
}

.brand strong {
  color: var(--blue);
}

.pix-chip {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0;
  color: var(--green);
  background: var(--green-soft);
  border: 1px solid rgba(22, 163, 106, 0.18);
  border-radius: 50%;
}

.pix-chip svg {
  width: 14px;
  height: 14px;
}

.flow-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin: 18px 0;
}

.flow-steps span {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 7px 5px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.1;
  text-align: center;
  box-shadow: 0 5px 15px rgba(11, 37, 89, 0.04);
}

.flow-steps span:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -8px;
  color: #aab4c5;
  font-size: 12px;
  z-index: 2;
}

.app[data-step="1"] [data-flow-step="1"],
.app[data-step="2"] [data-flow-step="2"],
.app[data-step="3"] [data-flow-step="3"],
.app[data-step="4"] [data-flow-step="4"] {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: rgba(23, 105, 224, 0.35);
  box-shadow: 0 8px 20px rgba(23, 105, 224, 0.1);
}

.screen {
  display: none;
}

.screen.is-active {
  display: block;
  animation: screenIn 180ms ease-out;
}

@keyframes screenIn {
  from {
    transform: translateY(5px);
    opacity: 0.7;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.hero-copy {
  margin-top: 8px;
}

.eyebrow,
.section-head p {
  margin: 0 0 7px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  color: var(--text);
  font-size: 25px;
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: 0;
}

.hero-copy > p:not(.eyebrow),
.section-head span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.benefit-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0 19px;
}

.benefit-cards span {
  display: grid;
  min-height: 70px;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 11px 5px;
  color: var(--blue);
  background: var(--blue-soft);
  border: 1px solid rgba(23, 105, 224, 0.1);
  border-radius: 15px;
  box-shadow: 0 8px 20px rgba(11, 37, 89, 0.05);
}

.benefit-cards svg {
  width: 23px;
  height: 23px;
}

.benefit-cards strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.12;
  text-align: center;
}

.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 11px;
}

.section-label h2,
.summary-card h2,
.status-card h2 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.operator-grid,
.amount-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.operator-card,
.amount-card {
  position: relative;
  display: grid;
  width: 100%;
  place-items: center;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.operator-card {
  min-height: 112px;
  align-content: center;
  gap: 10px;
  padding: 16px 10px 14px;
}

.operator-card strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.15;
  text-align: center;
}

.operator-logo {
  display: inline-grid;
  width: 50px;
  height: 50px;
  place-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: 0 5px 14px rgba(11, 37, 89, 0.05);
}

.operator-logo svg {
  width: 36px;
  height: 36px;
}

.operator-logo.small {
  width: 42px;
  height: 42px;
  border-radius: 13px;
}

.operator-logo.small svg {
  width: 31px;
  height: 31px;
}

.operator-card:hover,
.amount-card:hover {
  transform: translateY(-1px);
  border-color: rgba(23, 105, 224, 0.36);
}

.operator-card.is-selected,
.amount-card.is-selected {
  transform: scale(0.99);
  background: var(--blue-soft);
  border-color: var(--blue);
  box-shadow: 0 12px 28px rgba(23, 105, 224, 0.12);
}

.card-check {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: #fff;
  background: var(--blue);
  border-radius: 50%;
  transform: scale(0.7);
  opacity: 0;
  transition: opacity 150ms ease, transform 150ms ease;
}

.card-check svg {
  width: 14px;
  height: 14px;
}

.is-selected .card-check {
  transform: scale(1);
  opacity: 1;
}

.section-head {
  margin: 8px 0 16px;
}

.selected-context {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
  padding: 13px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.selected-context small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.selected-context strong {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}

.text-button,
.edit-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  color: var(--blue);
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.edit-button svg {
  width: 14px;
  height: 14px;
}

.field-label {
  display: block;
  margin: 0 0 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.phone-field {
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 56px;
  padding: 0 15px;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: var(--shadow);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.phone-field:focus-within,
.phone-field.has-value {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(23, 105, 224, 0.1), var(--shadow);
}

.phone-field svg {
  width: 21px;
  height: 21px;
}

.phone-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0;
}

.phone-field input::placeholder {
  color: #a2abbb;
  font-weight: 500;
}

.input-help {
  min-height: 21px;
  margin: 9px 1px 18px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
}

.input-help.is-error {
  color: var(--danger);
}

.input-help.is-valid {
  color: var(--green);
}

.primary-button,
.copy-button,
.secondary-button {
  display: inline-flex;
  width: 100%;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  padding: 14px 18px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  cursor: pointer;
}

.primary-button {
  color: #fff;
  background: var(--blue);
  border: 1px solid var(--blue);
  box-shadow: 0 12px 24px rgba(23, 105, 224, 0.2);
}

.primary-button:disabled {
  color: rgba(255, 255, 255, 0.8);
  background: #9bbced;
  border-color: #9bbced;
  box-shadow: none;
  cursor: default;
}

.amount-card {
  min-height: 86px;
  align-content: center;
  padding: 18px 10px;
}

.amount-card strong {
  color: var(--text);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
}

.amount-card em {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 5px 8px;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 999px;
  font-size: 10.5px;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
}

.summary-card,
.payment-option,
.status-card {
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.summary-card {
  margin-bottom: 14px;
}

.summary-card.compact {
  margin: 14px 0 0;
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.summary-list {
  margin: 0;
}

.summary-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.summary-list div:first-child {
  border-top: 0;
}

.summary-list dt {
  color: var(--muted);
  font-size: 13px;
}

.summary-list dd {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-align: right;
}

.summary-list .total dd,
.summary-list .total dt {
  color: var(--blue-dark);
  font-size: 16px;
  font-weight: 700;
}

.payment-option {
  margin-bottom: 18px;
}

.payment-title {
  margin-bottom: 12px;
}

.payment-title h2,
.card-form-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.payment-method-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.method-card {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 9px;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 122px;
  padding: 14px 9px;
  color: var(--text);
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.method-card:hover {
  transform: translateY(-1px);
  border-color: rgba(23, 105, 224, 0.35);
}

.method-card.is-selected {
  background: var(--blue-soft);
  border-color: var(--blue);
  box-shadow: 0 10px 22px rgba(23, 105, 224, 0.1);
}

.pix-icon {
  display: inline-grid;
  width: 70px;
  height: 42px;
  place-items: center;
  padding: 5px 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.pix-icon img {
  display: block;
  width: 58px;
  height: auto;
}

.card-brands {
  display: grid;
  width: 82px;
  min-height: 42px;
  grid-template-columns: 1fr 1fr;
  column-gap: 5px;
  row-gap: 2px;
  align-items: center;
  justify-items: center;
  padding: 5px 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.card-brands img {
  display: block;
  max-width: 33px;
  max-height: 16px;
}

.card-brands img:nth-child(3) {
  grid-column: 1 / -1;
  max-width: 35px;
}

.method-card strong {
  display: block;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.method-card small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.25;
}

.method-check {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 21px;
  height: 21px;
  color: var(--blue);
  opacity: 0;
  transform: scale(0.78);
  transition: opacity 150ms ease, transform 150ms ease;
}

.method-card.is-selected .method-check {
  opacity: 1;
  transform: scale(1);
}

.method-card[data-payment-method="pix"].is-selected .method-check {
  color: var(--green);
}

.card-form,
.pix-name-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.card-form[hidden] {
  display: none;
}

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

.form-field {
  display: grid;
  gap: 7px;
}

.card-form-head {
  grid-column: 1 / -1;
}

.card-form-head p {
  margin: 6px 0 1px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.4;
}

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

.form-field span {
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
}

.form-field input {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 0 12px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: 0;
  font-size: 15px;
  font-weight: 500;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.form-field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(23, 105, 224, 0.1);
}

.form-field input::placeholder {
  color: #a3adbd;
}

.card-help {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.card-help[hidden] {
  display: none;
}

.card-help.is-error {
  color: var(--danger);
}

.generating-text,
.payment-feedback {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.payment-feedback[hidden] {
  display: none;
}

.payment-feedback.is-error {
  color: var(--danger);
}

.status-card {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 12px;
  align-items: start;
  margin-bottom: 16px;
}

.status-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  background: var(--blue);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(23, 105, 224, 0.1);
}

.status-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.42;
}

.app[data-payment-status="received"] .status-dot,
.app[data-payment-status="completed"] .status-dot {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(22, 163, 106, 0.12);
}

.app[data-payment-status="processing"] .status-dot {
  background: var(--blue-dark);
  box-shadow: 0 0 0 5px rgba(11, 37, 89, 0.11);
}

.card-success .status-dot {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(22, 163, 106, 0.12);
}

.card-failure .status-dot,
.app[data-payment-status="failed"] .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 5px rgba(201, 74, 74, 0.12);
}

.qr-image,
.qr-canvas {
  display: block;
  width: 228px;
  height: 228px;
  margin: 4px auto 16px;
  background: #fff;
  border: 10px solid #fff;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

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

.qr-canvas {
  image-rendering: pixelated;
}

.copy-button {
  color: #fff;
  background: var(--green);
  border: 1px solid var(--green);
  box-shadow: 0 12px 24px rgba(22, 163, 106, 0.18);
}

.secondary-button {
  color: var(--blue);
  background: #fff;
  border: 1px solid rgba(23, 105, 224, 0.28);
  box-shadow: 0 8px 18px rgba(11, 37, 89, 0.06);
}

.result-actions {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.pix-code {
  width: 100%;
  max-height: 86px;
  margin: 12px 0 0;
  padding: 13px;
  overflow: auto;
  color: #5c6677;
  background: #fff;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 10.5px;
  line-height: 1.38;
  white-space: pre-wrap;
  word-break: break-all;
}

.site-footer {
  margin-top: 28px;
  color: var(--muted);
}

.secure-title {
  display: grid;
  grid-template-columns: 22px minmax(0, auto);
  align-items: start;
  justify-content: center;
  gap: 10px;
  margin: 0 0 16px;
  color: var(--text);
  font-size: 13.8px;
  font-weight: 700;
  line-height: 1.3;
  text-align: left;
}

.secure-title svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--green);
}

.bacen-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 16px;
  align-items: center;
  min-height: 78px;
  padding: 15px 16px;
  background: #fbfaff;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.bacen-mini-logo {
  display: grid;
  width: 58px;
  justify-items: center;
  gap: 3px;
  color: #025c75;
}

.bacen-symbol {
  display: block;
  width: 43px;
  height: 29px;
  overflow: hidden;
  position: relative;
}

.bacen-symbol img {
  position: absolute;
  display: block;
  width: 122px;
  max-width: none;
  height: auto;
  left: -39px;
  top: -1px;
}

.bacen-mini-logo b {
  color: #025c75;
  font-size: 8.5px;
  font-weight: 800;
  line-height: 1;
}

.bacen-card strong {
  color: var(--text);
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.32;
}

.how-it-works {
  margin: 22px 5px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  text-align: center;
}

.how-it-works strong {
  color: var(--text);
  font-weight: 700;
}

.disclaimer,
.copyright {
  margin: 20px 2px 0;
  color: var(--muted-soft);
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
}

.copyright {
  margin-top: 18px;
  font-size: 13px;
}

@media (min-width: 700px) {
  .page-shell {
    margin-top: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: 0 24px 70px rgba(11, 37, 89, 0.12);
    overflow: hidden;
  }

  .app {
    padding: 24px 20px 38px;
  }
}

@media (max-width: 360px) {
  .app {
    padding-right: 12px;
    padding-left: 12px;
  }

  h1 {
    font-size: 24px;
  }

  .flow-steps {
    gap: 5px;
  }

  .flow-steps span {
    min-height: 35px;
    padding: 6px 3px;
    font-size: 9.5px;
  }

  .operator-card {
    min-height: 104px;
  }

  .amount-card strong {
    font-size: 20px;
  }
}
