/* ==========================================================================
   Spot2Rank - Modern redesign layer  ("Night Cartograph")
   Loads AFTER templatemo-lava.css and overrides the visible surface.
   Direction: a deep night-map instrument panel. Signal amber + mint readouts,
   monospaced coordinate data, an extruded 3D Hexagone as the hero signature.
   Functional JS-driven colors (#20c997 / #dc3545 / #ef9b0b) are preserved.
   ========================================================================== */

:root {
  --ink:        #0a0e1c;   /* deep night-map base            */
  --ink-2:      #0e1426;   /* raised surface                 */
  --panel:      rgba(20, 27, 48, 0.66);
  --panel-soft: rgba(255, 255, 255, 0.04);
  --line:       rgba(255, 255, 255, 0.10);
  --line-soft:  rgba(255, 255, 255, 0.06);

  --amber:      #f2a516;   /* signal accent (refined brand)  */
  --amber-2:    #ff8a3c;
  --mint:       #2dd4a7;   /* positive readout               */
  --coral:      #ff6b6b;   /* negative readout               */

  --paper:      #eef1fa;   /* primary text                   */
  --muted:      #9aa3bd;   /* secondary text                 */
  --faint:      #5f6987;   /* tertiary / captions            */

  --radius:     18px;
  --radius-sm:  12px;
  --glow-amber: 0 0 0 1px rgba(242,165,22,.35), 0 14px 40px -12px rgba(242,165,22,.55);
  --shadow:     0 24px 60px -24px rgba(0,0,0,.75);

  --display: 'Space Grotesk', 'Poppins', system-ui, sans-serif;
  --body:    'Inter', system-ui, sans-serif;
  --mono:    'Space Mono', ui-monospace, 'SF Mono', monospace;
}

/* ---- base ---------------------------------------------------------------- */
html { scroll-behavior: smooth; }

body {
  background-color: var(--ink);
  background-image:
    radial-gradient(900px 540px at 80% -6%, rgba(242,165,22,.22), transparent 60%),
    radial-gradient(820px 620px at 6% 16%,  rgba(45,212,167,.16), transparent 55%),
    radial-gradient(1200px 820px at 50% 118%, rgba(255,138,60,.12), transparent 60%);
  color: var(--paper);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* faint topographic contour wash behind everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .5;
  background-image:
    repeating-radial-gradient(circle at 80% 0%,
      transparent 0 38px, rgba(255,255,255,.022) 38px 39px);
  mask-image: radial-gradient(120% 90% at 70% 10%, #000 30%, transparent 75%);
}

.section, footer, .welcome-area, header { position: relative; z-index: 1; }

h1, h2, h3, h4, h5 { font-family: var(--display); color: var(--paper); letter-spacing: -.01em; }
p { color: var(--muted); }
em { font-style: normal; color: var(--amber); }
a { color: var(--amber); }
hr { border-color: var(--line); opacity: 1; }

::selection { background: rgba(242,165,22,.30); color: #fff; }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---- header / nav -------------------------------------------------------- */
.header-area { height: 86px; }

.header-area .main-nav { min-height: 64px; }

.header-area.background-header,
.background-header .header-area {
  background: rgba(10, 14, 28, .82) !important;
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 30px -20px rgba(0,0,0,.9);
}

.header-area .main-nav .logo,
.background-header .main-nav .logo {
  font-family: var(--display);
  color: var(--paper) !important;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 64px;
  text-transform: none;
  position: relative;
  padding-left: 16px;
}
.header-area .main-nav .logo::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 7px; height: 7px;
  transform: translateY(-50%) rotate(45deg);
  background: var(--amber);
  box-shadow: 0 0 14px var(--amber);
}

.header-area .main-nav .nav {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  margin-top: 16px;
  padding: 4px 8px;
}
.header-area .main-nav .nav li a,
.background-header .main-nav .nav li a {
  color: var(--muted) !important;
  font-family: var(--body);
  font-weight: 500;
  font-size: 14px;
  border-radius: 999px;
  padding: 8px 14px;
  height: auto;
  line-height: 1.2;
  transition: color .2s ease, background .2s ease;
}
.header-area .main-nav .nav li a:hover,
.header-area .main-nav .nav li:hover a,
.background-header .main-nav .nav li:hover a {
  color: var(--paper) !important;
  background: var(--panel-soft);
}

/* Auth dropdown (Login/Register + user menu, injected by auth.js).
   Its base style in index.html hardcodes a white panel; restate it on the
   theme variables so the items stay readable in both themes, and out-rank
   the generic li:hover link recolor above. */
.header-area .main-nav .nav li .dropdown-menu {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  overflow: hidden;
  padding: 4px 0;
}
.header-area .main-nav .nav li .dropdown-menu a,
.header-area .main-nav .nav li:hover .dropdown-menu a,
.background-header .main-nav .nav li:hover .dropdown-menu a {
  color: var(--paper) !important;
  background: transparent;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  padding: 10px 16px;
}
.header-area .main-nav .nav li .dropdown-menu a:last-child {
  border-bottom: none;
}
.header-area .main-nav .nav li .dropdown-menu a:hover,
.header-area .main-nav .nav li:hover .dropdown-menu a:hover {
  color: var(--amber) !important;
  background: var(--panel-soft);
}

#languageSelector {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
}
#languageSelector option { background: var(--ink-2); color: var(--paper); }

