/* ══════════════════════════════════════════════════════════════════════════
   Circl for web, design system
   ──────────────────────────────────────────────────────────────────────────
   Values lifted from Extensions/Color+Brand.swift so the web build reads as
   the same product, not a lookalike. Dark only: the app supports both, but the
   dark palette is the one people recognise, and a stripped-down companion is
   not the place to maintain a second theme that nobody asked for.

   Typefaces match too, ClashDisplay for headings, Nunito for everything else.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Typefaces ─────────────────────────────────────────────────────────── */
/*
   Self-hosted, and the same files the landing and referral pages ship, these
   are the product's actual fonts rather than a CDN's nearest match. Serving
   them from our own origin also means the CSP needs no third-party font host,
   and the text cannot change because someone else's service went down.
*/
@font-face{
  font-family:'ClashDisplay'; src:url('/fonts/ClashDisplay-Medium.otf') format('opentype');
  font-weight:500; font-style:normal; font-display:swap;
}
@font-face{
  font-family:'ClashDisplay'; src:url('/fonts/ClashDisplay-Semibold.otf') format('opentype');
  font-weight:600; font-style:normal; font-display:swap;
}
@font-face{
  font-family:'ClashDisplay'; src:url('/fonts/ClashDisplay-Bold.otf') format('opentype');
  font-weight:700; font-style:normal; font-display:swap;
}
@font-face{
  font-family:'Nunito'; src:url('/fonts/Nunito-Regular.ttf') format('truetype');
  font-weight:400; font-style:normal; font-display:swap;
}
@font-face{
  font-family:'Nunito'; src:url('/fonts/Nunito-SemiBold.ttf') format('truetype');
  font-weight:600; font-style:normal; font-display:swap;
}
@font-face{
  font-family:'Nunito'; src:url('/fonts/Nunito-Bold.ttf') format('truetype');
  font-weight:700; font-style:normal; font-display:swap;
}

:root{
  --ink:#0A0D17;
  --ink2:#11151F;
  --ink3:#1A1F2C;
  --ink4:#252B39;

  --fg:#F1ECE2;
  --fg-dim:rgba(241,236,226,.62);
  --fg-faint:rgba(241,236,226,.35);
  --tint:rgba(255,255,255,1);

  --primary:#5BC174;
  --coral:#F3A07A;
  --iris:#A89BF0;
  --rose:#F2789B;
  --teal:#7BD8D2;
  --amber:#E8C766;

  --line:rgba(255,255,255,.08);
  --line-strong:rgba(255,255,255,.14);

  --rail:248px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:var(--ink);
  color:var(--fg);
  font-family:"Nunito",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  font-size:15px;
  -webkit-font-smoothing:antialiased;
  overflow:hidden;
}
h1,h2,h3,.display{
  font-family:'ClashDisplay',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  font-weight:600;
  letter-spacing:-.015em;
  margin:0;
}
a{color:var(--primary);text-decoration:none}

/* ── Shell ─────────────────────────────────────────────────────────────── */
.shell{display:flex;height:100vh}
.rail{
  width:var(--rail);flex:0 0 var(--rail);
  background:var(--ink2);border-right:1px solid var(--line);
  display:flex;flex-direction:column;padding:20px 14px 14px;
}
.brand{display:flex;align-items:center;gap:9px;padding:0 8px 22px}
.brand .mark{
  width:30px;height:30px;border-radius:9px;background:var(--primary);
  display:flex;align-items:center;justify-content:center;
  font-family:'ClashDisplay',sans-serif;
  font-weight:700;color:var(--ink);font-size:17px;flex:0 0 30px;
}
.brand .name{font-family:'ClashDisplay',sans-serif;font-weight:600;font-size:19px}
/* The wordmark carries the brand on its own, no lettermark beside it, and no
   repeated "Circl" in text, which read as a caption for a logo that already
   says the same word. */
.brand .wordmark{height:26px;width:auto;display:block}

.nav{display:flex;flex-direction:column;gap:3px;flex:1}
.nav a{
  display:flex;align-items:center;gap:11px;
  padding:10px 12px;border-radius:11px;
  color:var(--fg-dim);font-weight:600;font-size:14.5px;
  transition:background .12s,color .12s;
}
.nav a svg{width:18px;height:18px;flex:0 0 18px;stroke-width:2}
.nav a:hover{background:var(--ink3);color:var(--fg)}
.nav a.on{background:var(--ink4);color:var(--fg)}
.nav a.on svg{color:var(--primary)}

