/* CardVault — light cc-store theme (savasta-style) */
:root {
  --bg: #f1f3f6;
  --surface: #ffffff;
  --surface-2: #f4f6f9;
  --border: #e3e7ee;
  --text: #1c2230;
  --muted: #6a7383;
  --accent: #1f2937;
  --accent-2: #158a5a;
  --link: #2459c4;
  --radius: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
}

.container { width: min(1560px, 98%); margin: 0 auto; }
main { flex: 1; padding: 20px 0 40px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.accent { color: var(--link); }
.hidden { display: none !important; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; height: 56px; }
.logo { font-size: 1.15rem; font-weight: 800; color: var(--text); text-decoration: none; letter-spacing: 0.3px; }
.logo-mark { color: var(--link); }
.main-nav { display: flex; gap: 18px; justify-self: center; }
.nav-link { color: var(--muted); text-decoration: none; font-size: 0.9rem; font-weight: 500; }
.nav-link.active, .nav-link:hover { color: var(--text); }
.header-actions { display: flex; gap: 8px; align-items: center; }
.lang-select { padding: 6px 8px; font-size: 0.8rem; }
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 14px 0; color: var(--muted); font-size: 0.8rem; text-align: center; }

/* notice banner */
.notice { background: #fffbeb; border-bottom: 1px solid #fde68a; color: #92400e; font-size: 0.8rem; }
.notice-inner { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.notice-inner button { margin-left: auto; background: none; border: none; color: inherit; cursor: pointer; font-size: 0.85rem; }

/* buttons */
.btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 8px 16px; border-radius: 7px; font-size: 0.85rem; font-weight: 600;
  cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--surface-2); border-color: #cfd6e2; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #000; border-color: #000; }
.btn-ghost { background: var(--surface); }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 10px; font-size: 0.78rem; }

