/* Visual language adapted from a "Wallet App UI" design reference the user supplied —
   dark/white two-tone layout, Inter, pill buttons, rounded cards. Feature set stays
   CardWise's own (pick which real cards you hold; no freeze/PIN/limit — this product
   never touches real card operations). */
:root {
  --ink: #0e0e10;
  --surface: #ffffff;
  --muted: #f4f4f5;
  --line: #e7e7ea;
  --text-secondary: #6b6b70;
  --danger: #c0262d;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ink);
}

.top {
  padding: 28px 20px 20px;
  color: #fff;
}
.top h1 { margin: 0; font-size: 28px; font-weight: 600; letter-spacing: -0.5px; }
.top-sub { margin: 6px 0 0; font-size: 13px; color: #a1a1a8; }

.sheet {
  flex: 1;
  background: var(--surface);
  border-radius: 28px 28px 0 0;
  padding: 24px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hint { color: var(--text-secondary); font-size: 13px; margin: 0; }
.center { text-align: center; padding: 40px 0; }

.content { display: flex; flex-direction: column; gap: 4px; }

.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.row-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--muted);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.row-text { display: flex; flex-direction: column; gap: 2px; flex-grow: 1; min-width: 0; }
.row-title { font-size: 14px; font-weight: 500; }
.row-sub { font-size: 12px; color: var(--text-secondary); }

.pill-select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.issuer-group { margin-top: 18px; }
.issuer-group h2 {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.card-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.card-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.card-swatch {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  position: relative;
  overflow: hidden;
}
.card-swatch::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0.5) 48%, rgba(255, 255, 255, 0) 62%);
}

.card-name { font-size: 14px; font-weight: 500; flex-grow: 1; min-width: 0; }

.check {
  width: 26px;
  height: 26px;
  border-radius: 13px;
  border: 1.5px solid var(--line);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms, border-color 150ms;
}
.card-row input:checked ~ .check {
  background: var(--ink);
  border-color: var(--ink);
}
.check svg { opacity: 0; transition: opacity 150ms; }
.card-row input:checked ~ .check svg { opacity: 1; }

.save-bar {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  padding: 10px 20px calc(20px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.save-btn {
  height: 54px;
  border: 0;
  border-radius: 27px;
  background: var(--ink);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.save-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.msg { font-size: 13px; text-align: center; margin: 0; }
.msg.ok { color: #15803d; }
.msg.error { color: var(--danger); }