.header-area .main-nav .menu-trigger span,
.header-area .main-nav .menu-trigger span:before,
.header-area .main-nav .menu-trigger span:after { background-color: var(--paper); }

/* ==========================================================================
   HERO  - the signature
   ========================================================================== */
.welcome-area {
  background: none !important;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0 60px;
}
.welcome-area .header-text { width: 100%; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 40px;
  align-items: center;
}

/* left column ------------------------------------------------------------- */
.hero-copy { max-width: 580px; }

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px 7px 12px;
  margin-bottom: 26px;
}
.hero-kicker .coord { color: var(--amber); }
.hero-kicker .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 10px var(--mint);
  animation: s2r-pulse 2.4s ease-in-out infinite;
}

.welcome-area .header-text h1,
.hero-copy h1 {
  font-family: var(--display);
  font-size: clamp(2.6rem, 5.4vw, 4.4rem);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -.03em;
  color: var(--paper);
  margin: 0 0 20px;
}
.hero-copy h1 em {
  background: linear-gradient(120deg, var(--amber), var(--amber-2) 60%, var(--mint));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  font-style: normal;
}

.hero-copy p {
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--muted);
  margin-bottom: 30px;
  max-width: 50ch;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

.hero-stats {
  display: flex;
  gap: 30px;
  margin-top: 38px;
  padding-top: 26px;
  border-top: 1px solid var(--line-soft);
}
.hero-stats .stat-num {
  font-family: var(--mono);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--paper);
  line-height: 1;
}
.hero-stats .stat-num span { color: var(--amber); }
.hero-stats .stat-label {
  display: block;
  margin-top: 7px;
  font-size: .8rem;
  color: var(--faint);
  letter-spacing: .02em;
}

/* right column: 3D proximity radar --------------------------------------- */
.hero-visual {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin-left: auto;
}

/* the radar canvas itself is the square */
.radar-stage,
#proximityRadar {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  cursor: grab;
  touch-action: pan-y;
}
#proximityRadar:active { cursor: grabbing; }
.hero-visual::before {  /* ambient glow behind the radar disc */
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  aspect-ratio: 1 / 1;
  inset: auto;
  margin: 6%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(45,212,167,.14), transparent 62%);
  filter: blur(8px);
  pointer-events: none;
}

