/* =========================================================================
   Make a payment — sits on top of ../styles.css and reuses its tokens
   ========================================================================= */

/* ---------- Page shell: photo backdrop under a navy wash ---------- */
.pay {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  padding: 1.5rem 1rem 3rem;
  background: var(--navy-950);
  color: #fff;
  overflow: hidden;
}

.pay__backdrop { position: absolute; inset: 0; z-index: -1; }
.pay__slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1);
  transition: opacity 2s ease-in-out, transform 8s linear;
}
.pay__slide.is-active { opacity: 1; transform: scale(1.06); }
.pay__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(4, 18, 43, 0.86) 0%, rgba(4, 18, 43, 0.66) 40%, rgba(4, 18, 43, 0.84) 100%);
}

@media (prefers-reduced-motion: reduce) {
  .pay__slide { transition: none; transform: none; }
  .pay__slide.is-active { transform: none; }
}

.pay__inner { width: 100%; max-width: 580px; margin-inline: auto; }

/* Back arrow + logo in place of the site header */
.pay__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}
.pay__back,
.pay__top-spacer { width: 40px; height: 40px; flex-shrink: 0; }
.pay__back {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  transition: background 0.2s var(--ease);
}
.pay__back:hover { background: rgba(255, 255, 255, 0.22); }
.pay__back svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pay__brand img { display: block; height: 52px; width: auto; }

.pay__intro { text-align: center; }
.pay__intro .eyebrow { color: var(--blue-400); }
.pay__title {
  font-size: clamp(2rem, 1.5rem + 2.2vw, 2.9rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #fff;
}
.pay__title-accent { color: var(--blue-400); }
.pay__subtitle {
  margin: 0.9rem auto 0;
  max-width: 30rem;
  font-size: 1.02rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.78);
}

.pay__demo {
  margin: 1.5rem auto 0;
  width: fit-content;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px dashed rgba(246, 234, 210, 0.6);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold-100);
  text-align: center;
}

.pay__note,
.pay__secured {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 1.25rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
}
.pay__secured { margin-top: 0.6rem; color: rgba(255, 255, 255, 0.55); }
.pay__note svg,
.pay__secured svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Stepper: a rail that fills as the payment advances ---------- */
.stepper {
  --progress: 0;
  position: relative;
  display: flex;
  justify-content: space-between;
  margin: 2.25rem 0 0;
  padding: 0;
  list-style: none;
}
.stepper::before,
.stepper::after {
  content: "";
  position: absolute;
  top: 16px;
  left: 10%;
  height: 3px;
  border-radius: 999px;
  transform: translateY(-50%);
}
.stepper::before { right: 10%; background: rgba(255, 255, 255, 0.16); }
.stepper::after {
  right: 10%;
  background: var(--blue-400);
  transform: translateY(-50%) scaleX(var(--progress));
  transform-origin: left center;
  transition: transform 0.5s var(--ease);
}

.stepper__item {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.stepper__dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--navy-950);
  color: rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18);
  transition: transform 0.3s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease);
}
.stepper__dot svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.stepper__label {
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  color: rgba(255, 255, 255, 0.45);
}

.stepper__item.is-done .stepper__dot { background: var(--blue-500); color: #fff; box-shadow: none; }
.stepper__item.is-done .stepper__label { color: rgba(255, 255, 255, 0.8); }
.stepper__item.is-active .stepper__dot {
  background: #fff;
  color: var(--blue-800);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.22);
  transform: scale(1.1);
}
.stepper__item.is-active .stepper__label { color: #fff; }

.stepper__caption {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

@media (min-width: 560px) {
  .stepper__label { font-size: 0.76rem; }
}

/* ---------- The white card that holds each step ---------- */
.pay-card {
  margin-top: 1.5rem;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.55);
}

.pay-card__body { padding: 1.75rem 1.5rem; }
@media (min-width: 560px) { .pay-card__body { padding: 2rem; } }
.pay-card__body--center { text-align: center; padding-block: 2.5rem; }

.pay-card__title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
}
.pay-card__title--lg { font-size: 1.5rem; margin-top: 1.25rem; }
.pay-card__lede {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--ink-soft);
}
.pay-card__body--center .pay-card__lede { max-width: 24rem; margin-inline: auto; }

/* ---------- Fields ---------- */
.field { margin-top: 1.25rem; }
.field__label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.field__box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  padding-inline: 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field__box:focus-within { border-color: var(--blue-700); box-shadow: 0 0 0 4px var(--blue-50); }
.field__box.is-invalid { border-color: var(--danger); }
.field__box.is-readonly { background: var(--bg-alt); }

.field__box svg.field__icon { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: var(--ink-mute); stroke-width: 2; stroke-linecap: round; }

