:root {
  color: #171719;
  background: #eef0f2;
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: #eef0f2;
}

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

.payment-page {
  min-height: 100vh;
  display: grid;
  place-items: start center;
  padding: 32px 16px;
}

.payment-card {
  width: min(100%, 420px);
  background: #fff;
  border-radius: 20px;
  box-shadow:
    0 18px 50px rgb(20 20 30 / 10%),
    0 2px 8px rgb(20 20 30 / 6%);
  padding: 28px 24px 32px;
}

.topbar {
  min-height: 60px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.brand {
  font-size: 19px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.secure {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #767a82;
  font-size: 14px;
  font-weight: 500;
}

.shield {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #7a7d84;
}

.divider {
  height: 1px;
  background: #e7e7e9;
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 0 32px;
  font-size: 20px;
}

.total-row strong {
  font-weight: 800;
}

.payment-info h1 {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
}

.payment-info h1 span {
  color: #9b9da3;
  font-size: 14px;
  font-weight: 500;
}

.payment-info > p {
  margin: 0 0 16px;
  color: #303137;
  font-size: 16px;
  line-height: 1.5;
}

.clabe-box {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 16px 20px;
  background: #f7f8f9;
  border: 1px solid #dedfe2;
  border-radius: 14px;
}

.clabe-box code {
  flex: 1 1 auto;
  min-width: 0;
  color: #2d2e32;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 20px;
  letter-spacing: 0.01em;
  white-space: normal;
  overflow-wrap: anywhere;
}

.clabe-box button {
  flex: 0 0 auto;
  min-width: 86px;
  height: 46px;
  padding: 0 16px;
  color: #2d2e31;
  background: #fff;
  border: 1px solid #dadbde;
  border-radius: 9px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 4%);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 140ms ease,
    transform 140ms ease;
}

.clabe-box button:hover {
  background: #f4f4f5;
}

.clabe-box button:active {
  transform: scale(0.97);
}

.clabe-box button:focus-visible,
a:focus-visible {
  outline: 2px solid #222;
  outline-offset: 2px;
}

.details {
  margin: 10px 0 0;
}

.details div {
  min-height: 54px;
  display: grid;
  grid-template-columns: minmax(96px, auto) 1fr;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #ededee;
}

.details dt {
  color: #8f9096;
  font-size: 14px;
}

.details dd {
  margin: 0;
  color: #2b2b2e;
  font-size: 14px;
  font-weight: 700;
  text-align: right;
  overflow-wrap: break-word;
}

.status {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #64666d;
  font-size: 15px;
}

.spinner {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  border: 2px solid #e2e3e5;
  border-top-color: #8a8d94;
  border-radius: 50%;
  animation: spin 1.1s linear infinite;
}

.lower {
  margin-top: 0;
}

footer {
  padding-top: 26px;
  color: #71737a;
  font-size: 13px;
  line-height: 1.6;
}

footer p {
  margin: 0 0 16px;
}

footer .security-note {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #55575d;
}

footer .security-note svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

footer a {
  color: #40424a;
  text-decoration: underline;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 10;
  padding: 12px 18px;
  color: #fff;
  background: #202124;
  border-radius: 8px;
  box-shadow: 0 6px 24px rgb(0 0 0 / 18%);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

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

.state-box {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
  padding: 40px 10px;
}

.state-box p {
  margin: 0;
  color: #303137;
  font-size: 16px;
  line-height: 1.5;
  max-width: 320px;
}

.spinner.big {
  width: 32px;
  height: 32px;
  border-width: 2.5px;
}

#retry-button {
  min-width: 130px;
  height: 48px;
  padding: 0 22px;
  color: #2d2e31;
  background: #fff;
  border: 1px solid #dadbde;
  border-radius: 9px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 4%);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

#retry-button:hover {
  background: #f4f4f5;
}

.status.paid {
  color: #1a7f37;
}

.status.paid .spinner {
  display: none;
}

.status.paid::before {
  content: "✓";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 360px) {
  .payment-page {
    padding: 20px 10px;
  }

  .payment-card {
    padding: 22px 18px 26px;
  }

  .clabe-box {
    padding: 14px 14px 14px 16px;
    gap: 10px;
  }

  .clabe-box code {
    font-size: 19px;
  }

  .clabe-box button {
    min-width: 84px;
    padding: 0 14px;
  }

  .details div {
    grid-template-columns: minmax(80px, auto) 1fr;
  }
}

@media (min-width: 480px) {
  .payment-page {
    padding: 48px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: none;
  }
}