/* live score card overlaid on the radar */
.radar-score {
  position: absolute;
  top: 2%;
  left: 0;
  background: rgba(10,14,28,.62);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 18px;
  backdrop-filter: blur(8px);
  pointer-events: none;
  text-align: left;
}
.radar-score .rs-label {
  display: block;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 2px;
}
.radar-score .rs-num {
  font-family: var(--display);
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(120deg, var(--mint), var(--amber));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.radar-score .rs-max { font-family: var(--mono); font-size: .85rem; color: var(--faint); margin-left: 2px; }

.radar-legend {
  position: absolute;
  top: 4%;
  right: 0;
  display: flex;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  pointer-events: none;
}
.radar-legend .dotc { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 3px; }
.radar-legend .dotc.near { background: var(--mint); box-shadow: 0 0 8px var(--mint); }
.radar-legend .dotc.mid  { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.radar-legend .dotc.far  { background: var(--amber-2); box-shadow: 0 0 8px var(--amber-2); }

.radar-hint {
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .02em;
  color: var(--faint);
  margin: 6px 0 12px;
}

/* "How does the score work?" - opt-in reveal for the demo controls */
.score-explainer-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 10px auto 0;
  padding: 7px 16px;
  font-family: var(--body);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.score-explainer-link:hover {
  color: var(--paper);
  border-color: rgba(242,165,22,.5);
  background: var(--panel-soft);
}
.score-explainer-link i { color: var(--amber); font-size: .95em; }
.score-explainer-link.is-open i { opacity: .7; }

/* center the link under the radar */
.hero-visual { text-align: center; }

.score-explainer[hidden] { display: none; }
.score-explainer { animation: fadeIn .3s ease; margin-top: 8px; }

.radar-note {
  max-width: 320px;
  margin: 10px auto 0;
  font-family: var(--body);
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--faint);
  text-align: center;
}

/* service toggle chips - the purposeful interaction */
.radar-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.radar-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  font-family: var(--body);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: rgba(255,255,255,.03);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease, background .18s ease, transform .12s ease;
}
.radar-chip i { color: var(--faint); transition: color .18s ease; font-size: .95em; }
.radar-chip:hover { transform: translateY(-2px); border-color: rgba(242,165,22,.4); color: var(--paper); }
.radar-chip.is-active {
  color: #1a1305;
  background: linear-gradient(120deg, var(--amber), var(--amber-2));
  border-color: transparent;
  box-shadow: 0 8px 22px -10px rgba(242,165,22,.7);
}
.radar-chip.is-active i { color: #1a1305; }

/* ---- buttons (shared) ---------------------------------------------------- */
a.main-button-slider,
button.main-button-slider,
a.main-button,
button.main-button {
  font-family: var(--body);
  font-weight: 600;
  letter-spacing: .01em;
  border-radius: 999px !important;
  border: none;
  background: linear-gradient(120deg, var(--amber) 0%, var(--amber-2) 100%) !important;
  color: #1a1305 !important;
  box-shadow: var(--glow-amber);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
a.main-button-slider {
  display: inline-block;
  padding: 14px 30px;
  font-size: 15px;
  text-transform: none;
  line-height: 1.2;
}
button.main-button, a.main-button {
  padding: 12px 26px;
  font-size: 14px;
}
a.main-button-slider:hover,
button.main-button-slider:hover,
a.main-button:hover,
button.main-button:hover {
  transform: translateY(-3px);
  filter: brightness(1.05);
  box-shadow: 0 0 0 1px rgba(242,165,22,.5), 0 22px 48px -14px rgba(242,165,22,.7) !important;
  color: #1a1305 !important;
}

/* ghost / secondary button (new) */
.ghost-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 24px;
  border-radius: 999px;
  font-family: var(--body);
  font-weight: 600;
  font-size: 14px;
  color: var(--paper);
  background: var(--panel);
  border: 1px solid var(--line);
  text-decoration: none;
  transition: border-color .2s ease, transform .2s ease, background .2s ease;
}
.ghost-button:hover {
  border-color: rgba(242,165,22,.6);
  color: var(--paper);
  transform: translateY(-2px);
  background: var(--panel-soft);
}

/* ==========================================================================
   Spot2Rank interactive section
   ========================================================================== */
#Spot2Rank.section { padding: 100px 0; }

#Spot2Rank .section-header h2,
.section-header h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  font-weight: 700;
  letter-spacing: -.02em;
}
#Spot2Rank .section-header p { color: var(--muted); max-width: 60ch; margin: 14px auto 0; }

#Spot2Rank h2 { font-size: 1.35rem; }

/* glass panels for address + ranking */
#Spot2Rank form#addressForm,
#Spot2Rank #ranking {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}
#Spot2Rank #ranking.hidden { display: none; }

#Spot2Rank .form-control,
#addressInput {
  background: rgba(8,11,22,.6) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-sm) !important;
  color: var(--paper) !important;
  padding: 14px 16px;
  font-family: var(--body);
  transition: border-color .2s ease, box-shadow .2s ease;
}
#addressInput::placeholder { color: var(--faint); }
#addressInput:focus {
  border-color: rgba(242,165,22,.6) !important;
  box-shadow: 0 0 0 3px rgba(242,165,22,.16) !important;
  outline: none;
}