.rail-foot{border-top:1px solid var(--line);padding-top:12px;margin-top:8px}
.me{display:flex;align-items:center;gap:9px;padding:6px 8px 12px}
.me .av{
  width:30px;height:30px;border-radius:50%;flex:0 0 30px;
  background:var(--ink4);display:flex;align-items:center;justify-content:center;
  font-weight:700;font-size:13px;background-size:cover;background-position:center;
}
.me .who{min-width:0}
.me .nm{font-size:13.5px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.me .sub{font-size:11.5px;color:var(--fg-faint);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.signout{
  width:100%;display:flex;align-items:center;justify-content:center;gap:8px;
  padding:9px;border-radius:11px;border:1px solid var(--line-strong);
  background:transparent;color:var(--fg-dim);font-family:inherit;
  font-size:13.5px;font-weight:700;cursor:pointer;
}
.signout:hover{background:var(--ink3);color:var(--fg)}

/* ── Main ──────────────────────────────────────────────────────────────── */
.main{flex:1;min-width:0;display:flex;flex-direction:column;position:relative}
.topline{
  display:flex;align-items:center;gap:12px;
  padding:16px 22px;border-bottom:1px solid var(--line);flex:0 0 auto;
}
.topline h1{font-size:21px}
.topline .sub{font-size:12.5px;color:var(--fg-faint)}
.spacer{flex:1}
.view{flex:1;min-height:0;overflow:auto;padding:20px 22px}
.view.flush{padding:0}

select.picker{
  background:var(--ink3);color:var(--fg);border:1px solid var(--line-strong);
  border-radius:10px;padding:7px 11px;font-family:inherit;font-size:13.5px;font-weight:600;
}

/* ── Map ───────────────────────────────────────────────────────────────── */
#map{width:100%;height:100%;background:var(--ink)}
.leaflet-container{background:var(--ink)!important;font-family:"Nunito",sans-serif}
.leaflet-control-attribution{
  background:rgba(10,13,23,.78)!important;color:var(--fg-faint)!important;font-size:10px!important;
}
.leaflet-control-attribution a{color:var(--fg-dim)!important}
.leaflet-bar a{
  background:var(--ink3)!important;color:var(--fg)!important;
  border-color:var(--line-strong)!important;
}
.leaflet-bar a:hover{background:var(--ink4)!important}

/* Member pin: initials in a coloured disc, mirroring the app's avatars. */
.pin{
  width:38px;height:38px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  font-family:"Nunito",sans-serif;font-weight:700;font-size:14px;color:var(--ink);
  border:2.5px solid var(--ink);box-shadow:0 3px 12px rgba(0,0,0,.5);
  background-size:cover;background-position:center;
}
.pin.moving::after{
  content:'';position:absolute;inset:-7px;border-radius:50%;
  border:2px solid currentColor;opacity:.45;animation:pulse 1.9s ease-out infinite;
}
@keyframes pulse{
  0%{transform:scale(.82);opacity:.55}
  100%{transform:scale(1.35);opacity:0}
}
.place-pin{
  width:30px;height:30px;border-radius:9px;background:var(--ink3);
  border:1.5px solid var(--line-strong);
  display:flex;align-items:center;justify-content:center;font-size:15px;
}
.leaflet-popup-content-wrapper{
  background:var(--ink3);color:var(--fg);border-radius:13px;border:1px solid var(--line-strong);
}
.leaflet-popup-tip{background:var(--ink3)}
.leaflet-popup-content{margin:11px 13px;font-size:13px}
.pop-nm{font-weight:700;font-size:14px;margin-bottom:3px}
.pop-meta{color:var(--fg-dim);font-size:12px;line-height:1.5}

/* Layer switcher, restyled from Leaflet's default white box. */
.leaflet-control-layers{
  background:var(--ink3)!important;border:1px solid var(--line-strong)!important;
  border-radius:12px!important;box-shadow:0 4px 16px rgba(0,0,0,.45)!important;color:var(--fg);
}
.leaflet-control-layers-toggle{
  background-color:var(--ink3)!important;border-radius:11px!important;
}
.leaflet-control-layers-expanded{padding:10px 12px!important;font-size:13px}
.leaflet-control-layers-base label{display:flex;align-items:center;gap:7px;margin:3px 0;cursor:pointer}
.leaflet-control-layers-base input{accent-color:var(--primary)}

/* Over satellite imagery the pins need a light rim, or dark-bordered discs
   disappear into dark ground. */
#map.sat .pin{border-color:rgba(255,255,255,.92);box-shadow:0 3px 14px rgba(0,0,0,.75)}
#map.sat .place-pin{background:rgba(10,13,23,.82);border-color:rgba(255,255,255,.5)}

/* ── Cards / lists ─────────────────────────────────────────────────────── */
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(268px,1fr));gap:13px}
.card{
  background:var(--ink2);border:1px solid var(--line);border-radius:16px;padding:16px;
}
.card h3{font-size:16px;margin-bottom:3px}
.card .meta{font-size:12.5px;color:var(--fg-faint)}

