/* 111JA - design system, from assets/style-suggestion.md */

@import url('/static/vendor/fonts/fonts.css');

:root {
  --ink: #062B49;
  --red: #F0443E;
  --beer: #FFB81C;
  --cream: #FFF4DE;
  --white: #FFFFFF;
  --wood: #B95D2B;
  --blue: #6D8FA6;
  --muted: #73808A;

  --bg: var(--white);
  --surface: var(--white);

  --font-body: "Barlow", sans-serif;
  --font-display: "Barlow Semi Condensed", sans-serif;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;

  --border: 3px solid var(--ink);
  --shadow: 4px 4px 0 var(--ink);
  --shadow-small: 2px 2px 0 var(--ink);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 2rem;
}

h1, h2, h3, .display {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  line-height: .95;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 8vw, 3.5rem); }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }

a { color: var(--red); }

/* ── Header ── */
.app-header {
  background: var(--red);
  padding: 1rem 1rem 0;
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  row-gap: 0.4rem;
  align-items: center;
  justify-content: space-between;
}

.logo-link { display: inline-flex; align-items: center; gap: 0.5rem; }
.logo-img { height: 2.25rem; display: block; flex-shrink: 0; }
.header-tagline {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--white);
  font-size: 1.05rem;
  line-height: 1.05;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .header-tagline { font-size: 0.8rem; }
  .logo-img { height: 1.9rem; }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.locale-switch { display: flex; gap: 0.4rem; }
.locale-flag {
  display: inline-flex;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid transparent;
  opacity: 0.6;
  transition: opacity .15s, border-color .15s;
}
.locale-flag img { width: 28px; height: 20px; display: block; object-fit: cover; }
.locale-flag.active, .locale-flag:hover { opacity: 1; border-color: var(--white); }

.nav-bar {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  gap: 0;
  overflow-x: auto;
}
.nav-bar a, .nav-bar button {
  flex: none;
  padding: 0.7rem 1rem;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}
.nav-bar a:hover, .nav-bar button:hover { color: var(--white); }
.nav-bar a.active { color: var(--ink); background: var(--white); border-radius: 8px 8px 0 0; }

.btn-logout {
  border: 2px solid rgba(255,255,255,0.6);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--white);
  padding: 0.35rem 0.75rem;
  font-weight: 700;
  font-size: 0.8rem;
}

/* ── Layout ── */
.container { max-width: 960px; margin: 0 auto; padding: 1rem; }

/* ── Buttons ── */
button, .btn {
  font: inherit;
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--ink);
  border: var(--border);
  border-radius: var(--radius-md);
  background: var(--white);
  padding: .6rem 1rem;
  box-shadow: var(--shadow-small);
  cursor: pointer;
  transition: transform .1s, box-shadow .1s;
  font-size: 0.85rem;
}
button:active, .btn:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}
button.red, .btn-red, button.danger { background: var(--red); color: var(--white); }
button.gold, .btn-gold { background: var(--beer); color: var(--ink); }

/* ── Cards ── */
.card {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.card--red { background: var(--red); color: var(--white); }
.card--navy { background: var(--ink); color: var(--white); }

.card-header {
  background: var(--red);
  color: var(--white);
  padding: 0.6rem 1rem;
  font-weight: 700;
  border-radius: 12px;
  margin-bottom: 0.75rem;
}

.section-title {
  background: var(--red);
  color: var(--white);
  padding: 0.6rem 1rem;
  border-radius: 12px;
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
}

/* ── Forms ── */
input[type="text"], input[type="email"], input[type="number"], input[type="date"],
textarea, select {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: .5rem .75rem;
  border: var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  box-shadow: var(--shadow-small);
}

.filters { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; flex-wrap: wrap; }

.dashboard-tabs {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
  border-bottom: 3px solid var(--ink);
}
.dashboard-tabs button {
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0.6rem 0.2rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--muted);
}
.dashboard-tabs button.active {
  color: var(--red);
  border-bottom: 3px solid var(--red);
  margin-bottom: -3px;
}

.bar-search {
  width: 100%;
  margin-bottom: 0.75rem;
  box-sizing: border-box;
}