/* ---- address autocomplete + geolocate ----------------------------------- */
.address-field { position: relative; }
.address-field #addressInput { padding-right: 50px; width: 100%; }

.geolocate-btn {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  cursor: pointer;
  font-size: 16px;
  transition: color .18s ease;
}
.geolocate-btn:hover { color: var(--amber); }
.geolocate-btn.is-loading { color: var(--amber); pointer-events: none; }
.geolocate-btn.is-loading i { animation: s2r-spin .8s linear infinite; }

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

.address-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 50;
  margin: 0;
  padding: 6px;
  list-style: none;
  max-height: 280px;
  overflow-y: auto;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.address-suggestions[hidden] { display: none; }
.address-suggestions li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.35;
  color: var(--paper);
  cursor: pointer;
  transition: background .14s ease, color .14s ease;
}
.address-suggestions li i {
  color: var(--faint);
  font-size: .95em;
  margin-top: 3px;
  flex-shrink: 0;
}
.address-suggestions li:hover,
.address-suggestions li.is-active {
  background: rgba(242,165,22,.10);
  color: var(--paper);
}
.address-suggestions li:hover i,
.address-suggestions li.is-active i { color: var(--amber); }
.address-suggestions .as-empty {
  color: var(--faint);
  cursor: default;
  font-family: var(--mono);
  font-size: 12px;
}
.address-suggestions .as-empty:hover { background: transparent; }

/* middle divider becomes a glowing seam */
#Spot2Rank .col-md-2 > div[style*="background-color:#ccc"],
#Spot2Rank .col-md-2 > div[style] {
  background: linear-gradient(180deg, transparent, var(--amber), transparent) !important;
  width: 1px !important;
  opacity: .55;
}

/* service chips */
#serviceList .list-group-item {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--paper);
  padding: 14px 16px !important;
  margin: 8px 0 !important;
  cursor: grab;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
  max-width: 100%;
}
#serviceList .list-group-item:hover {
  transform: translateX(4px);
  border-color: rgba(242,165,22,.55);
  background: rgba(242,165,22,.08);
  box-shadow: 0 10px 26px -16px rgba(242,165,22,.7);
}
#serviceList .list-group-item i {
  color: var(--amber);
  width: 22px;
  text-align: center;
  font-size: 1.05rem;
}
#serviceList .list-group-item.sortable-chosen,
#serviceList .list-group-item.sortable-ghost {
  border-color: var(--amber);
  box-shadow: var(--glow-amber);
}

.add-more {
  background: transparent;
  border: 1px dashed var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 9px 18px;
  font-family: var(--body);
  font-weight: 500;
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease;
}
.add-more:hover { border-color: var(--amber); color: var(--amber); }

#ranking h3, #ranking h4 { color: var(--muted); }
#ranking h4 { color: var(--faint); }

/* modal (add services) */
#serviceModal .modal-content {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--paper);
}
#serviceModal .modal-header { border-bottom: 1px solid var(--line); }
#serviceModal .modal-footer { border-top: 1px solid var(--line); }
#serviceModal .modal-title { color: var(--paper); }
#serviceModal .close { color: var(--paper); opacity: .8; text-shadow: none; }
#serviceModal #newService {
  background: rgba(8,11,22,.6);
  color: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
}
#serviceModal #newService option { background: var(--ink-2); }

/* map + results */
#mapContainer {
  background: var(--panel) !important;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-top: 40px;
}
#map { border-color: rgba(242,165,22,.5) !important; }
#resultContainer { color: var(--paper); }

/* ==========================================================================
   Feedback widget
   ========================================================================== */
#feedback-form {
  background: var(--panel) !important;
  border: 1px solid rgba(242,165,22,.4) !important;
  box-shadow: var(--shadow) !important;
  color: var(--paper);
  border-radius: var(--radius) !important;
}
#feedback-form p { color: var(--paper); }

/* ==========================================================================
   Advanced teaser - align dark theme to palette
   ========================================================================== */