.row{
  display:flex;align-items:center;gap:12px;padding:12px 14px;
  background:var(--ink2);border:1px solid var(--line);border-radius:14px;margin-bottom:9px;
}
.row .av{
  width:36px;height:36px;border-radius:50%;flex:0 0 36px;
  display:flex;align-items:center;justify-content:center;
  font-weight:700;font-size:14px;color:var(--ink);
  background-size:cover;background-position:center;
}
.row .nm{font-weight:700;font-size:14.5px}
.row .sub{font-size:12px;color:var(--fg-faint);margin-top:1px}
.row .right{margin-left:auto;text-align:right;font-size:12px;color:var(--fg-dim)}

.dot{width:7px;height:7px;border-radius:50%;display:inline-block;margin-right:5px}
.dot.live{background:var(--primary);box-shadow:0 0 0 3px rgba(91,193,116,.2)}
.dot.stale{background:var(--fg-faint)}

.empty{
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  height:100%;gap:7px;color:var(--fg-faint);text-align:center;padding:40px;
}
.empty .big{font-size:17px;color:var(--fg-dim);font-family:'ClashDisplay',sans-serif}

/* ── Login ─────────────────────────────────────────────────────────────── */
.login-page{height:100%;display:flex;align-items:center;justify-content:center;padding:24px;overflow:auto}
.login{width:100%;max-width:372px}
.login .brand{justify-content:center;padding-bottom:26px}
.login .brand .wordmark-lg{height:46px;width:auto;display:block}
.login .box{background:var(--ink2);border:1px solid var(--line);border-radius:20px;padding:24px}
.login h1{font-size:22px;margin-bottom:5px}
.login .lede{font-size:13.5px;color:var(--fg-dim);margin:0 0 20px;line-height:1.5}
.field{margin-bottom:14px}
.field label{display:block;font-size:12px;font-weight:700;color:var(--fg-dim);margin-bottom:6px}
.field input{
  width:100%;padding:12px 14px;border-radius:12px;
  background:var(--ink3);border:1px solid var(--line-strong);color:var(--fg);
  font-family:inherit;font-size:15px;
}
.field input:focus{outline:none;border-color:var(--primary)}
.btn-primary{
  width:100%;padding:13px;border-radius:12px;border:none;
  background:var(--primary);color:var(--ink);
  font-family:inherit;font-size:15px;font-weight:700;cursor:pointer;
}
.btn-primary:hover:not(:disabled){filter:brightness(1.07)}
.btn-primary:disabled{opacity:.55;cursor:default}
.err{
  background:rgba(242,120,155,.12);border:1px solid rgba(242,120,155,.35);
  color:var(--rose);padding:11px 13px;border-radius:12px;font-size:13px;
  margin-bottom:14px;display:none;line-height:1.45;
}
.err.show{display:block}
.note{font-size:12px;color:var(--fg-faint);text-align:center;margin:16px 0 0;line-height:1.55}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width:760px){
  :root{--rail:100%}
  .shell{flex-direction:column}
  .rail{
    width:100%;flex:0 0 auto;flex-direction:row;align-items:center;
    padding:9px 12px;border-right:none;border-bottom:1px solid var(--line);gap:8px;
  }
  .brand{padding:0 8px 0 0}
  .brand .name,.me,.rail-foot{display:none}
  .brand .wordmark{height:21px}
  .nav{flex-direction:row;gap:2px;overflow-x:auto}
  .nav a{padding:8px 11px;font-size:13px}
  .nav a span{display:none}
  .view{padding:14px}
}
