/* styles.css — shared across all four pages. System fonts only (no
   webfonts — a font that fails to load in a basement is a blank card).
   Dark by default: this app lives on a phone screen in a dim restaurant,
   not a desk. */

:root {
  color-scheme: dark;

  --bg: #0b0f0d;
  --bg-raised: #121714;
  --bg-raised-2: #1a221d;
  --border: #253128;
  --text: #eef3ee;
  --text-dim: #9fb0a4;
  --text-faint: #6b7d70;

  --accent: #2f9e6e;
  --accent-bright: #3fd08a;
  --accent-text: #06140d;
  --gold: #d4a94f;

  --red: #e5484d;
  --red-bg: #2a1113;
  --green-bg: #0e2318;

  --radius: 14px;
  --radius-sm: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Consolas", monospace;

  --focus-ring: 3px solid var(--accent-bright);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-weight: 650;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}

p {
  margin: 0 0 1em;
  color: var(--text-dim);
}

a {
  color: var(--accent-bright);
}

/* Visible keyboard focus everywhere — never suppressed. */
:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

button, input, select, textarea {
  font-family: inherit;
}

/* 16px minimum on inputs so iOS Safari doesn't zoom on focus. */
input, select, textarea, button {
  font-size: 16px;
}

input, select, textarea {
  width: 100%;
  padding: 0.85em 1em;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
}

input::placeholder {
  color: var(--text-faint);
}

label {
  display: block;
  font-size: 0.9em;
  color: var(--text-dim);
  margin: 1em 0 0.4em;
}

label:first-child {
  margin-top: 0;
}

button {
  cursor: pointer;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.9em 1.2em;
  font-weight: 600;
}

button.primary {
  width: 100%;
  background: var(--accent);
  color: var(--accent-text);
}

button.primary:hover {
  background: var(--accent-bright);
}

button.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

/* Not button-scoped: also used on the scan log nav link (public/scan/index.html) — a
   button and an <a> that both just fade into the header should look identical. */
.ghost {
  background: transparent;
  color: var(--text-dim);
  padding: 0.5em 0.8em;
  text-decoration: none; /* only matters for the <a> case — buttons never had one */
}

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.page.wide {
  max-width: 920px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6em;
  margin-bottom: 1.75rem;
}

.brand .mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(155deg, var(--accent) 0%, #1c6e4d 100%);
  display: grid;
  place-items: center;
  color: var(--accent-text);
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
}

.brand .name {
  font-weight: 700;
  font-size: 1.02rem;
}

.brand .sub {
  color: var(--text-faint);
  font-size: 0.78rem;
}

.card-panel {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.error-banner {
  background: var(--red-bg);
  border: 1px solid #4a2226;
  color: #ffb3b6;
  border-radius: var(--radius-sm);
  padding: 0.8em 1em;
  font-size: 0.92em;
  margin-bottom: 1rem;
}

.notice-banner {
  background: var(--bg-raised-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  padding: 0.8em 1em;
  font-size: 0.92em;
  margin-bottom: 1rem;
}

.spinner {
  width: 1.1em;
  height: 1.1em;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: currentColor;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.8s linear infinite;
  vertical-align: -0.2em;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92em;
}

th, td {
  text-align: left;
  padding: 0.65em 0.7em;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--text-faint);
  font-weight: 600;
  font-size: 0.82em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
}

.stat-tile {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
}

.stat-tile .n {
  font-size: 1.6rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.stat-tile .label {
  color: var(--text-faint);
  font-size: 0.78rem;
  margin-top: 0.15em;
}

.pill {
  display: inline-block;
  padding: 0.2em 0.65em;
  border-radius: 999px;
  font-size: 0.76em;
  font-weight: 600;
}

.pill.on {
  background: var(--green-bg);
  color: var(--accent-bright);
}

.pill.off {
  background: var(--red-bg);
  color: #ff9498;
}

/* Venue cards — shared by the public showcase (/) and the member offers
   page (/offers). See public/shared/venue-list.mjs: one function renders
   this markup for both, so this is the only place either page's venue
   listing gets styled. */
.venue-showcase-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 0.9rem;
}
.venue-showcase-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}
.venue-showcase-top .name {
  font-weight: 700;
  font-size: 1.02em;
}
.venue-showcase-top .cuisine {
  color: var(--text-faint);
  font-size: 0.8em;
  text-align: right;
  white-space: nowrap;
}
.venue-showcase-card .discount {
  color: var(--accent-bright);
  font-size: 0.9em;
  font-weight: 600;
  margin-top: 0.3em;
}
.venue-showcase-card .address {
  color: var(--text-dim);
  font-size: 0.86em;
  margin-top: 0.35em;
}
.venue-showcase-card .website {
  display: inline-block;
  font-size: 0.86em;
  margin-top: 0.5em;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