#advanced-teaser {
  background:
    radial-gradient(700px 400px at 80% 0%, rgba(45,212,167,.10), transparent 60%),
    linear-gradient(135deg, #0b1224 0%, #0a0e1c 100%) !important;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
/* the teaser stays dark in both themes, so keep its text light regardless of
   the global h2 colour (which flips to dark ink in light mode). */
#advanced-teaser h1, #advanced-teaser h2, #advanced-teaser h3 { color: #fff; }

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
  background-image: none !important;
  background: linear-gradient(180deg, #0a0e1c 0%, #070a14 100%);
  border-top: 1px solid var(--line);
  color: var(--paper);
  margin-top: 60px !important;
  padding-top: 70px !important;
}
footer .footer-content { padding: 60px 0 !important; }
footer h2 { color: var(--paper); }
footer p,
footer .footer-content .right-content p { color: var(--muted); }
footer .footer-content .right-content a { color: var(--amber); }
footer .contact-form {
  background: var(--panel) !important;
  border: 1px solid var(--line);
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow) !important;
  padding: 36px !important;
  backdrop-filter: blur(10px);
}
footer .contact-form input,
footer .contact-form textarea {
  background: #0a0f1f !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-sm) !important;
  color: var(--paper) !important;
  padding: 13px 15px;
}
footer .contact-form input::placeholder,
footer .contact-form textarea::placeholder { color: var(--faint); }
footer .contact-form input:focus,
footer .contact-form textarea:focus {
  border-color: rgba(242,165,22,.6) !important;
  box-shadow: 0 0 0 3px rgba(242,165,22,.14) !important;
  outline: none;
}
.sub-footer { border-top: 1px solid var(--line-soft); margin-top: 40px; }
footer .sub-footer p { color: var(--faint); font-family: var(--mono); font-size: 12px; }

/* ==========================================================================
   Daily Loop - "a day from your doorstep" animated walk
   ========================================================================== */
#daily-loop { padding: 90px 0 40px; }

.loop-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 16px;
}
.loop-kicker .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 10px var(--mint);
  animation: s2r-pulse 2.4s ease-in-out infinite;
}

.loop-stage {
  position: relative;
  width: 100%;
  max-width: 540px;
  margin: 26px auto 0;
  aspect-ratio: 600 / 420;
}

.loop-svg { width: 100%; height: 100%; display: block; overflow: visible; }

/* faint spokes home -> each destination */
.loop-spokes line {
  stroke: var(--line);
  stroke-width: 2.5;
  stroke-dasharray: 2 9;
  stroke-linecap: round;
}

/* the orange trail - geometry set per frame by JS, so it tracks the walker exactly */
.loop-comet {
  fill: none;
  stroke: var(--amber);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(242,165,22,.8));
}

/* walker figure */
.walker { color: var(--amber); }
.walker-bob { animation: loop-bob .5s ease-in-out infinite alternate; }
@keyframes loop-bob { from { transform: translateY(0); } to { transform: translateY(-2.5px); } }

.walker-head { fill: var(--amber); }
.walker-body, .arm, .leg {
  stroke: var(--amber);
  stroke-width: 3.4;
  stroke-linecap: round;
  fill: none;
}
.walker-shadow { fill: rgba(0,0,0,.35); }
.leg { transform-box: fill-box; transform-origin: top center; animation: loop-stride .5s ease-in-out infinite alternate; }
.leg-b { animation-delay: -.25s; }
@keyframes loop-stride { from { transform: rotate(15deg); } to { transform: rotate(-15deg); } }

/* stops - badge centered on its SVG point, label floating just below */
.loop-stop {
  position: absolute;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}
.loop-label {
  position: absolute;
  top: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}
.loop-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  border-radius: 14px;
  font-size: 19px;
  color: var(--paper);
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}
.loop-stop[data-stop="home"] .loop-badge { color: var(--mint); border-color: rgba(45,212,167,.5); }
.loop-stop[data-stop="restaurant"] .loop-badge,
.loop-stop[data-stop="cafe"] .loop-badge,
.loop-stop[data-stop="bakery"] .loop-badge { color: var(--amber); }

.loop-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .03em;
  color: var(--muted);
}

