/* ===== Variables ===== */
:root {
  --bg-1: #0f0c29;
  --bg-2: #302b63;
  --bg-3: #24243e;
  --card-bg: rgba(255, 255, 255, 0.07);
  --card-border: rgba(255, 255, 255, 0.13);
  --text-primary: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.6);
  --shadow-card: 0 24px 60px rgba(0, 0, 0, 0.45);
  --radius-xl: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);

  --vcb-a: #007B40;
  --vcb-b: #00c972;
  --momo-a: #AF025D;
  --momo-b: #ff4d9e;
  --gen-a: #005bea;
  --gen-b: #00c6fb;
}

/* ===== Reset ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===== Body ===== */
body {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--bg-1), var(--bg-2), var(--bg-3));
  background-size: 400% 400%;
  animation: bgShift 14s ease infinite;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text-primary);
}

@keyframes bgShift {
  0%, 100% { background-position: 0% 50%; }
  50%       { background-position: 100% 50%; }
}

/* ===== App wrapper ===== */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 56px 16px 36px;
  gap: 48px;
}

/* ===== Header ===== */
.header {
  text-align: center;
  animation: fadeDown 0.7s ease both;
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 100px;
  padding: 6px 18px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  backdrop-filter: blur(8px);
}

.header-badge span { font-size: 16px; }

.header-title {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.1;
  background: linear-gradient(135deg, #ffffff 30%, #a0d8ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}

.header-sub {
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 400;
  max-width: 340px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ===== Grid ===== */
.main {
  width: 100%;
  max-width: 1100px;
}

.qr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

/* ===== Card ===== */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  animation: fadeUp 0.7s ease both;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* top accent bar */
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.card--general::before { background: linear-gradient(90deg, var(--gen-a), var(--gen-b)); }
.card--vcb::before     { background: linear-gradient(90deg, var(--vcb-a), var(--vcb-b)); }
.card--momo::before    { background: linear-gradient(90deg, var(--momo-a), var(--momo-b)); }

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 36px 80px rgba(0, 0, 0, 0.55);
  border-color: rgba(255, 255, 255, 0.22);
}

/* ===== Card Header (logo area) ===== */
.card-logo-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  min-height: 70px;
}

.card-logo-wrap .icon {
  font-size: 34px;
  line-height: 1;
}

.bank-logo {
  max-height: 42px;
  max-width: 180px;
  width: auto;
  object-fit: contain;
  /* white logo on dark bg */
  filter: brightness(0) invert(1);
}

.card--momo .bank-logo {
  filter: none;
}

/* ===== QR Wrapper ===== */
.qr-wrapper {
  width: 100%;
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.qr-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  opacity: 0;
  transition: var(--transition);
  pointer-events: none;
}

.qr-overlay .overlay-icon  { font-size: 28px; }
.qr-overlay .overlay-text  { font-size: 13px; font-weight: 600; color: #fff; }

.qr-wrapper:hover .qr-overlay { opacity: 1; }
.qr-wrapper:hover              { box-shadow: 0 8px 24px rgba(0,0,0,0.25); }

.qr-img {
  width: 100%;
  border-radius: var(--radius-sm);
  display: block;
  transition: transform 0.35s ease;
}

.qr-wrapper:hover .qr-img { transform: scale(1.03); }

/* ===== Card Info ===== */
.card-info {
  text-align: center;
  width: 100%;
}

.card-service {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.card-owner {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* ===== Actions ===== */
.card-actions {
  width: 100%;
  display: flex;
  gap: 10px;
}

.btn {
  flex: 1;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition);
  font-family: inherit;
}

.btn--download {
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.btn--download:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.35);
  transform: scale(1.03);
}

.btn--copy {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn--copy:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.03);
}

.btn.copied {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.3);
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 2;
}

.footer-sub { font-size: 13px; opacity: 0.65; }

/* ===== Lightbox ===== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 24px;
}

.lightbox.active { display: flex; }

.lightbox-box {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 20px;
  animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
}

@keyframes popIn {
  from { transform: scale(0.75); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

#lightbox-img {
  width: 100%;
  border-radius: var(--radius-md);
  display: block;
}

.lightbox-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff;
  border: none;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  line-height: 1;
}

.lightbox-close:hover { transform: rotate(90deg) scale(1.1); }

.lightbox-label {
  text-align: center;
  margin-top: 14px;
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar        { width: 6px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: rgba(255,255,255,0.2); border-radius: 3px; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .header-title { font-size: 32px; }
  .qr-grid { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; }
  .app { padding: 40px 16px 28px; gap: 36px; }
}

@media (max-width: 480px) {
  .header-title { font-size: 26px; }
  .header-badge { font-size: 12px; }
  .card { padding: 20px 16px; gap: 16px; }
}
