/* payit prototype — Light Mint design tokens and components */
:root {
  --ground: #F7F9F8;
  --surface: #FFFFFF;
  --ink: #0B2E22;
  --muted: #5B6661;
  --sub: #3F6656;
  --line: #E6E9E7;
  --line-soft: #EEF0EF;
  --mint: #DCEFE5;
  --tint: #E1EFE7;
  --mint-line: #9CC7B3;
  --green: #0B6E4F;
  --green-press: #08523B;
  --danger: #B42318;
  --danger-bg: #FEE4E2;
  --warn: #93370D;
  --warn-bg: #FEF0C7;
  --tile: #EEF3F0;
  --radius-l: 24px;
  --radius-m: 18px;
  --radius-s: 14px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-h: 72px;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--ground); }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button, input { font-family: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--green); }
h1, h2, h3 { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- app frame ---------- */
.app { max-width: 480px; margin: 0 auto; min-height: 100%; position: relative; background: var(--ground); }
.screen { min-height: 100dvh; display: flex; flex-direction: column; padding-top: calc(var(--safe-top) + 12px); }
.page-enter { animation: enter .22s ease-out; }
.screen.white { background: var(--surface); }
.screen.with-nav { padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px); }
.screen.with-footer { padding-bottom: calc(150px + var(--safe-bottom)); }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.pad { padding: 0 20px; }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; } .gap-24 { gap: 24px; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; align-items: center; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; height: 44px; padding: 0 20px; gap: 8px; }
.topbar h1 { flex: 1; text-align: center; font-size: 16px; font-weight: 700; }
.topbar .sub { font-size: 12px; color: var(--muted); font-weight: 400; display: block; }
.topbar .spacer { width: 44px; }
.icon-btn { width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.icon-btn:active { background: var(--line-soft); }
.title-xl { font-size: 30px; font-weight: 800; letter-spacing: -0.8px; }
.title-l { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; }
.section-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.section-title { font-size: 17px; font-weight: 700; letter-spacing: -0.2px; }

/* ---------- buttons ---------- */
.btn { height: 56px; border-radius: var(--radius-m); border: none; background: var(--green); color: #fff; font-size: 17px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; transition: transform .08s, background .15s; }
.btn:active { transform: scale(.985); background: var(--green-press); }
.btn[disabled] { background: var(--line); color: #4A5551; transform: none; cursor: not-allowed; }
.btn.secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line); font-size: 16px; font-weight: 600; height: 52px; }
.btn.secondary:active { background: var(--line-soft); }
.btn.ghost { background: transparent; color: var(--sub); height: 44px; font-size: 15px; font-weight: 600; }
.btn.danger-text { background: transparent; color: var(--danger); height: 44px; font-size: 15px; font-weight: 600; }
.btn.small { height: 40px; width: auto; padding: 0 16px; font-size: 14px; border-radius: 20px; }
.btn .spinner { width: 20px; height: 20px; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.chip { height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 500; white-space: nowrap; }
.chip.on { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
.chip.soft-on { background: var(--mint); border-color: var(--mint); font-weight: 600; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.link-btn { background: none; border: none; color: var(--green); font-size: 14px; font-weight: 600; padding: 8px 0; }

/* ---------- footer (sticky bottom actions) ---------- */
.footer { position: fixed; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; bottom: 0; padding: 12px 20px calc(var(--safe-bottom) + 20px); background: linear-gradient(to top, var(--bg, var(--ground)) 75%, transparent); display: flex; flex-direction: column; gap: 10px; z-index: 5; }
.screen.white .footer { --bg: var(--surface); }
.footnote { text-align: center; font-size: 12px; color: var(--muted); line-height: 1.4; display: flex; align-items: center; justify-content: center; gap: 6px; }

/* ---------- cards & lists ---------- */
.card { background: var(--surface); border-radius: 20px; }
.card.bordered { border: 1px solid var(--line); }
.list { background: var(--surface); border-radius: 20px; padding: 0 14px; }
.list-item { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; text-decoration: none; color: var(--ink); font-size: inherit; }
.list-item:last-child { border-bottom: none; }
.list-item:active { opacity: .7; }
.li-title { font-size: 15px; font-weight: 600; }
.li-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.li-right { text-align: right; }
.li-amount { font-size: 15px; font-weight: 700; }
.mono { width: 40px; height: 40px; border-radius: 12px; background: var(--tile); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; flex: none; color: var(--ink); }
.mono.sm { width: 34px; height: 34px; border-radius: 10px; font-size: 10px; }
.chev { color: var(--muted); flex: none; }
.low { color: var(--danger); }
.pill { font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 8px; display: inline-block; }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.green { background: var(--green); color: #fff; }
.pill.mint { background: var(--mint); color: var(--ink); }
.info { display: flex; align-items: flex-start; gap: 10px; padding: 14px; border-radius: 16px; background: var(--mint); font-size: 13px; line-height: 1.4; }
.info svg { flex: none; margin-top: 1px; }
.dashed { border: 1.5px dashed #CBD1CE; border-radius: 20px; padding: 22px 20px; }
.skeleton { background: linear-gradient(90deg, var(--line-soft), #f6f7f6, var(--line-soft)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 6px; display: inline-block; height: 14px; width: 60px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- home ---------- */
.home-head { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 20px; }
.avatar { width: 40px; height: 40px; border-radius: 20px; border: none; background: var(--mint); color: var(--ink); font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }
.hero-strip { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 20px; scrollbar-width: none; }
.hero-strip::-webkit-scrollbar { display: none; }
.hero { flex: 0 0 calc(100% - 40px); max-width: 360px; scroll-snap-align: start; min-height: 196px; border-radius: var(--radius-l); background: var(--mint); padding: 20px; display: flex; flex-direction: column; justify-content: space-between; gap: 14px; }
.hero .mono { background: var(--surface); width: 36px; height: 36px; border-radius: 10px; }
.hero-amount { font-size: 44px; font-weight: 700; letter-spacing: -1.5px; line-height: 1; }
.hero-amount small { font-size: 24px; color: var(--sub); letter-spacing: -0.5px; }
.hero .btn { height: 44px; font-size: 15px; border-radius: var(--radius-s); }
.hero .btn.outline { background: transparent; border: 1px solid var(--mint-line); color: var(--ink); width: auto; padding: 0 16px; font-weight: 600; white-space: nowrap; flex: none; }
.hero:only-child { flex-basis: 100%; max-width: none; }
.dots { display: flex; justify-content: center; gap: 6px; margin-top: 12px; }
.dots span { width: 6px; height: 6px; border-radius: 3px; background: #C5CBC8; transition: width .2s; }
.dots span.on { width: 18px; background: var(--green); }
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 0 20px; }
.quick button { background: none; border: none; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 0; }
.quick .q-ico { width: 56px; height: 56px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--green); }
.quick button:active .q-ico { background: var(--mint); }
.setup { background: var(--mint); border-radius: var(--radius-l); padding: 20px; display: flex; flex-direction: column; gap: 12px; margin: 0 20px; }
.progress { height: 6px; border-radius: 3px; background: var(--surface); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--green); border-radius: 3px; }
.setup-step { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 12px; border-radius: 16px; background: var(--surface); border: none; text-align: left; width: 100%; }
.step-num { width: 32px; height: 32px; border-radius: 16px; border: 2px solid var(--mint-line); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex: none; }
.step-num.done { background: var(--green); border-color: var(--green); color: #fff; }

/* ---------- bottom nav ---------- */
.nav { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 480px; height: calc(var(--nav-h) + var(--safe-bottom)); padding-bottom: var(--safe-bottom); background: var(--surface); border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-around; z-index: 10; }
.nav button { background: none; border: none; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 96px; font-size: 11px; font-weight: 600; color: var(--muted); }
.nav button.on { color: var(--ink); font-weight: 700; }
.nav .nav-pay { flex-direction: row; justify-content: center; gap: 8px; height: 48px; width: 132px; border-radius: 24px; background: var(--green); color: #fff; font-size: 15px; font-weight: 700; }
.nav .nav-pay.on { color: #fff; box-shadow: 0 0 0 3px var(--mint); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 13px; font-weight: 600; }
.input { height: 52px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--surface); padding: 0 14px; font-size: 16px; outline: none; width: 100%; min-width: 0; }
.input:focus { border: 2px solid var(--green); padding: 0 13px; }
.input.big { height: 56px; font-size: 17px; font-weight: 600; }
.input.error { border-color: var(--danger); }
.prefix { height: 52px; padding: 0 14px; border-radius: var(--radius-s); background: var(--surface); border: 1px solid var(--line); display: flex; align-items: center; font-size: 16px; font-weight: 600; flex: none; }
.field-error { font-size: 13px; color: var(--danger); }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--muted); line-height: 1.4; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--green); flex: none; }
.switch { position: relative; width: 52px; height: 32px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 16px; background: #CBD1CE; transition: background .15s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 13px; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(20px); }
.search { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.search input { flex: 1; border: none; outline: none; background: transparent; font-size: 15px; color: var(--ink); min-width: 0; }

/* ---------- code boxes ---------- */
.code-wrap { position: relative; }
.code-wrap input { position: absolute; inset: 0; opacity: 0; font-size: 16px; }
.code-boxes { display: flex; gap: 10px; }
.code-boxes div { flex: 1; height: 64px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700; }
.code-boxes div.filled { border-color: #CFE3D8; }
.code-boxes div.focus { border: 2px solid var(--green); }
.code-boxes.error div { border-color: var(--danger); animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* ---------- amount & keypad ---------- */
.amount-display { display: flex; align-items: baseline; justify-content: center; gap: 6px; min-height: 84px; padding-top: 8px; }
.amount-display .num { font-size: 72px; font-weight: 700; letter-spacing: -3px; line-height: 1; }
.amount-display .num.long { font-size: 52px; }
.amount-display .cur { font-size: 26px; font-weight: 600; color: var(--muted); }
.amount-display .caret { width: 3px; height: 56px; background: var(--green); align-self: center; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.keypad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.keypad button { height: 56px; border: none; border-radius: 16px; background: transparent; font-size: 26px; font-weight: 500; }
.keypad button:active { background: var(--line-soft); }
.card-pick { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 0 14px; border-radius: var(--radius-m); border: 1px solid var(--line); background: var(--ground); width: 100%; text-align: left; }
.card-pick.empty { border: 1.5px dashed #86BFA9; background: #F1F8F5; }
.mini-card { width: 44px; height: 30px; border-radius: 6px; background: var(--ink); position: relative; flex: none; }
.mini-card::after { content: ''; position: absolute; left: 6px; top: 8px; width: 10px; height: 8px; border-radius: 2px; background: #D4B46A; }
.mini-card.vnesh { background: #3A4A6B; }
.mini-card.rysgal { background: #6B2D3A; }
.mini-card.senagat { background: #2F5D50; }
.plus-tile { width: 40px; height: 40px; border-radius: 12px; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }

/* ---------- bank card visual ---------- */
.bank-card { border-radius: 22px; padding: 20px; background: var(--mint); min-height: 180px; display: flex; flex-direction: column; justify-content: space-between; }
.bank-card .num { font-size: 21px; font-weight: 600; letter-spacing: 2px; }
.bank-card .chip-ico { width: 38px; height: 28px; border-radius: 6px; background: #C9A75E; }

/* ---------- receipt / status ---------- */
.status-ico { width: 72px; height: 72px; border-radius: 36px; display: flex; align-items: center; justify-content: center; animation: pop .35s ease-out; }
.status-ico.ok { background: var(--tint); color: var(--green); }
.status-ico.bad { background: var(--danger-bg); color: var(--danger); }
.status-ico.wait { background: var(--warn-bg); color: var(--warn); }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
.receipt-row { display: flex; justify-content: space-between; align-items: center; min-height: 44px; border-bottom: 1px solid var(--line-soft); font-size: 14px; gap: 12px; }
.receipt-row:last-child { border-bottom: none; }
.receipt-row span:first-child { color: var(--muted); }
.receipt-row span:last-child { font-weight: 600; text-align: right; }
.big-amount { font-size: 44px; font-weight: 700; letter-spacing: -1.5px; line-height: 1.1; }
.big-amount small { font-size: 26px; }
.summary { background: var(--mint); border-radius: 20px; padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }

/* ---------- sheet ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(11,46,34,.35); z-index: 40; animation: fade .2s; }
.sheet { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 480px; max-height: 85dvh; overflow-y: auto; background: var(--surface); border-radius: 24px 24px 0 0; padding: 10px 20px calc(var(--safe-bottom) + 20px); z-index: 41; animation: up .25s ease-out; }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
.sheet h2 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
.option { display: flex; align-items: center; gap: 12px; min-height: 60px; width: 100%; border: none; background: none; border-bottom: 1px solid var(--line-soft); text-align: left; padding: 8px 0; }
.option:last-child { border-bottom: none; }
.radio { width: 22px; height: 22px; border-radius: 11px; border: 2px solid #CBD1CE; flex: none; }
.radio.on { border: 7px solid var(--green); }

/* ---------- fake SMS banner ---------- */
#sms-layer { position: fixed; top: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; z-index: 60; pointer-events: none; padding: calc(var(--safe-top) + 8px) 10px 0; }
.sms { pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; border: none; background: rgba(250,250,250,.97); backdrop-filter: blur(12px); border-radius: 20px; padding: 12px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.18); animation: drop .35s cubic-bezier(.2,.9,.3,1.2); margin-bottom: 8px; }
.sms .sms-ico { width: 38px; height: 38px; border-radius: 10px; background: #34C759; color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.sms .from { font-size: 14px; font-weight: 700; }
.sms .when { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: auto; }
.sms .text { font-size: 14px; line-height: 1.35; margin-top: 2px; }
.sms .tap { font-size: 12px; color: var(--green); font-weight: 600; margin-top: 4px; }
.sms.out { animation: rise .3s forwards; }
@keyframes drop { from { transform: translateY(-120%); } to { transform: none; } }
@keyframes rise { to { transform: translateY(-140%); opacity: 0; } }

/* ---------- toast ---------- */
#toast-layer { position: fixed; left: 50%; transform: translateX(-50%); top: calc(var(--safe-top) + 64px); z-index: 70; width: max-content; max-width: 90%; pointer-events: none; }
.toast { background: var(--ink); color: #fff; font-size: 14px; font-weight: 500; padding: 12px 16px; border-radius: 14px; animation: fade .2s; box-shadow: 0 6px 20px rgba(0,0,0,.2); }

/* ---------- fake bank page ---------- */
.bankpage { background: #EEF1F6; min-height: 100dvh; color: #1C2433; display: flex; flex-direction: column; }
.bankpage .bar { background: #1F3A68; color: #fff; padding: calc(var(--safe-top) + 14px) 20px 14px; display: flex; align-items: center; gap: 10px; }
.bankpage .lock { font-size: 12px; opacity: .85; display: flex; align-items: center; gap: 4px; }
.bankpage .box { background: #fff; margin: 20px; border-radius: 12px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.08); display: flex; flex-direction: column; gap: 12px; }
.bankpage .bank-btn { height: 50px; border-radius: 8px; border: none; font-size: 16px; font-weight: 700; }
.bankpage .approve { background: #1F3A68; color: #fff; }
.bankpage .decline { background: #fff; color: #1F3A68; border: 1px solid #C5CEDD; }