/* login landing */
#view-auth { min-height: calc(100vh - 120px); }
.auth-wrap { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 120px); position: relative; z-index: 1; }
.auth-bg { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; background: var(--bg); }
.auth-bg::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(700px 420px at 12% 15%, rgba(36, 89, 196, 0.06), transparent 65%),
    radial-gradient(800px 520px at 88% 85%, rgba(21, 138, 90, 0.05), transparent 65%);
}
.float-card {
  position: absolute; width: 260px; aspect-ratio: 1.586; border-radius: 14px;
  padding: 16px; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(135deg, #2b3446, #1b2230);
  color: #e8ecf6; opacity: 0.14;
  box-shadow: 0 18px 40px rgba(28, 34, 48, 0.18);
  animation: floaty 9s ease-in-out infinite;
}
.float-card .card-number { font-size: 0.8rem; }
.fc-1 { top: 10%; left: 5%; transform: rotate(-12deg); animation-delay: 0s; }
.fc-2 { top: 62%; left: 9%; transform: rotate(8deg); animation-delay: -2.2s; }
.fc-3 { top: 12%; right: 4%; transform: rotate(10deg); animation-delay: -4.4s; }
.fc-4 { top: 58%; right: 7%; transform: rotate(-7deg); animation-delay: -6.6s; }
@keyframes floaty { 0%, 100% { translate: 0 0; } 50% { translate: 0 -20px; } }
@media (prefers-reduced-motion: reduce) { .float-card { animation: none; } }
.auth-card {
  width: 100%; max-width: 420px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 30px;
  box-shadow: 0 10px 30px rgba(28, 34, 48, 0.08);
}
.auth-card h2 { margin-bottom: 4px; text-align: center; font-size: 1.25rem; }
.auth-sub { text-align: center; color: var(--muted); font-size: 0.82rem; margin-bottom: 16px; }
.auth-card label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
.auth-card input {
  display: block; width: 100%; margin-top: 5px; padding: 10px 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px;
  color: var(--text); font-size: 0.9rem;
}
.auth-card input:focus { outline: none; border-color: var(--link); background: #fff; }
.auth-switch { text-align: center; margin-top: 14px; font-size: 0.82rem; color: var(--muted); }
.auth-switch a { color: var(--link); }
.trust-badges {
  list-style: none; display: flex; gap: 14px; justify-content: center;
  flex-wrap: wrap; margin-top: 18px; color: var(--muted); font-size: 0.75rem;
}

/* views */
.view { display: none; }
.view.active { display: block; }

/* catalog toolbar: labeled filter boxes + actions + stats bar */
.catalog-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.catalog-head h2 { margin: 0; font-size: 1.05rem; }
.filter-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.filter-box { display: flex; flex-direction: column; gap: 4px; font-size: 0.68rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.filter-box input, .filter-box select { width: 100%; }
.filter-actions { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.filter-status { font-size: 0.76rem; color: var(--muted); }
.stats-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; font-size: 0.8rem; color: var(--muted); }
.search-box {
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 7px; padding: 8px 12px; font-size: 0.85rem;
}
.search-box:focus { outline: none; border-color: var(--link); }
select, .sort-select {
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 7px; padding: 7px 9px; font-size: 0.83rem;
}
select option { background: var(--surface); }
.filter-status { font-size: 0.76rem; color: var(--muted); }

/* BIN table */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.bin-table { width: 100%; border-collapse: collapse; font-size: 0.83rem; min-width: 900px; }
.bin-table thead th {
  position: sticky; top: 0; background: var(--surface-2); color: var(--muted);
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.6px; text-align: left;
  padding: 9px 14px; border-bottom: 1px solid var(--border);
}
.bin-row { border-bottom: 1px solid var(--border); }
.bin-row:last-child { border-bottom: none; }
.bin-row:hover { background: #f7f9fc; }
.bin-row.out-stock { opacity: 0.5; }
.bin-row td { padding: 9px 14px; vertical-align: middle; }
.brand-chip {
  font-size: 0.66rem; font-weight: 800; letter-spacing: 0.5px; padding: 2px 7px;
  border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border);
}
.brand-chip.visa { color: #2459c4; border-color: #c9d7f2; background: #eef3fc; }
.brand-chip.mc { color: #b3541e; border-color: #f0d9c4; background: #fbf3ea; }
.bin-num { font-size: 0.83rem; }
.bank-line { font-size: 0.7rem; color: var(--muted); margin-top: 1px; }
.c-balance { color: var(--accent-2); font-weight: 700; white-space: nowrap; }
.c-stock { font-size: 0.76rem; white-space: nowrap; color: var(--muted); }
.c-stock.low { color: #c2410c; font-weight: 600; }
.c-stock.out { color: #dc2626; font-weight: 600; }
.c-price .price { display: block; font-weight: 700; }
.price-sub { display: block; font-size: 0.7rem; color: var(--muted); margin-top: 1px; }
.buy-row { display: flex; align-items: center; gap: 6px; }
.qty-stepper { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: var(--surface); }
.qty-stepper button {
  background: var(--surface-2); border: none; color: var(--text); width: 24px; height: 27px;
  cursor: pointer; font-size: 0.85rem;
}
.qty-stepper button:disabled { opacity: 0.4; cursor: default; }
.qty-stepper span { min-width: 22px; text-align: center; font-size: 0.8rem; font-weight: 700; background: #fff; }
.owned-note { font-size: 0.75rem; color: var(--accent-2); font-weight: 600; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 12px; }
.pager-page { font-size: 0.8rem; color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 32px; }

/* wallet tiles */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.card-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 12px;
}
.card-item h3 { font-size: 0.95rem; }
.wallet-title { margin-bottom: 16px; }

/* card graphic */
.card-visual {
  position: relative; border-radius: 12px; padding: 16px; aspect-ratio: 1.586;
  display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(135deg, #2b3446, #1b2230);
  color: #e8ecf6; overflow: hidden;
}
.card-chip { width: 34px; height: 25px; border-radius: 5px; background: linear-gradient(135deg, #e8c766, #b58a2e); }
.card-brand { position: absolute; top: 14px; right: 16px; font-weight: 800; font-style: italic; letter-spacing: 0.5px; font-size: 0.85rem; }
.card-number { font-family: ui-monospace, Menlo, monospace; font-size: 0.95rem; letter-spacing: 2px; }
.card-meta { display: flex; justify-content: space-between; font-size: 0.7rem; color: #c4cbdb; }
.card-visual.large { max-width: 360px; width: 100%; }
.card-info-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.badge {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--accent-2);
  font-size: 0.68rem; padding: 2px 7px; border-radius: 99px; white-space: nowrap; font-weight: 600;
}
.badge-col { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.stock-badge.low { color: #c2410c; border-color: #f0d9c4; }
.stock-badge.out { color: #dc2626; border-color: #fbcaca; }

/* detail */
.back-btn { margin-bottom: 16px; }
.detail-layout { display: grid; grid-template-columns: 360px 1fr; gap: 28px; align-items: start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.detail-info h2 { margin: 8px 0 4px; }
.detail-balance { color: var(--muted); margin-bottom: 12px; }
.feature-list { list-style: none; color: var(--muted); font-size: 0.83rem; display: grid; gap: 4px; margin-bottom: 18px; }
.feature-list li::before { content: "✓ "; color: var(--accent-2); }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  font-size: 0.64rem; letter-spacing: 0.4px; padding: 2px 7px; border-radius: 4px; font-weight: 600;
  background: #eef3fc; color: #2459c4; border: 1px solid #c9d7f2;
}
.detail-price-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-price-row .price { font-size: 1.2rem; font-weight: 800; }

/* checkout */
.checkout-layout { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
.checkout-card, .order-summary {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.checkout-card h2 { margin-bottom: 14px; }
.checkout-card h3 { margin: 16px 0 8px; font-size: 0.9rem; }
.mini-card {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 9px; font-size: 0.85rem;
  background: linear-gradient(135deg, #2b3446, #1b2230); color: #e8ecf6;
}
.coin-select { display: flex; gap: 8px; flex-wrap: wrap; }
.coin-btn {
  flex: 1; min-width: 70px; padding: 9px; border-radius: 7px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-weight: 600;
}
.coin-btn.active { border-color: var(--link); color: var(--text); background: #eef3fc; }
.pay-box { margin-top: 16px; }
.pay-label { font-size: 0.85rem; color: var(--muted); margin-bottom: 8px; }
.address-row { display: flex; gap: 8px; align-items: center; }
.address-row code {
  flex: 1; background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px;
  padding: 10px 12px; font-size: 0.74rem; word-break: break-all; color: var(--text);
}
.warning { font-size: 0.76rem; color: #b45309; margin: 10px 0 14px; }
#paidBtn { margin-top: 4px; }
.order-summary { position: sticky; top: 72px; }
.order-summary h3 { margin-bottom: 12px; }
.sum-row { display: flex; justify-content: space-between; font-size: 0.85rem; padding: 7px 0; color: var(--muted); }
.sum-row span:last-child { color: var(--text); }
.sum-row.total { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 12px; font-weight: 700; }
.paid-to { font-size: 0.74rem; color: var(--muted); margin-top: 10px; }

/* success / reveal */
.success-card {
  max-width: 520px; margin: 36px auto; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 30px; text-align: center;
}
.success-icon {
  width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 50%;
  background: #e2f5ec; color: var(--accent-2);
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: 800;
}
.success-card h2 { margin-bottom: 4px; }
.success-card p { color: var(--muted); font-size: 0.82rem; margin: 8px 0 20px; }
.reveal-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 6px 14px; text-align: left; }
.reveal-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 0.87rem; }
.reveal-row:last-child { border-bottom: none; }
.reveal-row span { color: var(--muted); }
.reveal-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }

/* public info pages (guides / faq) */
.page-head { margin-bottom: 18px; }
.page-head h2 { font-size: 1.15rem; }
.page-head p { color: var(--muted); font-size: 0.85rem; margin-top: 3px; }
.why-choose { max-width: 1560px; margin: 34px auto 0; padding: 0 4px; }
.why-choose h3 { font-size: 0.95rem; text-align: center; margin-bottom: 14px; }
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 12px; }
.step-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; position: relative; }
.step-card h4 { font-size: 0.88rem; margin-bottom: 6px; }
.step-card p { color: var(--muted); font-size: 0.82rem; line-height: 1.5; }
.step-num {
  position: absolute; top: 12px; right: 14px; font-size: 1.4rem; font-weight: 800;
  color: #d7dde8;
}
.faq-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.faq-list details { border-bottom: 1px solid var(--border); }
.faq-list details:last-child { border-bottom: none; }
.faq-list summary {
  cursor: pointer; padding: 13px 16px; font-weight: 600; font-size: 0.87rem; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; color: var(--muted); font-weight: 700; }
.faq-list details[open] summary::after { content: "−"; }
.faq-list details p { padding: 0 16px 14px; color: var(--muted); font-size: 0.84rem; line-height: 1.55; }

/* toast */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff;
  padding: 10px 18px; border-radius: 8px; font-size: 0.85rem; z-index: 100;
  box-shadow: 0 8px 24px rgba(28, 34, 48, 0.25);
}

@media (max-width: 760px) {
  .detail-layout, .checkout-layout { grid-template-columns: 1fr; }
  .detail-visual { max-width: 100%; }
  .order-summary { position: static; }
  .header-inner { gap: 12px; }
  .main-nav { display: none; }
}
