/* Canvas Scout app — shared styles (login, set password, map). Brand: Scout Blue, Trail Peach, Night Ink. */
/* Fonts are self-hosted (SIL Open Font License, see fonts/OFL-*.txt): no requests to font CDNs */
@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/archivo-400.woff2) format('woff2'); }
@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/archivo-500.woff2) format('woff2'); }
@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/archivo-600.woff2) format('woff2'); }
@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/archivo-700.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-mono-500.woff2) format('woff2'); }

:root {
  --blue: #0372CE; --peach: #FDB685; --cream: #F2DDD0; --ink: #0B1A2E; --ink-2: #12253D; --ink-3: #1B324F;
  --paper: #F6F2EC; --white: #fff; --gray: #C9CED6; --muted: rgba(255,255,255,.66); --line: rgba(255,255,255,.12);
  --font: indivisible, Archivo, Arial, system-ui, sans-serif; --mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: #081424; color: var(--white); font-family: var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--peach); }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--peach); outline-offset: 2px; }
.label { font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; }

/* ---------- Auth pages ---------- */
.auth { min-height: 100svh; display: grid; place-items: center; padding: 32px 16px; position: relative; overflow: hidden; }
.auth::before { content: ""; position: absolute; inset: 0; background: url(gradient-tall-sm.webp) center top / cover no-repeat; opacity: .9; }
.auth::after { content: ""; position: absolute; inset: 0; background: url(grain.svg); mix-blend-mode: overlay; opacity: .35; pointer-events: none; }
.auth-card {
  position: relative; z-index: 1; width: min(420px, 100%); display: grid; gap: 20px; padding: 32px;
  background: rgba(11, 26, 46, .82); border: 1px solid var(--line); border-radius: 24px;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 40px 80px -30px rgba(0,0,0,.7);
}
.auth-card .logo { height: 44px; width: auto; justify-self: start; }
.auth-card h1 { margin: 0; font-size: 34px; line-height: 1; font-weight: 700; letter-spacing: -.02em; }
.auth-card p { margin: 0; color: var(--muted); line-height: 1.5; }
.field { display: grid; gap: 8px; }
.field label { font-size: 14px; font-weight: 600; }
.input {
  width: 100%; height: 50px; padding: 0 16px; border-radius: 14px; font: inherit; font-size: 16px; color: var(--white);
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.18); transition: border-color .2s, box-shadow .2s;
}
.input:focus { outline: none; border-color: var(--peach); box-shadow: 0 0 0 4px rgba(253,182,133,.18); }
.btn {
  height: 50px; border: 0; border-radius: 999px; background: var(--peach); color: var(--ink); font-weight: 700; font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .4s var(--ease), opacity .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: wait; transform: none; }
.msg { font-size: 14px; padding: 10px 14px; border-radius: 12px; background: rgba(253,182,133,.14); border: 1px solid rgba(253,182,133,.35); color: var(--cream); }
.msg.ok { background: rgba(3,114,206,.18); border-color: rgba(3,114,206,.5); }
.small { font-size: 13.5px; color: var(--muted); }
.auth-foot { position: relative; z-index: 1; margin-top: 18px; text-align: center; color: rgba(255,255,255,.55); }

/* ---------- Map app ---------- */
#map { position: fixed; inset: 0; }
.bar {
  position: fixed; z-index: 10; left: 12px; right: 12px; top: 12px; display: flex; align-items: center; gap: 10px;
  padding: 8px 8px 8px 14px; background: rgba(11,26,46,.88); border: 1px solid var(--line); border-radius: 999px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 12px 30px rgba(0,0,0,.35);
}
.bar .logo { height: 30px; width: auto; flex: none; }
.bar .terr { display: grid; line-height: 1.15; min-width: 0; }
.bar .terr b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .terr span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.bar .grow { flex: 1; }
.chips { display: flex; gap: 6px; }
.chip {
  height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.22); background: transparent; color: var(--white);
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; transition: background-color .2s, border-color .2s, opacity .2s;
}
.chip i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--ink); }
.chip[aria-pressed="false"] { opacity: .45; }
.stat { font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; padding: 0 4px; }
.stat b { color: var(--peach); font-weight: 500; }
.acct { position: relative; }
.acct > button {
  width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--peach); color: var(--ink); font-family: var(--mono); font-weight: 500; font-size: 13px;
}
.menu {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 240px; padding: 14px; display: grid; gap: 10px;
  background: var(--ink); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 20px 40px rgba(0,0,0,.5);
}
.menu b { font-size: 15px; }
.menu .small { word-break: break-all; }
.menu button { height: 40px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--white); text-align: left; padding: 0 12px; }
.menu button:hover { background: rgba(255,255,255,.06); }

