:root {
  --bg:#0a2540;
  --card:rgba(255,255,255,.07);
  --line:rgba(255,255,255,.12);
  --cyan:#00c2ff;
  --green:#00e5a0;
  --red:#ff4d6a;
  --gold:#c9a84c;
  --text:#f4f8ff;
  --muted:rgba(244,248,255,.62);
}

* { box-sizing:border-box; }
body {
  margin:0;
  min-height:100vh;
  background:
    radial-gradient(circle at 50% -10%, rgba(0,194,255,.16), transparent 30rem),
    var(--bg);
  color:var(--text);
  font-family:Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app { width:min(1120px,100%); margin:0 auto; padding:28px 18px 70px; }
.hero {
  border:1px solid rgba(0,194,255,.22);
  background:linear-gradient(135deg, rgba(0,194,255,.13), rgba(255,255,255,.04));
  border-radius:18px;
  padding:28px;
  margin-bottom:18px;
}
.eyebrow { color:var(--gold); font-size:12px; font-weight:900; letter-spacing:.08em; text-transform:uppercase; }
h1, h2, p { margin-top:0; }
h1 { font-size:clamp(26px,5vw,46px); line-height:1; margin-bottom:12px; }
h2 { font-size:20px; }
p, .hint, small { color:var(--muted); line-height:1.55; }
.panel, .balance {
  border:1px solid var(--line);
  background:var(--card);
  border-radius:16px;
  padding:18px;
  box-shadow:0 18px 50px rgba(0,0,0,.22);
}
.wallet { display:grid; gap:18px; }
.grid { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
label { display:block; margin:12px 0 6px; color:var(--muted); font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.06em; }
input {
  width:100%;
  min-height:46px;
  border:1px solid var(--line);
  border-radius:10px;
  padding:0 12px;
  color:var(--text);
  background:rgba(0,0,0,.18);
  font:inherit;
}
button, a {
  min-height:46px;
  border:0;
  border-radius:10px;
  padding:0 16px;
  margin-top:12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:#062139;
  background:linear-gradient(135deg, var(--cyan), var(--green));
  font:inherit;
  font-weight:900;
  text-decoration:none;
  cursor:pointer;
}
.balance span { color:var(--muted); display:block; font-size:12px; text-transform:uppercase; letter-spacing:.08em; }
.balance strong { display:block; margin-top:8px; color:var(--green); font-size:42px; line-height:1; }
.balance-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.logout-button {
  min-height:38px;
  margin:0;
  padding:0 14px;
  color:var(--text);
  background:transparent;
  border:1px solid var(--line);
  font-size:13px;
}
.logout-button:hover { border-color:var(--cyan); color:var(--cyan); }
.result { margin-top:16px; }
.result img { width:180px; height:180px; background:#fff; border-radius:12px; padding:8px; display:block; margin:0 auto 12px; }
.row { display:grid; grid-template-columns:repeat(auto-fit, minmax(130px, 1fr)); gap:10px; }
.scanner {
  margin-top:14px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(0,0,0,.16);
}
.scanner video {
  width:100%;
  max-height:260px;
  object-fit:cover;
  border-radius:10px;
  background:#061a2f;
  display:block;
}
.history { display:grid; gap:10px; }
.movement {
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(255,255,255,.04);
}
.movement strong.in { color:var(--green); }
.movement strong.out { color:var(--red); }
.toast {
  position:fixed;
  left:50%;
  bottom:20px;
  transform:translateX(-50%);
  padding:12px 16px;
  border-radius:999px;
  background:#fff;
  color:#08213a;
  font-weight:800;
  box-shadow:0 12px 30px rgba(0,0,0,.35);
}
.modal-backdrop {
  position:fixed;
  inset:0;
  z-index:30;
  display:grid;
  place-items:center;
  padding:20px;
  background:rgba(3,12,24,.68);
  backdrop-filter:blur(8px);
}
.modal-backdrop[hidden] { display:none !important; }
.modal-card {
  width:min(430px,100%);
  border:1px solid var(--line);
  border-radius:18px;
  padding:24px;
  text-align:center;
  background:#123250;
  box-shadow:0 22px 70px rgba(0,0,0,.45);
}
.modal-card h2 { margin:10px 0 8px; }
.modal-card p { margin:0; color:var(--muted); }
.spinner {
  width:52px;
  height:52px;
  margin:0 auto 12px;
  border:5px solid rgba(255,255,255,.18);
  border-top-color:var(--green);
  border-radius:50%;
  animation:spin .85s linear infinite;
}
.spinner[hidden] { display:none !important; }
@keyframes spin { to { transform:rotate(360deg); } }
.receipt-check {
  width:74px;
  height:74px;
  border-radius:50%;
  display:grid;
  place-items:center;
  margin:0 auto 10px;
  background:linear-gradient(135deg,var(--cyan),var(--green));
  color:#062034;
  font-size:44px;
  font-weight:900;
  box-shadow:0 14px 30px rgba(0,220,170,.25);
}
.receipt-check[hidden],
.receipt-details[hidden] { display:none !important; }
.receipt-details {
  display:grid;
  gap:10px;
  width:100%;
  margin:14px 0 6px;
  text-align:left;
}
.receipt-details div {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(255,255,255,.05);
}
.receipt-details span {
  color:var(--muted);
  font-size:12px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.04em;
}
.receipt-details strong {
  color:var(--text);
  font-size:14px;
  text-align:right;
  overflow-wrap:anywhere;
}
.receipt-actions {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  gap:10px;
  margin-top:14px;
}
.receipt-actions button { width:100%; }
.receipt-actions #downloadReceiptBtn {
  background:linear-gradient(135deg,var(--cyan),var(--green));
  color:#062034;
}

@media(max-width:760px) {
  .grid { grid-template-columns:1fr; }
  .balance strong { font-size:34px; }
  .balance-head { align-items:flex-start; }
}