/* arrival "ping" - fired once by JS the moment the walker arrives */
.loop-ring {
  position: absolute;
  top: 50%; left: 50%;
  width: 100%; height: 100%;
  border-radius: 14px;
  border: 2px solid var(--amber);
  opacity: 0;
  transform: translate(-50%, -50%) scale(.6);
  pointer-events: none;
}
.loop-stop[data-stop="home"] .loop-ring { border-color: var(--mint); }
.loop-stop.is-ping .loop-ring { animation: loop-ping .9s ease-out; }
@keyframes loop-ping {
  0%   { opacity: .9; transform: translate(-50%, -50%) scale(.6); }
  100% { opacity: 0;  transform: translate(-50%, -50%) scale(2.1); }
}

@media (max-width: 768px) {
  .loop-label { font-size: 9.5px; }
  .loop-badge { width: 40px; height: 40px; font-size: 16px; border-radius: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .walker-bob, .leg { animation: none; }
}

/* ==========================================================================
   Motion
   ========================================================================== */
@keyframes s2r-pulse {
  0%, 100% { opacity: 1;   transform: scale(1);   }
  50%      { opacity: .45; transform: scale(.7);  }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 992px) {
  .hero-grid { grid-template-columns: 1fr; gap: 30px; }
  .hero-copy { max-width: none; text-align: left; }
  .hero-visual { max-width: 360px; margin: 10px auto 0; }
  .welcome-area { padding: 120px 0 50px; min-height: auto; }
}
@media (max-width: 768px) {
  .hero-stats { gap: 22px; }
  .hero-stats .stat-num { font-size: 1.35rem; }
  #Spot2Rank .col-md-2 { display: none !important; }
}

/* collapse the nav into a hamburger dropdown.
   The theme ships a `display:flex !important` on .nav that ignores the mobile
   media query, so the closed/open state is forced here and keyed off the
   hamburger's `.active` class (toggled by the theme's own click handler). */
@media (max-width: 991px) {
  .header-area .main-nav .nav {
    display: none !important;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: 72px; left: 0; right: 0;
    margin: 0;
    padding: 8px;
    background: rgba(10, 14, 28, .97);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
  }
  .header-area .main-nav:has(.menu-trigger.active) .nav { display: flex !important; }
  .header-area .main-nav .nav li { padding: 0; width: 100%; }
  .header-area .main-nav .nav li a { display: block; width: 100%; text-align: center; }
  #languageSelector { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-kicker .dot { animation: none; }
  * { scroll-behavior: auto !important; }
}

/* ==========================================================================
   LIGHT THEME  - activated by html[data-theme="light"]
   Remaps the palette to a "Day Cartograph": pale paper base, ink text,
   the same amber + mint signal accents. Hardcoded dark surfaces from the
   default theme are re-stated below at matching specificity.
   ========================================================================== */
html[data-theme="light"] {
  --ink:        #eef1f7;   /* pale map base                  */
  --ink-2:      #ffffff;   /* raised surface                 */
  --panel:      rgba(255, 255, 255, 0.72);
  --panel-soft: rgba(10, 14, 28, 0.05);
  --line:       rgba(10, 14, 28, 0.12);
  --line-soft:  rgba(10, 14, 28, 0.07);

  --amber:      #e08a00;   /* slightly deepened for contrast */
  --amber-2:    #f2722a;
  --mint:       #14a37f;
  --coral:      #e0413f;

  --paper:      #0e1426;   /* primary text (now dark)        */
  --muted:      #475067;   /* secondary text                 */
  --faint:      #828bb0;   /* tertiary / captions            */

  --glow-amber: 0 0 0 1px rgba(224,138,0,.30), 0 14px 40px -12px rgba(224,138,0,.40);
  --shadow:     0 24px 60px -28px rgba(20, 27, 48, .28);
}

html[data-theme="light"] body {
  background-image:
    radial-gradient(900px 540px at 80% -6%, rgba(242,165,22,.16), transparent 60%),
    radial-gradient(820px 620px at 6% 16%,  rgba(45,212,167,.14), transparent 55%),
    radial-gradient(1200px 820px at 50% 118%, rgba(255,138,60,.10), transparent 60%);
}
html[data-theme="light"] body::before {
  background-image:
    repeating-radial-gradient(circle at 80% 0%,
      transparent 0 38px, rgba(10,14,28,.04) 38px 39px);
}

html[data-theme="light"] ::selection { background: rgba(224,138,0,.22); color: #0e1426; }

html[data-theme="light"] .header-area.background-header,
html[data-theme="light"] .background-header .header-area {
  background: rgba(255, 255, 255, .85) !important;
  box-shadow: 0 10px 30px -22px rgba(20, 27, 48, .4);
}

html[data-theme="light"] .radar-score { background: rgba(255, 255, 255, .7); }

html[data-theme="light"] #Spot2Rank .form-control,
html[data-theme="light"] #addressInput,
html[data-theme="light"] #serviceModal #newService {
  background: rgba(255, 255, 255, .85) !important;
}

/* #advanced-teaser ("Premium feature") keeps the dark default in both themes -
   its text is hardcoded white, so it stays a dark island even in light mode. */

html[data-theme="light"] footer {
  background: linear-gradient(180deg, #e9eef7 0%, #dfe5f0 100%);
}
html[data-theme="light"] footer .contact-form input,
html[data-theme="light"] footer .contact-form textarea {
  background: #ffffff !important;
}

@media (max-width: 991px) {
  html[data-theme="light"] .header-area .main-nav .nav {
    background: rgba(255, 255, 255, .98);
  }
}

/* ---- theme toggle button ------------------------------------------------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-left: 6px;
  padding: 0;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  transition: color .2s ease, border-color .2s ease, background .2s ease, transform .12s ease;
}
.theme-toggle:hover {
  color: var(--amber);
  border-color: rgba(242,165,22,.5);
  background: var(--panel-soft);
  transform: translateY(-1px);
}
/* show the icon that represents the mode you can switch TO */
.theme-toggle .fa-sun-o  { display: none; }
.theme-toggle .fa-moon-o { display: inline-block; }
html[data-theme="light"] .theme-toggle .fa-moon-o { display: none; }
html[data-theme="light"] .theme-toggle .fa-sun-o  { display: inline-block; }

@media (max-width: 991px) {
  .theme-toggle { width: 100%; height: 42px; margin: 4px 0 0; }
}

/* ==========================================================================
   Score hierarchy - one hero score, objective detail behind a reveal
   ========================================================================== */
.score-hero {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin: 18px 0 14px;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}
.score-hero-num {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--display);
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  font-weight: 700;
  line-height: 1.05;
  margin: 0 0 6px;
  color: var(--paper);
}
.score-hero-label { color: var(--muted); font-size: .9rem; font-weight: 600; letter-spacing: .02em; align-self: center; }
#spotScoreVal {
  background: linear-gradient(120deg, var(--amber), var(--amber-2) 60%, var(--mint));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.score-hero-para { color: var(--paper); font-size: 1.02rem; margin: 8px 0 4px; }
.score-hero-insights { color: var(--muted); font-size: .95rem; margin: 0; }

/* the (i) affordance + tooltip */
.score-info {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  margin-left: 2px;
  color: var(--faint);
  font-size: 13px;
  cursor: help;
  align-self: center;
  transition: color .15s ease;
}
.score-info:hover, .score-info:focus-visible { color: var(--amber); outline: none; }
.score-tip {
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: max-content;
  max-width: 250px;
  padding: 9px 12px;
  font-family: var(--body);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0;
  text-transform: none;
  color: var(--paper);
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
  z-index: 40;
  white-space: normal;
}
.score-tip::after {  /* little pointer */
  content: "";
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--ink-2);
}
.score-info:hover .score-tip,
.score-info:focus-visible .score-tip,
.score-info:focus .score-tip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* reveal toggle for the objective breakdown */
.breakdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 4px 0 18px;
  padding: 10px 20px;
  font-family: var(--body);
  font-weight: 600;
  font-size: 14px;
  color: var(--paper);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, color .2s ease;
}
.breakdown-toggle:hover { border-color: rgba(242,165,22,.6); background: var(--panel-soft); }
.breakdown-toggle i { transition: transform .25s ease; color: var(--amber); }
.breakdown-toggle.is-open i { transform: rotate(180deg); }