.hint {
  position: fixed; z-index: 9; left: 50%; top: 76px; transform: translateX(-50%); padding: 8px 14px; border-radius: 999px;
  background: rgba(11,26,46,.88); border: 1px solid var(--line); font-size: 13px; color: var(--cream); white-space: nowrap;
}

/* Business card: side panel on desktop, bottom sheet on phones */
.card {
  position: fixed; z-index: 11; right: 12px; bottom: 12px; top: 76px; width: 380px; overflow: auto; padding: 20px; display: grid; gap: 14px; align-content: start;
  background: var(--white); color: var(--ink); border-radius: 20px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.6);
  transform: translateX(calc(100% + 24px)); transition: transform .45s var(--ease);
}
.card.on { transform: none; }
.card .top { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.card h2 { margin: 0; font-size: 22px; line-height: 1.15; letter-spacing: -.01em; }
.card .sub { color: #5b6573; font-size: 13.5px; margin-top: 4px; text-transform: capitalize; }
.score { font-family: var(--mono); font-weight: 500; font-size: 20px; line-height: 1; background: var(--peach); color: var(--ink); border-radius: 12px; padding: 8px 10px; text-align: center; flex: none; }
.score small { display: block; font-size: 9px; letter-spacing: .08em; margin-top: 3px; opacity: .75; }
.card .rows { display: grid; gap: 8px; font-size: 15px; }
.card .rows a { color: var(--blue); font-weight: 600; text-decoration: none; word-break: break-all; }
.card h3 { margin: 4px 0 0; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); }
.card ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14.5px; }
.pitch { display: flex; flex-wrap: wrap; gap: 6px; }
.pitch span { background: var(--ink); color: var(--peach); border-radius: 999px; padding: 4px 10px; font-size: 12.5px; font-weight: 600; }
.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.actions a {
  height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
  text-decoration: none; background: var(--paper); color: var(--ink);
}
.actions a.primary { background: var(--ink); color: var(--peach); }
.actions a[aria-disabled="true"] { opacity: .4; pointer-events: none; }
.card .close { position: sticky; top: 0; justify-self: end; margin: -8px -8px 0 0; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--paper); color: var(--ink); font-size: 18px; line-height: 1; }
.card .foot { font-size: 12.5px; color: #5b6573; }
.card .err { color: #b10202; font-weight: 600; }

.toast {
  position: fixed; z-index: 20; left: 50%; bottom: 24px; transform: translateX(-50%); padding: 10px 16px; border-radius: 999px;
  background: var(--ink); border: 1px solid var(--line); color: var(--white); font-size: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.4);
}
.maplibregl-ctrl-group { background: rgba(11,26,46,.9) !important; border: 1px solid var(--line); }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--line) !important; }
.maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1); }
.maplibregl-ctrl-attrib { background: rgba(11,26,46,.7) !important; color: rgba(255,255,255,.6); }
.maplibregl-ctrl-attrib a { color: rgba(255,255,255,.75); }

@media (max-width: 900px) {
  .bar .stat.optional, .bar .terr span { display: none; }
}
@media (max-width: 640px) {
  .bar { flex-wrap: wrap; border-radius: 22px; }
  .bar .grow { display: none; }
  .chips { order: 5; width: 100%; justify-content: space-between; }
  .chip { flex: 1; justify-content: center; }
  .hint { top: 122px; }
  .card { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 62svh; border-radius: 20px 20px 16px 16px; transform: translateY(calc(100% + 24px)); }
}
.menu .menu-link { height: 40px; border-radius: 10px; border: 1px solid var(--line); display: flex; align-items: center; padding: 0 12px; color: var(--peach); font-weight: 600; text-decoration: none; }
.menu .menu-link:hover { background: rgba(255,255,255,.06); }
