/* Receipt verification dialog: frosted glass over soft colour blobs. */

.overlay.receipt-verify-overlay {
  align-items: center;
  overflow: hidden;
  background:
    radial-gradient(420px 320px at 85% 12%, rgba(91, 123, 255, .55), transparent 70%),
    radial-gradient(380px 300px at 10% 88%, rgba(155, 107, 255, .45), transparent 70%),
    radial-gradient(300px 240px at 45% 55%, rgba(44, 196, 216, .32), transparent 70%),
    rgba(20, 24, 40, .45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

html[data-theme="dark"] .overlay.receipt-verify-overlay {
  background:
    radial-gradient(420px 320px at 85% 12%, rgba(91, 123, 255, .32), transparent 70%),
    radial-gradient(380px 300px at 10% 88%, rgba(155, 107, 255, .28), transparent 70%),
    radial-gradient(300px 240px at 45% 55%, rgba(44, 196, 216, .18), transparent 70%),
    rgba(6, 8, 16, .66);
}

.modal.receipt-verify {
  --rv-ink: var(--text1, #17213c);
  --rv-soft: var(--text2, #44506e);
  --rv-edge: rgba(255, 255, 255, .7);
  --rv-field: rgba(255, 255, 255, .5);
  max-width: 400px;
  padding: 16px;
  border-radius: 30px;
  border: 1px solid var(--rv-edge);
  color: var(--rv-ink);
  background:
    linear-gradient(140deg, rgba(255, 255, 255, .3), transparent 45%),
    rgba(255, 255, 255, .42);
  backdrop-filter: blur(22px) saturate(170%);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  box-shadow:
    0 30px 70px rgba(40, 52, 120, .3),
    inset 0 1px 0 rgba(255, 255, 255, .9),
    inset 0 -1px 0 rgba(255, 255, 255, .06);
  animation: rvPop .7s cubic-bezier(.2, .9, .3, 1.1) both;
}

html[data-theme="dark"] .modal.receipt-verify {
  --rv-ink: #f2f5ff;
  --rv-soft: #b9c3db;
  --rv-edge: rgba(255, 255, 255, .16);
  --rv-field: rgba(255, 255, 255, .07);
  background:
    linear-gradient(140deg, rgba(255, 255, 255, .1), transparent 45%),
    rgba(24, 30, 52, .5);
  box-shadow:
    0 30px 70px rgba(0, 0, 0, .6),
    inset 0 1px 0 rgba(255, 255, 255, .14);
}

.receipt-verify > * {
  animation: rvRise .6s cubic-bezier(.2, .9, .3, 1.1) both;
}

.receipt-verify > *:nth-child(2) { animation-delay: .08s; }
.receipt-verify > *:nth-child(3) { animation-delay: .16s; }
.receipt-verify > *:nth-child(4) { animation-delay: .24s; }

@keyframes rvPop {
  from {
    opacity: 0;
    transform: translateY(30px) scale(.92);
    filter: blur(10px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

@keyframes rvRise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- head ---------- */
.receipt-verify .rv-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--rv-edge);
  border-radius: 22px;
  background:
    radial-gradient(200px 90px at 100% 0%, rgba(104, 125, 255, .38), transparent),
    linear-gradient(135deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .04));
}

.receipt-verify .rv-icon {
  position: relative;
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #fff;
  font-size: 26px;
  background: linear-gradient(145deg, #7c9bff, #5069dc 55%, #7a4fe0);
  box-shadow:
    0 10px 24px rgba(80, 105, 220, .5),
    inset 0 1px 0 rgba(255, 255, 255, .5);
}

.receipt-verify .rv-icon::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 2px solid rgba(124, 155, 255, .55);
  border-radius: 22px;
  animation: rvRing 2.4s ease-out infinite;
}

@keyframes rvRing {
  from {
    transform: scale(.9);
    opacity: .9;
  }
  to {
    transform: scale(1.25);
    opacity: 0;
  }
}

.receipt-verify .rv-head small {
  display: block;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  color: transparent;
  background: linear-gradient(90deg, #5069dc, #9b6bff);
  -webkit-background-clip: text;
  background-clip: text;
}

html[data-theme="dark"] .receipt-verify .rv-head small {
  background: linear-gradient(90deg, #9db2ff, #c4a8ff);
  -webkit-background-clip: text;
  background-clip: text;
}

.receipt-verify .rv-head h3 {
  margin: 2px 0 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.5;
}

/* ---------- field ---------- */
.receipt-verify .rv-field {
  margin: 0 0 14px;
}

.receipt-verify .rv-field label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 700;
}

.receipt-verify .rv-field .ui-label-icon {
  display: none;
}

.receipt-verify .rv-field label i {
  color: #5b7bff;
  font-size: 16px;
}

.receipt-verify .rv-input {
  padding: 1.5px;
  border-radius: 16px;
  background: linear-gradient(120deg, #5b7bff, #9b6bff, #2cc4d8, #5b7bff);
  background-size: 300% 100%;
  animation: rvFlow 5s linear infinite;
}

.receipt-verify .rv-input.is-bad {
  background: linear-gradient(120deg, #e0785a, #f0a48e);
  animation: rvShake .45s;
}

@keyframes rvFlow {
  to { background-position: 300% 0; }
}

@keyframes rvShake {
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

.receipt-verify .rv-input input {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 0;
  border-radius: 15px;
  outline: 0;
  color: var(--rv-ink);
  background: var(--rv-field);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: var(--font-mono, ui-monospace, Consolas, monospace);
  font-size: 16px;
  letter-spacing: 1.5px;
  text-align: center;
  direction: ltr;
}

.receipt-verify .rv-input input::placeholder {
  color: var(--rv-soft);
  opacity: .7;
}

.receipt-verify .rv-hint {
  margin: 7px 2px 0;
  color: var(--rv-soft);
  font-size: 12px;
  line-height: 1.7;
}

/* ---------- result ---------- */
.receipt-verify .rv-result:empty {
  display: none;
}

.receipt-verify .rv-result {
  margin-bottom: 4px;
}

.receipt-verify .rv-card {
  margin-bottom: 12px;
  padding: 4px 14px;
  border: 1px solid var(--rv-edge);
  border-radius: 18px;
  background: var(--rv-field);
}

.receipt-verify .rv-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--rv-edge);
  font-size: 13px;
  animation: rvRise .5s both;
}

.receipt-verify .rv-row:nth-child(2) { animation-delay: .08s; }
.receipt-verify .rv-row:nth-child(3) { animation-delay: .16s; }
.receipt-verify .rv-row:nth-child(4) { animation-delay: .24s; }

.receipt-verify .rv-row:last-child {
  border-bottom: 0;
}

.receipt-verify .rv-row span {
  color: var(--rv-soft);
}

.receipt-verify .rv-row b {
  font-weight: 700;
}

.receipt-verify .rv-code {
  color: #5b7bff;
  letter-spacing: .5px;
}

html[data-theme="dark"] .receipt-verify .rv-code {
  color: #9db2ff;
}

.receipt-verify .rv-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid;
  border-radius: 16px;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.7;
}

.receipt-verify .rv-note small {
  display: block;
  font-size: 11.5px;
  font-weight: 400;
  opacity: .85;
}

.receipt-verify .rv-note i {
  font-size: 20px;
  animation: rvPip .6s cubic-bezier(.2, 1.6, .4, 1) both;
}

@keyframes rvPip {
  from {
    transform: scale(0) rotate(-40deg);
  }
  to {
    transform: none;
  }
}

.receipt-verify .rv-note.is-ok {
  border-color: rgba(63, 174, 114, .45);
  color: #17753f;
  background: linear-gradient(120deg, rgba(63, 174, 114, .28), rgba(63, 174, 114, .08));
}

.receipt-verify .rv-note.is-error {
  border-color: rgba(224, 120, 90, .45);
  color: #a93d24;
  background: linear-gradient(120deg, rgba(224, 120, 90, .28), rgba(224, 120, 90, .08));
}

html[data-theme="dark"] .receipt-verify .rv-note.is-ok { color: #8be3ae; }
html[data-theme="dark"] .receipt-verify .rv-note.is-error { color: #f4ae98; }

/* ---------- actions ---------- */
.receipt-verify .rv-actions {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.receipt-verify .rv-actions .btn {
  position: relative;
  margin: 0;
  overflow: hidden;
  min-height: 50px;
  border-radius: 17px;
  transition: transform .25s cubic-bezier(.2, .9, .3, 1.1), box-shadow .25s ease;
}

.receipt-verify .rv-actions .btn:hover {
  transform: translateY(-3px);
}

.receipt-verify .rv-actions .btn-primary {
  border: 0;
  color: #fff;
  background: linear-gradient(120deg, #5b7bff, #7a55f0, #4fa3f0, #5b7bff);
  background-size: 250% 100%;
  animation: rvFlow 6s linear infinite;
  box-shadow:
    0 14px 28px rgba(91, 100, 240, .45),
    inset 0 1px 0 rgba(255, 255, 255, .4);
}

.receipt-verify .rv-actions .btn-primary::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -80px;
  width: 60px;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: skewX(-20deg);
  animation: rvSheen 3.2s ease-in-out infinite;
}

@keyframes rvSheen {
  60%, 100% { left: 120%; }
}

.receipt-verify .rv-actions .btn-ghost {
  border: 1px solid var(--rv-edge);
  color: var(--rv-ink);
  background: linear-gradient(135deg, rgba(255, 255, 255, .3), rgba(255, 255, 255, .08));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

@media (prefers-reduced-motion: reduce) {
  .modal.receipt-verify,
  .receipt-verify *,
  .receipt-verify *::after {
    animation: none !important;
  }
}