.field__input {
  flex: 1;
  min-width: 0;
  height: 3.4rem;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  outline: none;
}
.field__input::placeholder { color: #a3a9bf; font-weight: 500; }
.field__input--code { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; letter-spacing: 0.04em; text-transform: uppercase; }
.field__input--amount { height: 4rem; font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; }

/* +256 prefix sits flush against the left edge of the box */
.field__box--phone { padding-left: 0; overflow: hidden; }
.field__prefix {
  align-self: stretch;
  display: flex;
  align-items: center;
  padding-inline: 1rem;
  background: var(--bg-alt);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.field__currency { font-family: var(--font-display); font-size: 0.9rem; font-weight: 700; color: var(--ink-soft); }

.field__hint { margin-top: 0.45rem; font-size: 0.8rem; color: var(--ink-mute); }
.field__hint.is-error { color: var(--danger); font-weight: 600; }

.network-badge {
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.network-badge--mtn { background: #fff4cc; color: #7a5a00; }
.network-badge--airtel { background: #fde2e2; color: #a11d1d; }

.pay-error {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: #fbeaea;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--danger);
}

/* ---------- Buttons inside the card ---------- */
.pay-actions { display: flex; gap: 0.75rem; margin-top: 1.75rem; }
.pay-actions--stack { flex-direction: column; }
@media (min-width: 480px) { .pay-actions--stack { flex-direction: row; } }
.pay-actions .btn { flex: 1; padding-block: 1rem; }
.btn--full { width: 100%; margin-top: 1.75rem; padding-block: 1rem; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.spinner {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2.5px solid currentColor;
  border-right-color: transparent;
  animation: pay-spin 0.8s linear infinite;
}
.spinner--lg { width: 56px; height: 56px; border-width: 4px; margin-inline: auto; color: var(--blue-700); }
@keyframes pay-spin { to { transform: rotate(360deg); } }

/* ---------- Payee band shown once a reference is verified ---------- */
.payee {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}
@media (min-width: 560px) { .payee { padding-inline: 2rem; } }
.payee__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--blue-50);
  color: var(--blue-800);
}
.payee__icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.payee__main { flex: 1; min-width: 0; }
.payee__name { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.payee__ref { margin-top: 0.15rem; font-family: ui-monospace, Menlo, monospace; font-size: 0.78rem; color: var(--ink-mute); }
.payee__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: var(--blue-50);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--blue-800);
  white-space: nowrap;
}
.payee__badge svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Confirm summary ---------- */
.total {
  margin-top: 1.25rem;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  background: var(--blue-50);
  text-align: center;
}
.total__label { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); }
.total__amount { margin-top: 0.25rem; font-family: var(--font-display); font-size: 2rem; font-weight: 800; color: var(--blue-800); }

.rows { margin-top: 1.25rem; display: grid; gap: 0.8rem; }
.row { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; font-size: 0.92rem; }
.row__label { flex-shrink: 0; color: var(--ink-soft); }
.row__value { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.row__value--mono { font-family: ui-monospace, Menlo, monospace; font-size: 0.86rem; }

/* ---------- Status badges (waiting / success / failed) ---------- */
.status-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  margin-inline: auto;
  border-radius: 22px;
}
.status-icon svg { width: 38px; height: 38px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.status-icon--success { background: #e2f5ec; color: var(--success); }
.status-icon--warn { background: #fbf0dc; color: var(--pending); }
.status-icon--fail { background: #fbeaea; color: var(--danger); }

.countdown { margin-top: 1rem; font-family: ui-monospace, Menlo, monospace; font-size: 0.88rem; color: var(--ink-mute); }

/* ---------- Receipt ---------- */
.receipt {
  margin-top: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.receipt__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--navy-950);
  color: #fff;
}
.receipt__head img { height: 34px; width: auto; }
.receipt__no { font-size: 0.72rem; text-align: right; color: rgba(255, 255, 255, 0.7); }
.receipt__no strong { display: block; font-family: ui-monospace, Menlo, monospace; font-size: 0.85rem; color: #fff; }
.receipt__amount { padding: 1.25rem; text-align: center; border-bottom: 1px dashed var(--border); }
.receipt .rows { margin: 0; padding: 1.25rem; }

/* Print only the receipt when the payer saves it as a PDF */
@media print {
  body * { visibility: hidden !important; }
  .receipt, .receipt * { visibility: visible !important; }
  .receipt { position: absolute; inset: 0 auto auto 0; width: 100%; border: 1px solid #ccc; }
  .receipt__head { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* On narrow screens keep the phone (left third of the photo) in frame */
@media (max-width: 760px) {
  .pay__slide { background-position: 28% center; }
}

/* Keep the icon beside its text when the note wraps */
.pay__note { display: block; }
.pay__note svg { display: inline-block; vertical-align: -3px; margin-right: 0.35rem; }