.breakdown-wrap[hidden] { display: none; }
.breakdown-wrap { animation: fadeIn .35s ease; }

/* ==========================================================================
   Neighborhood SEO pages (city selector, /villes, /villes/<city>[/<hood>])
   ========================================================================== */

.cities-section { padding: 60px 0; }

.city-map {
  height: 420px;
  margin-top: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  overflow: hidden;
}
.city-map .leaflet-popup-content-wrapper {
  background: var(--ink-2);
  color: var(--paper);
  border-radius: 10px;
}
.city-map .leaflet-popup-tip { background: var(--ink-2); }
.city-map .n-map-popup-name { font-weight: 700; margin: 0 0 4px; }
.city-map .n-map-popup-score { font-family: var(--mono); color: var(--mint); }
.city-map .n-map-popup-link { display: block; margin-top: 6px; font-size: 12px; }

.city-grid, .neighborhood-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 32px;
}

.city-card, .neighborhood-card {
  display: block;
  padding: 22px 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: border-color .2s ease, transform .2s ease, background .2s ease;
}
.city-card:hover, .neighborhood-card:hover {
  border-color: rgba(242,165,22,.55);
  background: var(--panel-soft);
  transform: translateY(-2px);
}

.city-card-name, .neighborhood-card-name {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 700;
  color: var(--paper);
  margin: 0 0 6px;
}

