:root {
  --ink: #171a1f;
  --muted: #747b84;
  --line: #dce0e5;
  --blue: #1168df;
  --blue-dark: #064fc2;
  --soft-blue: #f4f8ff;
  --cyan-bg: #e9fbff;
  --cyan: #1bb9cb;
  --green: #12a069;
  --green-bright: #41ae4d;
  --error: #df3e48;
  --surface: #ffffff;
  --shadow: 0 12px 30px rgba(23, 44, 79, 0.09);
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #fff;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: #fff; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: #fff; }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell { min-height: 100svh; }
.screen { min-height: 100svh; padding-top: env(safe-area-inset-top); display: none; justify-content: center; background: #fff; }
.screen.is-active { display: flex; }
.content-card { width: 100%; max-width: 430px; background: #fff; }
.registration-card { padding: 25px 34px 48px; }
.compact-card { padding: 25px 34px 45px; }

.payment-header {
  position: sticky;
  z-index: 20;
  top: env(safe-area-inset-top);
  margin: 0 0 20px;
  padding: 8px 0 10px;
  background: #fff;
  text-align: center;
}
.payment-title { margin: 0; font-size: 16px; line-height: 1.35; font-weight: 700; letter-spacing: -.22px; }
.payment-reference {
  margin: 3px 0 0;
  color: #92969c;
  font-size: 12px;
  line-height: 1.4;
  text-decoration: none !important;
}
.payment-reference a {
  color: inherit;
  text-decoration: none !important;
}

.intro-block h1,
.otp-content h1,
.payment-content h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: -.35px;
}

.intro-block p,
.otp-content > p,
.payment-lead {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.72;
}

.intro-block strong,
.otp-content strong,
.payment-lead strong { color: #30343a; font-weight: 600; }

.form-section { margin-top: 25px; }
.bank-section { margin-top: 26px; }
.form-section h2 {
  margin: 0 0 18px;
  color: var(--blue);
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 1.35px;
}

.field-group { margin-bottom: 18px; }
.field-group > label {
  display: block;
  margin: 0 0 8px;
  color: #262a30;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 600;
}
.field-group > label span { color: #7f848c; font-weight: 400; }

.input-shell {
  min-height: 57px;
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input-shell:focus-within { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(17, 104, 223, .08); }
.input-shell.is-invalid { border-color: var(--error); }

.leading-icon {
  width: 41px;
  flex: 0 0 41px;
  display: grid;
  place-items: center;
  color: #69727c;
}
.leading-icon.compact { width: 39px; flex-basis: 39px; }
.leading-icon svg,
.button-icon svg,
.text-button svg,
.info-icon svg,
.chevron,
.bank-pay-icon svg,
.account-symbol svg,
.success-check svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.input-shell input {
  width: 100%;
  min-width: 0;
  height: 55px;
  padding: 0 15px 0 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #41464e;
  font-size: 14px;
  font-weight: 400;
}
.input-shell.no-icon input { padding: 0 15px; }
.input-shell input::placeholder { color: #aaaeb4; opacity: 1; }

.field-error,
.otp-error {
  min-height: 0;
  margin: 5px 5px 0;
  color: var(--error);
  font-size: 10px;
  line-height: 1.4;
}
.field-error:empty,
.otp-error:empty { display: none; }

.custom-select,
.payment-account-select { position: relative; }
.floating-label {
  position: absolute;
  z-index: 3;
  top: -8px;
  left: 14px;
  padding: 0 4px;
  color: #676c73;
  background: #fff;
  font-size: 11px;
  line-height: 1.25;
}

.select-trigger {
  width: 100%;
  min-height: 59px;
  padding: 0 14px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: #fff;
  color: #3f454d;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.select-trigger:focus,
.custom-select.open .select-trigger,
.payment-account-select.open .select-trigger {
  outline: 0;
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(17, 104, 223, .08);
}
.select-left { min-width: 0; display: flex; align-items: center; font-size: 14px; text-align: left; }
.select-left > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chevron { width: 15px; height: 15px; flex: 0 0 15px; color: #626971; }
.select-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 5px);
  left: -6px;
  right: -6px;
  max-height: min(430px, 65svh);
  overflow-y: auto;
  background: #fff;
  border: 1px solid #edf0f3;
  border-radius: 13px;
  box-shadow: 0 10px 30px rgba(20, 35, 58, .14);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .12s ease, transform .12s ease, visibility .12s ease;
}
.custom-select.open .select-menu,
.payment-account-select.open .select-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.select-option {
  width: 100%;
  min-height: 47px;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  border: 0;
  border-bottom: 1px solid #f0f2f4;
  background: #fff;
  color: #3b4048;
  font-size: 12px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}
.select-option:last-child { border-bottom: 0; }
.select-option:hover,
.select-option:focus { outline: none; background: #f5f8fc; }
.select-option.selected { color: var(--blue); background: #eef5ff; font-weight: 600; }

.checkbox-card {
  min-height: 67px;
  padding: 13px 18px;
  display: flex;
  align-items: center;
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: #252a31;
  background: #fff;
  font-size: 12px;
  line-height: 1.45;
  cursor: pointer;
}
.checkbox-card input { position: absolute; opacity: 0; pointer-events: none; }
.custom-checkbox { width: 18px; height: 18px; flex: 0 0 18px; border: 1.6px solid #707984; border-radius: 2px; position: relative; }
.checkbox-card input:checked + .custom-checkbox { border-color: var(--blue); background: var(--blue); }
.checkbox-card input:checked + .custom-checkbox::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.mobile-field { margin-top: 16px; }

.info-panel {
  min-height: 86px;
  margin-top: 15px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 13px;
  border-radius: 17px;
  background: var(--cyan-bg);
  color: #5f757b;
}
.info-panel p { margin: 0; font-size: 12px; line-height: 1.55; }
.info-icon { display: grid; place-items: center; color: var(--cyan); }
.info-icon svg { width: 20px; height: 20px; stroke-width: 2; }

.terms-copy { margin: 28px 0 15px; color: #81868e; font-size: 9.5px; line-height: 1.7; text-align: center; }
.terms-copy a { color: var(--blue); font-weight: 600; text-decoration: none; }

.primary-button,
.verify-button {
  width: 100%;
  min-height: 50px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 17px;
  color: #fff;
  background: linear-gradient(90deg, #1576ef 0%, #064fc2 100%);
  box-shadow: 0 8px 17px rgba(7, 80, 194, .23);
  font-size: 13px;
  line-height: 1.2;
  font-weight: 600;
  cursor: pointer;
  transition: transform .13s ease, opacity .13s ease, background .13s ease;
}
.primary-button:active,
.verify-button:active { transform: translateY(1px); }
.primary-button:disabled,
.verify-button:disabled {
  color: #8c949d;
  background: #dce1e7;
  box-shadow: none;
  cursor: not-allowed;
}
.button-icon { display: grid; place-items: center; }
.button-icon svg { width: 20px; height: 20px; }
.spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.is-loading .button-icon,
.is-loading .user-icon { display: none; }
.is-loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.text-button {
  border: 0;
  background: transparent;
  color: #727982;
  font-size: 11px;
  cursor: pointer;
}
.text-button.centered { margin: 20px auto 0; display: flex; align-items: center; gap: 7px; }
.text-button svg { width: 16px; height: 16px; }

/* OTP */
.otp-content { margin-top: 29px; }
.otp-content > p { margin-top: 9px; }
.otp-content > p + p { margin-top: 10px; }
#otpForm { margin-top: 28px; }
.otp-input {
  width: 100%;
  height: 58px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: 0;
  color: #30353c;
  background: #fff;
  font-size: 14px;
  letter-spacing: 1px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.otp-input:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(17, 104, 223, .08); }
.otp-input.is-invalid { border-color: var(--error); }
.otp-input::placeholder { color: #a1a6ad; letter-spacing: 0; }
.verify-button { min-height: 40px; margin-top: 17px; border-radius: 7px; font-size: 12px; }
.otp-actions { margin-top: 27px; display: flex; align-items: center; justify-content: space-between; }
.link-button { padding: 3px 0; border: 0; background: transparent; color: var(--blue); font-size: 11px; font-weight: 600; cursor: pointer; }

/* Payment method */
.payment-content { margin-top: 28px; }
.payment-lead { margin-top: 8px; }
.payment-account-select { margin-top: 29px; }
.payment-select-trigger { min-height: 61px; border: 2px solid var(--blue); background: #f7fbff; }
.struck-label { color: var(--blue); text-decoration: line-through; }
.bank-blue { color: var(--blue); }
.payment-account-menu { left: 0; right: 0; }

.account-card {
  min-height: 83px;
  margin-top: 14px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
}
.account-symbol {
  width: 45px;
  height: 45px;
  flex: 0 0 45px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--blue);
  background: #eef5ff;
}
.account-symbol svg { width: 23px; height: 23px; stroke-width: 2.1; }
.account-card h2 { margin: 0; color: #2d3238; font-size: 12px; line-height: 1.45; font-weight: 600; }
.account-card p { margin: 4px 0 0; color: #727982; font-size: 11px; }

.add-account-button {
  width: 100%;
  min-height: 52px;
  margin-top: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px dashed #adb4bc;
  border-radius: 17px;
  color: #24292f;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
}
.add-account-button span { font-size: 19px; line-height: 1; }
.pay-bank-button {
  width: 100%;
  min-height: 122px;
  margin-top: 23px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 19px;
  color: #fff;
  background: linear-gradient(100deg, #1477ee 0%, #0648b8 100%);
  box-shadow: 0 10px 22px rgba(12, 87, 205, .25);
  cursor: pointer;
}
.pay-bank-button:disabled { color: #8d96a0; background: #dce2e8; box-shadow: none; cursor: wait; }
.bank-pay-icon { display: grid; place-items: center; }
.bank-pay-icon svg { width: 25px; height: 25px; stroke-width: 2; }
.pay-bank-button strong { margin-top: 7px; font-size: 16px; line-height: 1.2; }
.pay-bank-button span:last-child { margin-top: 8px; color: rgba(255,255,255,.73); font-size: 10px; }
.pay-bank-button:disabled span:last-child { color: #9ca4ad; }

.processing-panel {
  min-height: 56px;
  margin-top: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-radius: 12px;
  color: #527078;
  background: #e8fbff;
}
.processing-panel p { margin: 0; font-size: 10px; line-height: 1.5; }
.processing-dot {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  border: 2px solid rgba(25, 183, 202, .25);
  border-top-color: #19b7ca;
  border-radius: 50%;
  animation: spin .75s linear infinite;
}
.cancel-payment-button {
  margin: 18px 0 0 6px;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  color: #707780;
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}
.cancel-payment-button span { font-size: 22px; line-height: 1; font-weight: 300; }

/* Modals */
.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(2px);
}
.confirm-sheet {
  position: relative;
  width: 100%;
  max-width: 430px;
  min-height: 100svh;
  padding: calc(91px + env(safe-area-inset-top)) 25px calc(33px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  background: #fff;
}
.modal-close {
  position: absolute;
  top: calc(27px + env(safe-area-inset-top));
  right: 24px;
  padding: 0;
  border: 0;
  color: #4f5861;
  background: transparent;
  font-size: 31px;
  line-height: 1;
  font-weight: 300;
  cursor: pointer;
}
.confirm-sheet h2 { margin: 0; text-align: center; font-size: 18px; line-height: 1.35; font-weight: 700; }
.confirm-question { margin: 24px auto 0; max-width: 340px; color: #777e87; font-size: 14px; line-height: 1.55; text-align: center; }
.confirm-summary {
  margin: 22px 0 0;
  padding: 19px 21px;
  border: 1px solid #dce8f6;
  border-radius: 23px;
  background: #f8fbff;
}
.confirm-summary > div { min-height: 42px; display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; }
.confirm-summary dt { color: #747c85; font-size: 12px; }
.confirm-summary dd { margin: 0; color: #272c33; font-size: 12px; line-height: 1.45; text-align: right; }
.confirm-actions { margin-top: auto; }
.confirm-pay-button { min-height: 54px; border-radius: 18px; font-size: 14px; }
.plain-cancel { margin: 24px auto 0; display: block; border: 0; color: #666d75; background: transparent; font-size: 12px; cursor: pointer; }
.add-account-sheet { padding-top: calc(70px + env(safe-area-inset-top)); overflow-y: auto; }
.add-account-sheet h2 { text-align: left; }
.small-modal-lead { margin: 7px 0 24px; color: var(--muted); font-size: 11px; line-height: 1.6; }

/* Toast */
.toast-region {
  position: fixed;
  z-index: 200;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  width: min(calc(100% - 26px), 405px);
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  min-height: 58px;
  padding: 12px 42px 12px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  border: 1px solid #edf0f2;
  border-radius: 10px;
  color: #23282e;
  background: #fff;
  box-shadow: 0 8px 25px rgba(21, 28, 39, .22);
  font-size: 11px;
  line-height: 1.45;
  animation: toastIn .2s ease both;
}
.toast-icon {
  width: 39px;
  height: 39px;
  flex: 0 0 39px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: #15a56f;
  font-size: 20px;
  font-weight: 700;
}
.toast.info .toast-icon { background: #1bafc4; }
.toast.error .toast-icon { background: #e34a53; }
.toast-close { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: #676e76; font-size: 19px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* Success */
.success-screen { padding: calc(14px + env(safe-area-inset-top)) 22px calc(30px + env(safe-area-inset-bottom)); background: #f6f8fb; align-items: flex-start; }
.receipt-card {
  width: 100%;
  max-width: 390px;
  min-height: 700px;
  margin: 0 auto;
  padding: 34px 34px 27px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(25, 39, 61, .08);
  text-align: center;
}
.success-check { width: 72px; height: 72px; margin: 0 auto 24px; display: grid; place-items: center; color: var(--green-bright); }
.success-check svg { width: 67px; height: 67px; stroke-width: 3; }
.receipt-card h1 { margin: 0; font-size: 20px; line-height: 1.35; font-weight: 700; }
.success-amount { margin: 14px 0 0; color: var(--green); font-size: 22px; line-height: 1.3; font-weight: 700; }
.success-message { margin: 19px 0 0; color: #737a83; font-size: 13px; line-height: 1.6; }
.success-message strong { color: #30353b; font-weight: 600; }
.status-pill { margin-top: 11px; padding: 4px 11px; display: inline-block; border-radius: 999px; color: #fff; background: var(--green); font-size: 10px; line-height: 1.2; font-weight: 500; }
.receipt-divider { height: 1px; margin: 30px 0 23px; background: #e6e8eb; }
.receipt-details { margin: 0; }
.receipt-details > div { min-height: 50px; display: grid; grid-template-columns: 1fr 1.5fr; gap: 14px; align-items: start; }
.receipt-details dt { color: #777e86; font-size: 11px; line-height: 1.5; text-align: left; }
.receipt-details dd { margin: 0; color: #20252b; font-size: 11px; line-height: 1.5; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.receipt-details dd.receipt-id { font-size: 10px; }
.bottom-divider { margin: 7px 0 22px; }
.powered-by { margin: 0; color: #858b93; font-size: 9px; line-height: 1.7; }

@media (max-width: 699px) {
  html,
  body { overscroll-behavior-y: none; }

  .screen { padding-top: 0; }

  .registration-card,
  .compact-card { padding-top: calc(104px + env(safe-area-inset-top)); }

  .payment-header {
    position: fixed;
    top: 0;
    left: 50%;
    width: 100%;
    max-width: 430px;
    margin: 0;
    padding: calc(25px + env(safe-area-inset-top)) 34px 12px;
    transform: translateX(-50%);
    background: #fff;
  }
}

@media (min-width: 700px) {
  body { background: #f4f7fb; }
  .screen { padding: 32px 0; background: #f4f7fb; align-items: flex-start; }
  .content-card { border-radius: 24px; box-shadow: var(--shadow); }
  .modal-backdrop { background: rgba(19, 29, 45, .35); align-items: center; padding: 24px; }
  .confirm-sheet { min-height: min(760px, calc(100svh - 48px)); max-height: calc(100svh - 48px); border-radius: 24px; box-shadow: 0 22px 65px rgba(18, 31, 52, .2); }
  .success-screen { align-items: center; }
}

@media (max-width: 370px) {
  .registration-card,
  .compact-card { padding-left: 25px; padding-right: 25px; }
  .confirm-sheet { padding-left: 20px; padding-right: 20px; }
  .receipt-card { padding-left: 25px; padding-right: 25px; }
  .primary-button { font-size: 12px; }
}
