/* ============================================================
   Coeliac-Key – Application Stylesheet
   Design: Clean, trustworthy, medical-adjacent but warm.
   Palette: Deep teal primary, warm off-white background,
            coral/amber accents, strong confidence colours.
   ============================================================ */

:root {
  --clr-bg:          #f7f6f3;
  --clr-surface:     #ffffff;
  --clr-primary:     #1a6b6b;
  --clr-primary-dk:  #134f4f;
  --clr-primary-lt:  #e8f4f4;
  --clr-accent:      #e8622a;
  --clr-text:        #1c2b2b;
  --clr-muted:       #6b8080;
  --clr-border:      #d8e4e4;
  --clr-success:     #27ae60;
  --clr-warning:     #f39c12;
  --clr-danger:      #e74c3c;
  --clr-verified:    #9b59b6;
  --clr-popup:       #d4af00;

  --font-body:       'DM Sans', system-ui, sans-serif;
  --font-display:    'DM Serif Display', Georgia, serif;

  --radius:          10px;
  --radius-lg:       16px;
  --shadow:          0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg:       0 8px 32px rgba(0,0,0,0.12);

  --nav-h:           62px;
}

/* ── Reset & base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--clr-bg);
  color: var(--clr-text);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}

a { color: var(--clr-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.2; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }

img { max-width: 100%; display: block; }

/* ── Navbar ────────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: var(--clr-surface);
  border-bottom: 1px solid var(--clr-border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.navbar__inner {
  max-width: 1100px; margin: 0 auto; padding: 0 1rem;
  height: 100%; display: flex; align-items: center; justify-content: space-between;
  width: 100%;
}
.navbar__brand {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 1.25rem; font-family: var(--font-body); color: var(--clr-text);
  text-decoration: none; flex-shrink: 0;
}
.navbar__key { font-size: 1.4rem; }
.navbar__name strong { color: var(--clr-primary); }

.navbar__links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.nav-link {
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--clr-text);
  text-decoration: none;
  transition: background 0.15s;
  white-space: nowrap;
}
.nav-link:hover { background: var(--clr-primary-lt); text-decoration: none; }
.nav-link--cta {
  background: var(--clr-primary); color: #fff;
  padding: 0.4rem 1rem;
  margin-left: 0.5rem;
}
.nav-link--cta:hover { background: var(--clr-primary-dk); color: #fff; }
.nav-link--admin { color: var(--clr-danger); font-weight: 700; }

.nav-link--signout {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--clr-text);
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  transition: background 0.15s;
  text-align: left;
  white-space: nowrap;
}
.nav-link--signout:hover { background: var(--clr-primary-lt); }

/* ── Hamburger button ───────────────────────────────────────── */
.navbar__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 200;
  flex-shrink: 0;
}
.navbar__hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--clr-text);
  border-radius: 2px;
  transition: all 0.25s ease;
}
.navbar__hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar__hamburger.is-open span:nth-child(2) { opacity: 0; }
.navbar__hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Flash messages ────────────────────────────────────────── */
.flash {
  padding: 0.85rem 1.5rem; font-size: 0.9rem; font-weight: 500;
  border-left: 4px solid;
}
.flash--notice { background: #e8f4f0; border-color: var(--clr-success); color: #1a5c3a; }
.flash--alert  { background: #fdf0ee; border-color: var(--clr-danger);  color: #8a1a1a; }
.form-error-banner {
  background: #fdf0ee; border: 2px solid var(--clr-danger); border-radius: 8px;
  padding: 1rem 1.25rem; margin-bottom: 1.25rem; color: #8a1a1a;
  font-size: 0.9rem; font-weight: 500;
}
.form-error-banner strong { display: block; margin-bottom: 0.4rem; font-size: 0.95rem; }
.form-error-banner ul { margin: 0; padding-left: 1.2rem; }
.form-error-banner li { margin-bottom: 0.2rem; }
.form-control--error { border-color: var(--clr-danger) !important; box-shadow: 0 0 0 3px rgba(231,76,60,0.12) !important; }

/* ── Layout containers ─────────────────────────────────────── */
.main-content { flex: 1; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.container--narrow { max-width: 680px; margin: 0 auto; padding: 0 1.5rem; }
.page-header { padding: 2.5rem 0 1.5rem; }
.section { padding: 2rem 0; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}
.card--sm { padding: 1rem 1.25rem; }
.card + .card { margin-top: 1rem; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.6rem 1.25rem; border-radius: 8px; font-size: 0.9rem;
  font-weight: 600; font-family: var(--font-body);
  border: 2px solid transparent; cursor: pointer;
  text-decoration: none; transition: all 0.15s;
}
.btn--primary   { background: var(--clr-primary); color: #fff; border-color: var(--clr-primary); }
.btn--primary:hover { background: var(--clr-primary-dk); border-color: var(--clr-primary-dk); text-decoration: none; color: #fff; }
.btn--outline   { background: transparent; border-color: var(--clr-primary); color: var(--clr-primary); }
.btn--outline:hover { background: var(--clr-primary-lt); text-decoration: none; }
.btn--danger    { background: var(--clr-danger); color: #fff; border-color: var(--clr-danger); }
.btn--danger:hover { background: #c0392b; text-decoration: none; color: #fff; }
.btn--ghost     { background: transparent; color: var(--clr-muted); border-color: var(--clr-border); }
.btn--ghost:hover { background: var(--clr-bg); text-decoration: none; }
.btn--sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; border-radius: 6px; }
/* Normalise <button> so it matches <a> sizing exactly */
button.btn { line-height: inherit; vertical-align: middle; -webkit-appearance: none; appearance: none; }
form.button_to { display: inline; margin: 0; padding: 0; }
.btn--full { width: 100%; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block; font-size: 0.875rem; font-weight: 600;
  color: var(--clr-text); margin-bottom: 0.375rem;
}
.form-control {
  width: 100%; padding: 0.6rem 0.875rem;
  border: 1.5px solid var(--clr-border); border-radius: 8px;
  font-size: 0.95rem; font-family: var(--font-body);
  background: var(--clr-surface); color: var(--clr-text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus {
  outline: none; border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(26,107,107,0.12);
}
.form-hint { font-size: 0.8rem; color: var(--clr-muted); margin-top: 0.3rem; }
.required-mark { color: var(--clr-danger); font-weight: 700; margin-left: 0.1rem; }
.form-check { display: flex; align-items: center; gap: 0.5rem; }
.form-check input[type=checkbox] { flex-shrink: 0; width: 1rem; height: 1rem; margin: 0; accent-color: var(--clr-primary); cursor: pointer; }
.form-check label { cursor: pointer; user-select: none; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: 0.2rem 0.6rem; border-radius: 99px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.03em;
}
.badge--green    { background: #e8f7ee; color: #1a7a3a; }
.badge--amber    { background: #fef6e4; color: #9a6200; }
.badge--red      { background: #fdecea; color: #9a1a1a; }
.badge--purple   { background: #f3ecfb; color: #6a1a9a; }
.badge--grey     { background: #f0f0f0; color: #5a5a5a; }
.badge--gold     { background: #fef9e4; color: #7a6200; }
.badge--teal     { background: var(--clr-primary-lt); color: var(--clr-primary-dk); }

/* ── Tables ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th {
  text-align: left; padding: 0.75rem 1rem;
  background: var(--clr-bg); border-bottom: 2px solid var(--clr-border);
  font-weight: 600; font-size: 0.8rem; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--clr-muted);
}
td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--clr-border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--clr-bg); }

/* ── Confidence pills ───────────────────────────────────────── */
.confidence-pill {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.25rem 0.7rem; border-radius: 99px;
  font-size: 0.78rem; font-weight: 700;
}
.confidence-dot { width: 8px; height: 8px; border-radius: 50%; }

/* ── Safety disclaimer ──────────────────────────────────────── */
.safety-notice {
  background: #fffbf0; border: 1px solid #f0d060;
  border-radius: 8px; padding: 0.75rem 1rem;
  font-size: 0.82rem; color: #5a4a00;
  display: flex; align-items: flex-start; gap: 0.5rem;
}
.safety-notice::before { content: "⚠️"; flex-shrink: 0; }

/* ── Hero (homepage) ────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--clr-primary) 0%, var(--clr-primary-dk) 100%);
  color: #fff; padding: 5rem 1.5rem 4rem; text-align: center; position: relative; overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='30' cy='30' r='1.5' fill='white' fill-opacity='0.06'/%3E%3C/svg%3E");
}
.hero__inner { position: relative; max-width: 700px; margin: 0 auto; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); margin-bottom: 1.25rem; }
.hero h1 span { color: #8de8c0; }
.hero p { font-size: 1.1rem; opacity: 0.9; margin-bottom: 2rem; }
.hero__cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.hero__cta .btn--light { background: #fff; color: var(--clr-primary); border-color: #fff; }
.hero__cta .btn--light:hover { background: var(--clr-primary-lt); }
.hero__cta .btn--outline-white { background: transparent; color: #fff; border-color: rgba(255,255,255,0.6); }
.hero__cta .btn--outline-white:hover { background: rgba(255,255,255,0.1); }

/* ── Stats bar ──────────────────────────────────────────────── */
.stats-bar {
  background: var(--clr-surface); border-bottom: 1px solid var(--clr-border);
  padding: 1.25rem 1.5rem;
}
.stats-bar__inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; gap: 2rem; flex-wrap: wrap; justify-content: center;
}
.stat { text-align: center; }
.stat__value { font-size: 1.5rem; font-weight: 700; color: var(--clr-primary); }
.stat__label { font-size: 0.8rem; color: var(--clr-muted); }

/* ── Map ────────────────────────────────────────────────────── */
#map {
  flex: 1;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}
.map-wrap { position: relative; }
.map-controls {
  position: absolute; top: 1rem; left: 1rem; z-index: 10;
  display: flex; flex-direction: column; gap: 0.5rem;
}

/* ── Map controls bar ───────────────────────────────────────── */
#map-controls-bar {
  background: var(--clr-surface);
  border-bottom: 1px solid var(--clr-border);
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
#map-controls-inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
#map-legend {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.78rem;
  flex-wrap: wrap;
  color: var(--clr-text);
}
#map-legend span { display: inline-flex; align-items: center; gap: 4px; line-height: 1; }
#map-legend svg { display: block; flex-shrink: 0; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* ── Map outer ──────────────────────────────────────────────── */
#map-outer {
  position: relative;
  display: flex;
  height: 70vh;
  min-height: 400px;
  overflow: hidden;
  z-index: 1;
}
#map { flex: 1; }

/* ── Venue list sidebar ─────────────────────────────────────── */
.venue-list-panel {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 280px;
  background: var(--clr-surface);
  border-right: 1px solid var(--clr-border);
  box-shadow: var(--shadow-lg);
  z-index: 10;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}
.venue-list-panel.is-open { transform: translateX(0); }
.venue-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--clr-border);
  font-size: 0.9rem;
}
#venue-list-content { overflow-y: auto; flex: 1; }
.venue-list-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--clr-border);
  cursor: pointer;
  transition: background 0.15s;
}
.venue-list-item:hover { background: var(--clr-bg); }
.venue-list-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }

/* ── Side panels (add venue / vouch) ────────────────────────── */
#add-venue-panel, #vouch-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 340px;
  background: var(--clr-surface);
  border-left: 1px solid var(--clr-border);
  box-shadow: var(--shadow-lg);
  z-index: 10;
  overflow-y: auto;
  padding: 1.25rem;
}
.side-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

/* ── Geocoder styling ───────────────────────────────────────── */
.mapboxgl-ctrl-geocoder {
  min-width: 240px;
  box-shadow: none !important;
  border: 1.5px solid var(--clr-border) !important;
  border-radius: 8px !important;
  font-family: var(--font-body) !important;
  font-size: 0.875rem !important;
}
.mapboxgl-ctrl-geocoder--input {
  font-family: var(--font-body) !important;
  font-size: 0.875rem !important;
  height: 36px !important;
  padding: 0 2rem 0 2.25rem !important;
}
.venue-list-panel .mapboxgl-ctrl-geocoder { min-width: 100%; width: 100%; }
.mapboxgl-popup-content { padding: 1rem; border-radius: 10px; }

/* ── Map style switcher ─────────────────────────────────────── */
#style-switcher {
  display: flex;
  border: 1.5px solid var(--clr-border);
  border-radius: 8px;
  overflow: hidden;
}
.style-btn {
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 500;
  font-family: var(--font-body);
  background: var(--clr-surface);
  color: var(--clr-text);
  border: none;
  border-right: 1.5px solid var(--clr-border);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.style-btn:last-child { border-right: none; }
.style-btn:hover { background: var(--clr-primary-lt); }
.style-btn.active { background: var(--clr-primary); color: #fff; }

/* ── Dashboard grid ─────────────────────────────────────────── */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.dash-stat {
  background: var(--clr-surface); border: 1px solid var(--clr-border);
  border-radius: var(--radius); padding: 1.25rem; text-align: center;
}
.dash-stat__value { font-size: 2rem; font-weight: 700; color: var(--clr-primary); }
.dash-stat__label { font-size: 0.825rem; color: var(--clr-muted); margin-top: 0.25rem; }

/* ── Progress bar ───────────────────────────────────────────── */
.progress-wrap { margin: 0.75rem 0; }
.progress-bar { height: 8px; background: var(--clr-border); border-radius: 99px; overflow: hidden; }
.progress-bar__fill {
  height: 100%; border-radius: 99px; background: var(--clr-primary);
  transition: width 0.5s ease;
}

/* ── Auth forms ─────────────────────────────────────────────── */
.auth-wrap {
  min-height: calc(100vh - var(--nav-h));
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1rem;
}
.auth-card {
  width: 100%; max-width: 480px;
  background: var(--clr-surface); border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 2.5rem;
}
.auth-card__header { margin-bottom: 2rem; text-align: center; }
.auth-card__header h1 { font-size: 1.75rem; }
.auth-card__header p { color: var(--clr-muted); margin-top: 0.4rem; font-size: 0.9rem; }
.auth-divider { text-align: center; color: var(--clr-muted); margin: 1.25rem 0; font-size: 0.85rem; }

/* ── Admin ──────────────────────────────────────────────────── */
.admin-section { margin-bottom: 2.5rem; }
.admin-section h2 { margin-bottom: 1rem; }

/* ── Venue card ─────────────────────────────────────────────── */
.venue-card {
  background: var(--clr-surface); border: 1px solid var(--clr-border);
  border-radius: var(--radius); padding: 1rem 1.25rem;
  display: flex; align-items: flex-start; gap: 0.75rem;
}
.venue-card__dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; margin-top: 0.25rem; }
.venue-card__name { font-weight: 600; }
.venue-card__meta { font-size: 0.82rem; color: var(--clr-muted); }

/* ── Leaderboard ────────────────────────────────────────────── */
.leaderboard-row { display: flex; align-items: center; gap: 1rem; padding: 0.75rem 1rem; }
.leaderboard-row:not(:last-child) { border-bottom: 1px solid var(--clr-border); }
.leaderboard-row__rank { width: 2rem; font-weight: 700; text-align: center; color: var(--clr-muted); }
.leaderboard-row--top .leaderboard-row__rank { color: var(--clr-accent); font-size: 1.1rem; }
.leaderboard-row__name { flex: 1; font-weight: 500; }
.leaderboard-row__points { font-weight: 700; color: var(--clr-primary); }

/* ── Footer ─────────────────────────────────────────────────── */
.footer {
  background: var(--clr-primary-dk); color: rgba(255,255,255,0.75);
  padding: 2rem 1.5rem;
}
.footer__inner { max-width: 1100px; margin: 0 auto; text-align: center; }
.footer__disclaimer {
  font-size: 0.82rem; margin-bottom: 1rem;
  color: rgba(255,255,255,0.6); max-width: 600px; margin-inline: auto;
}
.footer__nav { display: flex; gap: 1.25rem; justify-content: center; flex-wrap: wrap; margin-bottom: 0.75rem; }
.footer__nav a { color: rgba(255,255,255,0.75); font-size: 0.85rem; }
.footer__nav a:hover { color: #fff; text-decoration: underline; }
.footer__copy { font-size: 0.78rem; color: rgba(255,255,255,0.4); }

/* ── Utilities ──────────────────────────────────────────────── */
.text-muted    { color: var(--clr-muted); }
.text-small    { font-size: 0.85rem; }
.text-center   { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.dashboard-grid {
  grid-template-columns: 2fr 1fr;
}

/* ── Responsive (single consolidated block) ─────────────────── */
@media (max-width: 640px) {
  /* Navbar */
  .navbar__hamburger { display: flex; }
  .navbar__name { font-size: 1rem; }
  .navbar__key { font-size: 1.1rem; }
  .navbar__links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--clr-surface);
    border-bottom: 1px solid var(--clr-border);
    box-shadow: var(--shadow);
    flex-direction: column;
    padding: 0.75rem 1rem;
    gap: 0.25rem;
    z-index: 99;
  }
  .navbar__links.is-open { display: flex; }
  .navbar__inner {
    padding: 0 0.75rem;
  }
  .navbar {
    width: 100%;
  }
  .nav-link {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
  }
  .nav-link--signout {
    font-size: 1rem;
    width: 100%;
    padding: 0.75rem 1rem;
  }
  .nav-link--cta { text-align: center; margin-top: 0.25rem; margin-left: 0; }

  /* Grid */
  .grid-2 { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }

  /* Page header */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  /* Auth */
  .auth-card { padding: 1.5rem; }

  /* Map */
  #map-outer { height: 65vh; }
  #add-venue-panel, #vouch-panel {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--clr-border);
    top: auto;
    height: 60vh;
  }
  .venue-list-panel { width: 85vw; }
  #map-legend {
    width: 100%;
    justify-content: flex-start;
    gap: 0.5rem;
    font-size: 0.72rem;
  }
  .mapboxgl-ctrl-geocoder { min-width: 160px; }
}

/*# sourceMappingURL=application.css-22b4e254abf13ef7323c4616c95087a41f44f198baa5000406312c402c8045c8.map */