.city-card-sub, .neighborhood-card-sub {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.neighborhood-card-score {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 12px;
  font-family: var(--mono);
}
.neighborhood-card-score .n-score-num { font-size: 26px; font-weight: 700; color: var(--mint); }
.neighborhood-card-score .n-score-max { font-size: 12px; color: var(--faint); }

.breadcrumbs {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
}
.breadcrumbs a { color: var(--muted); text-decoration: underline; }
.breadcrumbs a:hover { color: var(--amber); }

.n-hero-score {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 26px 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 22px 0 30px;
}
.n-hero-ring {
  flex: 0 0 auto;
  width: 96px; height: 96px;
  border-radius: 50%;
  background: conic-gradient(var(--ring, var(--mint)) calc(var(--pct, 0) * 1%), var(--line-soft) 0);
  display: flex; align-items: center; justify-content: center;
}
.n-hero-ring-inner {
  width: 76px; height: 76px;
  background: var(--ink-2);
  border-radius: 50%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  line-height: 1;
}
.n-hero-ring-num { font-size: 28px; font-weight: 800; color: var(--paper); font-family: var(--mono); }
.n-hero-ring-cap { font-size: 10px; color: var(--faint); margin-top: 2px; }
.n-hero-headline { font-size: 15px; color: var(--muted); margin: 0; }
.n-hero-headline strong { color: var(--paper); }

.n-dimension-bars {
  margin: 20px 0;
  padding: 20px 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.n-dim-row { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.n-dim-icon { width: 22px; text-align: center; color: var(--amber); font-size: 13px; flex-shrink: 0; }
.n-dim-label { width: 165px; font-size: 13px; color: var(--muted); flex-shrink: 0; }
.n-dim-track { flex: 1; height: 9px; background: var(--line-soft); border-radius: 5px; overflow: hidden; }
.n-dim-fill { height: 100%; border-radius: 5px; }
.n-dim-score { width: 32px; text-align: right; font-size: 13px; font-weight: 600; color: var(--paper); font-family: var(--mono); }

.n-essentials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
  margin: 20px 0;
}
.n-essential-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.n-essential-item.is-far { opacity: .6; }
.n-essential-icon { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 13px; flex: 0 0 auto; }
.n-essential-item:not(.is-far) .n-essential-icon { background: rgba(45,212,167,.14); color: var(--mint); }
.n-essential-item.is-far .n-essential-icon { background: var(--panel-soft); color: var(--faint); }
.n-essential-text { display: flex; flex-direction: column; line-height: 1.2; }
.n-essential-label { font-size: 13px; font-weight: 600; color: var(--paper); }
.n-essential-sub { font-size: 11px; color: var(--faint); }

.n-siblings { margin-top: 34px; }
.n-siblings-more { margin-top: 14px; text-align: center; }
.n-siblings-more a { color: var(--mint); font-size: 13px; font-weight: 600; text-decoration: underline; }

.n-cta {
  margin-top: 34px;
  padding: 24px 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--panel-soft);
  text-align: center;
}
.n-cta a.main-button { display: inline-block; margin-top: 10px; }