.bar-distance { font-size: 0.8rem; }

/* ── Progress ── */
.progress-bar {
  height: 22px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow-small);
}
.progress-bar__fill {
  height: 100%;
  background: var(--beer);
  transition: width 0.5s ease;
}
.progress-caption { text-align: center; margin-top: 0.5rem; }
.progress-shoutout {
  text-align: center;
  margin-top: 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--red);
}

/* ── Bar items ── */
.bar-item {
  border-bottom: 2px solid var(--ink);
  padding: 0.85rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.bar-item:last-child { border-bottom: none; }
.bar-item-row { display: flex; align-items: center; gap: 0.75rem; }
.bar-icon { font-size: 1.25rem; flex-shrink: 0; }
.bar-info { flex: 1; }
.bar-info h3 { font-size: 1rem; margin-bottom: 0.15rem; }
.bar-info p { font-size: 0.8rem; color: var(--muted); margin: 0; }
.bar-info .bar-description { font-style: italic; margin-top: 0.15rem; }
.book-page-tag { font-size: 0.75rem; font-weight: 600; font-style: normal; }
.district-heading { margin-bottom: 0.5rem; font-size: 1rem; }

/* ── Photos ── */
.photo-strip { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: flex-start; }
.photo-thumb { position: relative; width: 64px; }
.photo-thumb img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 2px solid var(--ink);
  display: block;
}
.photo-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--red);
  color: var(--white);
  border: 2px solid var(--white);
  padding: 0;
  font-size: 0.8rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}
.photo-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border: 2px dashed var(--muted);
  border-radius: var(--radius-sm);
  font-size: 0.65rem;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  padding: 0.25rem;
}

/* ── Missions ── */
.mission-item {
  border: 2px solid var(--ink);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}
.mission-item .mission-title { font-size: 1.05rem; }
.mission-meta { font-size: 0.8rem; color: var(--muted); margin: 0.15rem 0 0.5rem; }
.mission-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }
.status-badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--cream);
  color: var(--ink);
}
.status-badge.status-active { background: var(--beer); }
.status-badge.status-completed { background: var(--ink); color: var(--white); }
.status-badge.status-cancelled { background: var(--muted); color: var(--white); }

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th, td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 2px solid var(--ink); }
th { font-weight: 700; background: rgba(109,143,166,0.1); }

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 700;
}
.badge-admin { background: var(--red); color: var(--white); }
.badge-user { background: var(--beer); color: var(--ink); }

@media (max-width: 640px) {
  .container { padding: .75rem; }
  table, thead, tbody, th, td, tr { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
}

/* ── Misc ── */
.muted { color: var(--muted); font-style: italic; }
.flash-message { margin-top: 0.5rem; font-weight: 600; }
.flash-message.ok { color: #1a7a3c; }
.flash-message.error { color: var(--red); }

/* ── Login ── */
.login-wrap {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: var(--white);
  border: 4px solid var(--ink);
  border-radius: 24px;
  box-shadow: 6px 6px 0 var(--ink);
  padding: 3rem 2.5rem;
  text-align: center;
  max-width: 420px;
  width: 90vw;
}
.login-logo-img { height: 4rem; margin-bottom: 1rem; }
.login-subtitle { font-size: 0.95rem; color: var(--muted); margin-bottom: 2rem; }
.login-body p { font-size: 1rem; line-height: 1.6; }
.login-body .slogan { display: block; margin-top: 1.5rem; font-style: italic; color: var(--red); font-weight: 700; }
.loading-text { margin-top: 2rem; font-size: 0.9rem; color: var(--muted); }

/* ── PWA install banner ── */
#install-banner {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  max-width: 960px;
  margin: 0 auto;
  background: var(--beer);
  border: 3px solid var(--ink);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  display: none;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  z-index: 999;
}

.bar-card {
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
}
.bar-card h3 { font-size: 0.95rem; margin-bottom: 0.25rem; }
.bar-card p { font-size: 0.8rem; color: var(--muted); margin: 0; }

/* ── Map ── */
#map {
  width: 100%;
  height: 420px;
  border: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
