/* Citylife Rewards · shared styles
   Brand: black, white and the logo's lime green. */
:root {
  --black: #0A0A0A;
  --panel: #141414;
  --line: #262626;
  --line-strong: #333333;
  --white: #FFFFFF;
  --muted: #A3A3A3;
  --soft: #D4D4D4;
  --green: #94CC40;            /* logo green: use on black, or as a fill behind black text */
  --green-tint: rgba(148, 204, 64, 0.14);
  --green-text: #3D6B12;       /* green text on white (passes contrast) */
  --paper: #F5F5F4;
  --card: #FFFFFF;
  --ink: #0A0A0A;
  --ink-2: #525252;
  --border: #E5E5E5;
  --danger: #9A3412;
  --danger-tint: #FDECE4;
  --radius: 14px;
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Space Grotesk", Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
body.dark { background: var(--black); color: var(--white); }
[hidden] { display: none !important; }
a { color: var(--green-text); }
body.dark a { color: var(--green); }

h1, h2, h3 { font-family: var(--display); margin: 0; }
p { margin: 0; line-height: 1.5; }

/* ---------- Brand mark ---------- */
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 48px; height: 48px; display: block; }
.brand span { font-size: 11px; font-weight: 700; letter-spacing: 0.28em; color: var(--green); }

/* ---------- Forms ---------- */
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.field input, .field select, select {
  height: 50px; border-radius: 12px; padding: 0 14px; font: 400 16px var(--font);
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--white);
}
.light .field input, .light .field select, .light select { border-color: #D4D4D4; background: var(--card); color: var(--ink); }
.field input:focus, .field select:focus { outline: 2px solid var(--green); outline-offset: 1px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 12px; border: 0; cursor: pointer;
  font: 700 15px var(--font); text-decoration: none;
}
.btn-green, body.dark a.btn-green, a.btn-green { background: var(--green); color: var(--black); }
body.dark a.btn-ghost { color: var(--white); }
.btn-black { background: var(--black); color: var(--white); }
.btn-ghost { background: transparent; color: inherit; border: 1px solid var(--line-strong); }
.light .btn-ghost { border-color: #D4D4D4; }
.btn:disabled { opacity: 0.55; cursor: wait; }
.btn:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

.link-btn { background: none; border: 0; padding: 8px 0; font: 600 14px var(--font); color: var(--green); cursor: pointer; text-align: left; }

.lang-toggle { display: flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px; gap: 2px; }
.lang-toggle button { border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: 600 13px var(--font); min-width: 44px; height: 32px; cursor: pointer; }
.lang-toggle button[aria-pressed="true"] { background: var(--white); color: var(--black); }

.alert { border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.45; }
.alert-error { background: var(--danger-tint); color: var(--danger); }
.alert-info { background: var(--green-tint); color: inherit; }

/* ---------- Login page ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 20px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.auth-top { display: flex; justify-content: space-between; align-items: center; }

/* ---------- Admin shell ---------- */
.shell { min-height: 100vh; display: flex; flex-wrap: wrap; background: var(--paper); color: var(--ink); }
.sidebar { flex: 1 1 220px; max-width: 240px; background: var(--black); color: var(--white); padding: 24px 16px; display: flex; flex-direction: column; gap: 24px; }
.sidebar .brand { padding: 0 8px; }
.sidebar .brand img { width: 44px; height: 44px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a, .nav span {
  display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 12px;
  border-radius: 10px; color: var(--soft); font-size: 14px; text-decoration: none;
}
.nav a[aria-current="page"] { background: var(--green-tint); color: var(--white); font-weight: 600; }
.nav span { color: #737373; }
.nav small { font-size: 11px; color: #737373; }
.sidebar-foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 10px; }
.main { flex: 999 1 560px; min-width: 0; padding: 28px 32px 40px; display: flex; flex-direction: column; gap: 24px; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.page-head .date { font-size: 13px; color: var(--ink-2); }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: #EAF6DA; color: #2C4F0D; }
.badge-warn { background: #FEF3C7; color: #78350F; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.card h2 { font-size: 17px; font-weight: 600; font-family: var(--font); }
.stat { font-family: var(--display); font-size: 30px; font-weight: 700; }
.muted { color: var(--ink-2); font-size: 14px; }
.rules { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; }
.rules dt { color: var(--ink-2); }
.rules dd { margin: 0; font-weight: 600; }

@media (max-width: 760px) {
  .sidebar { max-width: none; flex-basis: 100%; padding: 16px; gap: 12px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar-foot { margin-top: 0; flex-direction: row; justify-content: space-between; align-items: center; }
  .main { padding: 20px 16px 32px; }
}

/* ---------- Customer pages (sign-up and card) ---------- */
.page-narrow { max-width: 460px; margin: 0 auto; padding: 20px 18px 48px; display: flex; flex-direction: column; gap: 20px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.lead { color: var(--soft); font-size: 16px; }
.hint { font-size: 13px; font-weight: 400; color: var(--muted); line-height: 1.45; }
.light .hint { color: var(--ink-2); }
fieldset.field { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 600; }
fieldset.field legend { padding: 0; margin-bottom: 6px; }
.row-2 { display: grid; grid-template-columns: 3fr 2fr; gap: 10px; }
select { height: 50px; border-radius: 12px; padding: 0 12px; font: 400 16px var(--font); width: 100%;
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--white); }
.choice { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 14px; border: 1px solid var(--line-strong);
  border-radius: 12px; font-size: 15px; font-weight: 500; cursor: pointer; }
.choice-top { align-items: flex-start; font-size: 13px; font-weight: 400; line-height: 1.45; color: var(--soft); }
.choice input { width: 22px; height: 22px; flex: 0 0 22px; accent-color: var(--green); margin: 0; }
.choice:has(input:checked) { border-color: var(--green); background: var(--green-tint); }
.alert-warn { background: #FEF3C7; color: #78350F; }
.muted-dark { color: var(--muted); }
.small { font-size: 13px; }

.loyalty-card { background: linear-gradient(160deg, #1A1A1A 0%, #0A0A0A 70%); border: 1px solid var(--line-strong);
  border-radius: 22px; padding: 22px; display: flex; flex-direction: column; gap: 18px; }
.lc-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.lc-top h1 { font-size: 26px; }
.stamps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.stamp { aspect-ratio: 1; border-radius: 50%; border: 2px dashed #4A4A4A; display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; color: var(--black); }
.stamp.on { background: var(--green); border: 2px solid var(--green); }
.lc-progress { font-size: 15px; color: var(--soft); }
.lc-progress strong { font-family: var(--display); font-size: 22px; color: var(--white); }
.reward-banner { background: var(--green); color: var(--black); border-radius: 12px; padding: 12px 14px; font-weight: 700; font-size: 15px; }

.qr-panel { background: var(--white); color: var(--ink); border-radius: 22px; padding: 22px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.qr-box { width: 100%; max-width: 240px; margin: 0 auto; background: #fff; border-radius: 12px; }
.qr-box svg { display: block; width: 100%; height: auto; }
.qr-sm { max-width: 200px; border: 1px solid var(--border); }
.card-number { font-family: var(--display); font-size: 14px; letter-spacing: 0.08em; color: var(--ink-2); }
.link-list { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Admin: customer list ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.search-field { max-width: 420px; }
.table-wrap { background: var(--card); border: 1px solid var(--border); border-radius: 16px; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-2); padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td:last-child { text-align: right; }
.badge-muted { background: #F0F0EF; color: var(--ink-2); font-weight: 500; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 14px; }
.dialog { border: 0; border-radius: 20px; padding: 24px; width: min(420px, calc(100vw - 32px)); background: var(--card); color: var(--ink); }
.dialog::backdrop { background: rgba(10, 10, 10, 0.6); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dialog-head h2 { font-size: 20px; font-family: var(--display); }
.row-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.row-btns .btn { flex: 1 1 160px; }
.table td:nth-child(2), .table td:nth-child(4), .table .btn { white-space: nowrap; }

/* ---------- Counter panel (stamps, rewards, history) ---------- */
.btn-xl { min-height: 60px; font-size: 18px; }
.sp { display: flex; flex-direction: column; gap: 14px; }
.sp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sp-name { font-size: 24px; font-family: var(--display); }
.sp-count { font-family: var(--display); font-size: 20px; font-weight: 700; }
.sp-ok { background: var(--green); color: var(--black); font-weight: 700; font-size: 16px; }
.stamps-light .stamp { border-color: #C9C9C9; }
.stamps-light .stamp.on { border-color: var(--green); }
.sp-rewards { border: 2px solid var(--green); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #F4FAEA; }
.sp-rewards h3, .sp-history h3 { font-size: 15px; font-family: var(--font); }
.sp-reward { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.sp-history ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; }
.sp-history li { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.sp-history li:last-child { border-bottom: 0; }
.sp-correct summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink-2); padding: 6px 0; }
.sp-correct form { margin-top: 8px; }
.sp-correct input { height: 46px; border-radius: 10px; border: 1px solid #D4D4D4; padding: 0 12px; font: 400 16px var(--font); width: 100%; }
.link-dark { color: var(--ink-2); text-decoration: underline; }
.scan-box { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 20px; max-width: 560px; display: flex; flex-direction: column; gap: 14px; }
.scan-video-wrap { position: relative; background: #111; border-radius: 14px; overflow: hidden; aspect-ratio: 4 / 3; }
.scan-video-wrap video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; inset: 18%; border: 3px solid var(--green); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0,0,0,0.25); }
.dlg-panel { border-top: 1px solid var(--border); padding-top: 16px; }
.staff-box { background: var(--card); color: var(--ink); border-radius: 22px; padding: 18px; border: 3px solid var(--green); }
.staff-tag { font-size: 11px; font-weight: 700; letter-spacing: 0.2em; color: var(--green-text); margin-bottom: 8px; }
.staff-box .muted { color: var(--ink-2); }
.lc-note { font-size: 13px; color: var(--muted); }

/* Card: compact social row */
.follow { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.follow-title { font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); text-align: center; }
.follow-row { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.chip, body.dark a.chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--white); font: 600 14px var(--font); text-decoration: none; }

/* ---------- Program page, promos, full card ---------- */
.prog-card { max-width: 720px; gap: 16px; }
.prog-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.prog-status { font-weight: 700; font-size: 16px; padding: 10px 14px; border-radius: 12px; background: #F0F0EF; }
.prog-status.on { background: var(--green); color: var(--black); }
.prog-more summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink-2); padding: 6px 0; }
.prog-more[open] { display: flex; flex-direction: column; gap: 12px; }
.light .choice { border-color: #D4D4D4; color: var(--ink); }
.light .choice-top { color: var(--ink); }
.light .choice:has(input:checked) { border-color: var(--green-text); background: #F4FAEA; }
.light fieldset.field legend { color: var(--ink); }
.sp-promo { background: var(--black); color: var(--green); font-weight: 700; border-radius: 12px; padding: 12px 14px; font-size: 15px; }
.sp-rewards-big { border-width: 3px; }
.sp-reward-btns { display: flex; flex-direction: column; gap: 8px; }
.promo-banner { background: var(--green); color: var(--black); font-weight: 700; border-radius: 14px; padding: 14px 16px; font-size: 16px; text-align: center; }
.loyalty-card.lc-full { border-color: var(--green); box-shadow: 0 0 0 1px var(--green), 0 10px 40px rgba(148, 204, 64, 0.25); }

/* =================== Pearl white card page (Feature 5) =================== */
body.pearl { background: #F6F6F3; color: var(--ink); }
body.pearl .brand span { color: var(--green-text); }
body.pearl .lang-toggle { border-color: #DDDDD6; }
body.pearl .lang-toggle button { color: #6B6B6B; }
body.pearl .lang-toggle button[aria-pressed="true"] { background: var(--ink); color: #fff; }
body.pearl .btn-ghost, body.pearl a.btn-ghost { color: var(--ink); border-color: #DDDDD6; background: #fff; }
body.pearl .follow-title { color: #8A8A84; }
body.pearl a.chip, body.pearl .chip { color: var(--ink); border-color: #DDDDD6; background: #fff; }
.pearl-muted { color: #6B6B6B; }
.pearl-welcome { background: #fff; border: 1px solid #E4E4DE; color: var(--ink); }
body.pearl .promo-banner { box-shadow: 0 8px 24px rgba(148, 204, 64, 0.35); }

.mcard { position: relative; overflow: hidden; border-radius: 22px; padding: 20px; aspect-ratio: 1.586; min-height: 210px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(120% 140% at 100% 0%, #EAF6D6 0%, #FFFFFF 52%, #F1F1EE 100%);
  border: 1px solid #E2E2DC; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.10), inset 0 1px 0 #fff; }
.mcard::before { content: ""; position: absolute; inset: -40% -60%; pointer-events: none; z-index: 0;
  background: linear-gradient(115deg, transparent 45%, rgba(255, 255, 255, 0.55) 50%, transparent 55%);
  animation: mc-shine 6s ease-in-out infinite; }
@keyframes mc-shine { 0%, 70% { transform: translateX(-40%); } 100% { transform: translateX(40%); } }
.mcard > * { position: relative; z-index: 1; }
.mc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.mc-logo { width: 52px; height: 52px; border-radius: 50%; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18); }
.mc-tier { text-align: right; }
.mc-tier span { display: block; font-size: 10px; font-weight: 800; letter-spacing: 0.25em; color: var(--green-text); }
.mc-tier b { display: block; margin-top: 4px; font-size: 16px; color: var(--ink); }
.mc-test { display: inline-block; margin-top: 8px; font-size: 10px; }
.mc-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.mc-name { font-family: var(--display); font-size: 26px; color: var(--ink); line-height: 1.1; word-break: break-word; }
.mc-num { font-family: ui-monospace, Menlo, monospace; font-size: 13px; letter-spacing: 0.2em; color: #6B6B6B; margin-top: 6px; }
.mc-qr { width: 108px; height: 108px; flex: 0 0 108px; background: #fff; border-radius: 12px; padding: 6px; box-shadow: 0 0 0 1px #E5E5E0, 0 6px 16px rgba(0, 0, 0, 0.08); }
.mc-qr svg { display: block; width: 100%; height: 100%; }

.mcard.is-full { background: radial-gradient(120% 140% at 50% 0%, #D9F2A6 0%, #94CC40 55%, #6AA323 100%); border-color: #94CC40;
  box-shadow: 0 14px 44px rgba(148, 204, 64, 0.5); }
.mcard.is-full .mc-tier span, .mcard.is-full .mc-tier b, .mcard.is-full .mc-name { color: #0A0A0A; }
.mcard.is-full .mc-num { color: #1F3308; }
.confetti { position: absolute; inset: 0; z-index: 2 !important; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -12%; width: 7px; height: 13px; border-radius: 2px; opacity: 0.9;
  animation: confetti-fall 3.2s linear infinite; }
@keyframes confetti-fall { 0% { transform: translateY(0) rotate(0deg); } 100% { transform: translateY(330px) rotate(540deg); } }
@media (prefers-reduced-motion: reduce) { .confetti i, .mcard::before { animation: none; } .confetti { display: none; } }

.reward-hero { text-align: center; display: flex; flex-direction: column; gap: 6px; padding: 4px 0; }
.reward-hero small { color: var(--green-text); font-size: 12px; font-weight: 800; letter-spacing: 0.25em; }
.reward-hero b { font-family: var(--display); font-size: 42px; line-height: 1.05; color: var(--ink); }
.reward-hero span { color: #555; font-size: 14px; }
body.pearl .reward-banner { background: var(--green); color: #000; }

.progress-panel { background: #fff; border: 1px solid #E8E8E3; border-radius: 22px; padding: 18px; display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04); }
.pp-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.pp-row strong { font-family: var(--display); font-size: 26px; }
.pp-row span { color: #666; font-size: 14px; }
.pp-bar { height: 7px; background: #ECECE6; border-radius: 9px; overflow: hidden; }
.pp-bar i { display: block; height: 100%; width: 0; background: var(--green); border-radius: 9px; transition: width 0.6s ease; }
.pstamps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.pstamp { aspect-ratio: 1; border-radius: 50%; border: 2px dashed #CFCFC8; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.pstamp.on { border: 2px solid var(--green); background: #F4FAEA; }
.pstamp.on img { width: 80%; height: 80%; border-radius: 50%; }
.pstamp.gift { border: 2px solid #E0E0D8; background: #FAFAF7; }
.pp-hint { text-align: center; font-size: 13px; color: #6B6B6B; }
body.pearl .staff-box { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08); }
