:root {
  color-scheme: dark;
  --ink: #f5f7fb;
  --muted: #767d89;
  --muted-bright: #aab1bc;
  --line: rgba(186, 196, 212, 0.22);
  --line-soft: rgba(186, 196, 212, 0.12);
  --glass: rgba(24, 29, 37, 0.58);
  --glass-deep: rgba(13, 17, 23, 0.74);
  --blue: #1677FF;
  --blue-deep: #1264E8;
  --radius: 22px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; background: #080a0e; }

body {
  min-height: 100svh;
  color: var(--ink);
  background:
    radial-gradient(80% 34% at 50% -6%, rgba(83, 96, 118, 0.16), transparent 72%),
    radial-gradient(56% 35% at 0% 50%, rgba(38, 47, 64, 0.10), transparent 78%),
    linear-gradient(145deg, #13171e 0%, #090b10 38%, #05070a 100%);
}

button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.cashier-app {
  position: relative;
  width: 100%;
  min-height: 100svh;
  margin: 0;
  padding: max(20px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  overflow: hidden;
  isolation: isolate;
}

.cashier-app::before,
.cashier-app::after {
  position: absolute;
  z-index: -1;
  display: block;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  content: "";
  filter: blur(70px);
  opacity: 0.18;
  pointer-events: none;
}

.cashier-app::before { top: 11%; left: -180px; background: #4b586d; }
.cashier-app::after { right: -190px; bottom: 15%; background: #1d3559; opacity: 0.13; }

.topbar { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; height: 52px; }
.topbar h1 { margin: 0; text-align: center; font-size: 20px; font-weight: 600; letter-spacing: .01em; }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; color: #f4f6fa; background: transparent; cursor: pointer; }
.icon-button svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.topbar-balance { width: 44px; height: 44px; }

.glass-panel,
.glass-key {
  position: relative;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(54, 62, 75, 0.18), rgba(10, 13, 18, 0.66) 54%, rgba(71, 82, 99, 0.13));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), inset 0 -1px 0 rgba(0, 0, 0, 0.28), 0 16px 34px rgba(0, 0, 0, 0.16);
  -webkit-backdrop-filter: blur(22px) saturate(125%);
  backdrop-filter: blur(22px) saturate(125%);
}

.glass-panel::before,
.glass-key::before {
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(111deg, rgba(255, 255, 255, 0.10), transparent 21% 72%, rgba(255, 255, 255, 0.035));
  content: "";
  opacity: .48;
  pointer-events: none;
}

.merchant-card { display: flex; align-items: center; min-height: 112px; margin-top: 14px; padding: 18px 20px; border-radius: var(--radius); overflow: hidden; }
.merchant-mark { flex: 0 0 auto; display: grid; place-items: center; width: 32px; height: 36px; margin-right: 14px; color: #b7c0cf; }
.merchant-mark svg { width: 28px; height: 32px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.merchant-copy { position: relative; z-index: 1; min-width: 0; }
.merchant-copy h2 { margin: 0 0 7px; font-size: 22px; font-weight: 520; letter-spacing: .01em; }
.merchant-copy p { max-width: 205px; margin: 0; color: var(--muted-bright); font-size: 13px; line-height: 1.55; }
.metal-emblem { position: absolute; right: 4px; bottom: -7px; width: 155px; height: 102px; opacity: .8; transform: rotate(-2deg); }
.metal-emblem svg { width: 100%; height: 100%; overflow: visible; }
.emblem-back, .emblem-mid, .emblem-shield { stroke: rgba(208, 218, 232, .40); stroke-width: 1; }
.emblem-back { fill: rgba(104, 115, 132, .13); }
.emblem-mid { fill: rgba(161, 171, 188, .10); }
.emblem-shield { fill: linear-gradient(#fff, #555); fill: rgba(176, 188, 206, .27); }
.emblem-yen { fill: none; stroke: rgba(237, 242, 249, .82); stroke-linecap: round; stroke-linejoin: round; stroke-width: 3; }
.emblem-orbit { fill: none; stroke: rgba(205, 217, 236, .42); stroke-linecap: round; stroke-width: 1; }

.amount-area { margin-top: clamp(64px, 9vh, 88px); }
.amount-card { border-radius: 20px; overflow: hidden; }
.amount-field { display: flex; align-items: center; min-height: 96px; padding: 0 24px; cursor: text; }
.currency { flex: 0 0 auto; margin-right: 14px; color: #f5f7fb; font-size: 32px; font-weight: 520; }
.amount-field input { width: 100%; min-width: 0; padding: 0; border: 0; outline: none; color: #f5f7fb; background: transparent; font-size: 28px; font-weight: 460; letter-spacing: .02em; }
.amount-field input::placeholder { color: #5b626e; opacity: 1; }
.text-caret { width: 2px; height: 40px; margin-left: 4px; border-radius: 2px; background: var(--blue); box-shadow: 0 0 10px rgba(22, 119, 255, .22); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: .25; } }
.security-note { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 12px 0 0; color: #727a87; font-size: 13px; }
.mini-shield { display: inline-grid; place-items: center; width: 18px; height: 20px; }
.mini-shield svg { width: 16px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.35; }

.note-divider { display: flex; align-items: center; gap: 20px; margin: clamp(44px, 7vh, 64px) 10px 14px; color: var(--blue); font-size: 14px; font-weight: 520; }
.note-divider::before, .note-divider::after { height: 1px; flex: 1; background: linear-gradient(90deg, transparent, rgba(171, 182, 199, .24)); content: ""; }
.note-divider::after { background: linear-gradient(90deg, rgba(171, 182, 199, .24), transparent); }

.keypad { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(4, 54px); gap: 5px; }
.key, .pay-key { display: grid; place-items: center; min-width: 0; padding: 0; border-radius: 15px; font-size: 26px; font-weight: 420; line-height: 1; cursor: pointer; touch-action: manipulation; transition: transform .16s ease, border-color .16s ease, background .16s ease; }
.glass-key { color: #f4f6fa; }
.glass-key:hover, .glass-key:focus-visible { border-color: rgba(222, 230, 241, .46); background: rgba(69, 78, 92, .35); outline: none; }
.glass-key:active, .pay-key:active { transform: scale(.975); }
.utility-key svg { position: relative; z-index: 1; width: 27px; height: 22px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.65; }
.zero-key { grid-column: span 2; }
.pay-key { position: relative; z-index: 1; grid-column: 4; grid-row: 2 / span 3; border: 1px solid rgba(109, 178, 255, .82); color: #fff; background: linear-gradient(180deg, #1677FF, #1264E8); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .26), inset 0 -1px 0 rgba(0, 28, 100, .24), 0 12px 25px rgba(8, 73, 181, .20); }
.pay-key::before { position: absolute; inset: 1px; border-radius: inherit; background: linear-gradient(115deg, rgba(255,255,255,.18), transparent 35% 78%, rgba(255,255,255,.06)); content: ""; pointer-events: none; }
.pay-key:disabled { cursor: wait; opacity: .58; }
.feedback { min-height: 20px; margin: 12px 8px 0; color: #aeb7c5; text-align: center; font-size: 12px; }
.feedback.is-error { color: #f294a6; }
.feedback.is-success { color: #94c4ff; }
.site-footer { margin: 16px auto 0; color: #5f6876; text-align: center; font-size: 10px; line-height: 1.4; letter-spacing: .04em; }

[hidden] { display: none !important; }
body.is-processing { overflow: hidden; }
.payment-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 5, 9, .76);
  -webkit-backdrop-filter: blur(16px) saturate(110%);
  backdrop-filter: blur(16px) saturate(110%);
}
.payment-overlay-card {
  width: min(100%, 340px);
  padding: 34px 28px 30px;
  border: 1px solid rgba(186, 198, 217, .25);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(39, 47, 60, .82), rgba(9, 12, 17, .94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10), 0 22px 60px rgba(0, 0, 0, .45);
  text-align: center;
}
.payment-spinner {
  position: relative;
  width: 54px;
  height: 54px;
  margin: 0 auto 22px;
  border: 2px solid rgba(158, 181, 215, .18);
  border-top-color: var(--blue);
  border-right-color: rgba(72, 150, 255, .72);
  border-radius: 50%;
  animation: payment-spin .9s linear infinite;
}
.payment-spinner::after {
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(255, 255, 255, .11);
  border-bottom-color: rgba(22, 119, 255, .68);
  border-radius: 50%;
  content: "";
  animation: payment-spin 1.4s linear infinite reverse;
}
@keyframes payment-spin { to { transform: rotate(360deg); } }
.payment-kicker { margin: 0 0 10px; color: #7f9bc1; font-size: 10px; font-weight: 650; letter-spacing: .18em; }
.payment-overlay-card h2 { margin: 0; color: #f5f7fb; font-size: 22px; font-weight: 600; }
.payment-message { min-height: 22px; margin: 12px 0 20px; color: #aab4c4; font-size: 13px; }
.payment-progress { width: min(100%, 260px); height: 4px; margin: -2px auto 18px; overflow: hidden; border: 1px solid rgba(158, 181, 215, .20); border-radius: 999px; background: rgba(8, 13, 22, .68); }
.payment-progress-fill { display: block; width: 100%; height: 100%; transform: scaleX(0); transform-origin: left center; border-radius: inherit; background: linear-gradient(90deg, #1264e8, #5ba3ff); box-shadow: 0 0 12px rgba(22, 119, 255, .54); animation: payment-progress-fill 25s linear forwards; }
@keyframes payment-progress-fill { to { transform: scaleX(1); } }
.payment-security-status { display: inline-flex; align-items: center; gap: 8px; color: #8fbfff; font-size: 12px; }
.payment-status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 12px rgba(22, 119, 255, .72); animation: payment-pulse 1.2s ease-in-out infinite; }
@keyframes payment-pulse { 50% { opacity: .35; transform: scale(.72); } }

@media (max-height: 760px) {
  .cashier-app { padding: max(16px, env(safe-area-inset-top)) 18px max(16px, env(safe-area-inset-bottom)); }
  .topbar { height: 50px; }
  .merchant-card { min-height: 104px; margin-top: 10px; padding: 16px; }
  .merchant-copy h2 { margin-bottom: 5px; font-size: 21px; }
  .amount-area { margin-top: 40px; }
  .amount-field { min-height: 88px; padding: 0 20px; }
  .currency { margin-right: 12px; font-size: 30px; }
  .amount-field input { font-size: 26px; }
  .text-caret { height: 36px; }
  .security-note { margin-top: 10px; }
  .note-divider { margin-top: 36px; margin-bottom: 12px; }
  .keypad { grid-template-rows: repeat(4, 48px); gap: 5px; }
  .key, .pay-key { border-radius: 14px; font-size: 24px; }
}
