:root {
  --sage: #3f5e4d;
  --sage-dark: #2c4436;
  --sage-soft: #e6ede8;
  --sand: #f6f1ea;
  --gold: #b08d57;
  --ink: #1f2a24;
  --muted: #66736b;
  --line: #ddd5c9;
  --white: #fffdf9;
  --danger: #a4442f;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(31, 42, 36, .10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--sand);
  color: var(--ink);
  font: 16px/1.55 "Inter", system-ui, -apple-system, Segoe UI, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .serif { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; line-height: 1.15; }
h1 { font-size: clamp(2rem, 6vw, 2.8rem); margin: 0 0 .4em; }
h2 { font-size: 1.7rem; margin: 0 0 .5em; }
h3 { font-size: 1.3rem; margin: 0 0 .4em; }
a { color: var(--sage); }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; max-width: 1040px; margin: 0 auto;
}
.brand { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.5rem; font-weight: 600; color: var(--ink); text-decoration: none; letter-spacing: .02em; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand span { color: var(--gold); }
.hero-logo { display: block; margin: 0 auto 18px; width: min(220px, 60vw); height: auto; }
.topbar nav a { margin-left: 18px; text-decoration: none; font-size: .95rem; }

main { max-width: 1040px; margin: 0 auto; padding: 8px 16px 64px; }
.narrow { max-width: 560px; margin: 0 auto; }

.panel {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow);
}
.panel + .panel { margin-top: 20px; }

.grid-2 { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .grid-2 { grid-template-columns: 1.1fr .9fr; } }

/* Forms */
label { display: block; font-size: .9rem; font-weight: 500; margin: 0 0 6px; }
input[type=text], input[type=email], input[type=search], input[type=tel], textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  font: inherit; background: #fff; color: var(--ink);
}
input:focus, textarea:focus { outline: 2px solid var(--sage-soft); border-color: var(--sage); }
.field { margin-bottom: 16px; }
.field-row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 4px; }
.errorlist { color: var(--danger); list-style: none; padding: 0; margin: 4px 0 0; font-size: .875rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; border: 1px solid transparent;
  background: var(--sage); color: #fff; font: 600 1rem "Inter", sans-serif;
  text-decoration: none; cursor: pointer; transition: background .15s, transform .05s;
}
.btn:hover { background: var(--sage-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: var(--sage); border-color: var(--line); }
.btn-ghost:hover { background: var(--sage-soft); }
.btn-gold { background: var(--gold); }
.btn-gold:hover { background: #967545; }
.btn-lg { padding: 16px 26px; font-size: 1.1rem; }

.wallet-btns { display: grid; gap: 10px; margin-top: 18px; }
.wallet-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 18px; border-radius: 12px; background: #000; color: #fff;
  text-decoration: none; font-weight: 600;
}
.wallet-btn svg { width: 22px; height: 22px; }

/* Messages */
.messages { list-style: none; padding: 0; margin: 0 0 20px; }
.messages li { padding: 12px 16px; border-radius: 12px; margin-bottom: 8px; background: var(--sage-soft); }
.messages li.warning { background: #f4e6cc; font-weight: 600; font-size: 1.05rem; }
.messages li.error { background: #f6dcd5; color: var(--danger); }

/* Loyalty card */
.loyalty-card {
  position: relative; overflow: hidden;
  border-radius: 22px; padding: 24px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,.18), transparent 55%), var(--card-bg, var(--sage));
  box-shadow: 0 18px 40px rgba(31, 42, 36, .25);
  aspect-ratio: 1.6 / 1; display: flex; flex-direction: column; justify-content: space-between;
  min-height: 210px;
}
.loyalty-card .card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.loyalty-card .card-brand { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.4rem; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.loyalty-card .card-brand img { filter: brightness(0) invert(1); } /* white version of the mark */
.loyalty-card .card-level { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; opacity: .85; text-align: right; }
.loyalty-card .card-level strong { display: block; font-size: 1.05rem; letter-spacing: .04em; opacity: 1; }
.loyalty-card .card-name { font-size: 1.1rem; font-weight: 500; }

.stamps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; max-width: 280px; }
.stamp {
  aspect-ratio: 1; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.55);
  display: grid; place-items: center; font-size: .85rem;
}
.stamp.on { background: rgba(255,255,255,.92); color: var(--card-bg, var(--sage)); border-color: transparent; }
.stamps.light .stamp { border-color: var(--line); color: var(--muted); }
.stamps.light .stamp.on { background: var(--sage); color: #fff; }

.qr { background: #fff; border-radius: 16px; padding: 12px; display: inline-block; border: 1px solid var(--line); }
.qr svg { display: block; width: 200px; height: 200px; }

.levels { list-style: none; padding: 0; margin: 0; }
.levels li { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.levels li:last-child { border-bottom: 0; }
.levels .dot { width: 34px; height: 34px; border-radius: 50%; background: var(--sage-soft); display: grid; place-items: center; font-weight: 600; color: var(--sage); flex: none; }
.levels li.current .dot { background: var(--sage); color: #fff; }
.levels li.done .dot { background: var(--gold); color: #fff; }

.reward {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 14px; background: #f4e6cc; margin-bottom: 10px;
}
.reward strong { font-size: 1.05rem; }
.reward.benefit { background: var(--sage-soft); }

.hero { text-align: center; padding: 28px 0 24px; }
.hero p { max-width: 520px; margin: 0 auto 1em; color: var(--muted); font-size: 1.05rem; }

/* Staff */
.stat { font-family: "Cormorant Garamond", Georgia, serif; font-size: 2.4rem; font-weight: 600; line-height: 1; }
.stats { display: flex; gap: 28px; flex-wrap: wrap; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.table tr:hover td { background: #faf6f0; }
.table a { text-decoration: none; font-weight: 500; }
.search-row { display: flex; gap: 10px; }
.search-row input { flex: 1; }
#reader { width: 100%; max-width: 420px; margin-top: 14px; border-radius: 14px; overflow: hidden; }
#reader video { border-radius: 14px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--sage-soft); color: var(--sage); font-size: .8rem; font-weight: 600; }
.badge.gold { background: #f4e6cc; color: #7a5c2e; }
.progress { height: 10px; background: var(--sage-soft); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--sage); border-radius: 999px; }
details summary { cursor: pointer; font-weight: 600; color: var(--sage); }
.table-wrap { overflow-x: auto; }
footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 0 16px 32px; }
