/* =====================================================================
   Host My Bike — design tokens
   Palette drawn from cycling infrastructure: route-map paper, forest
   green wayfinding signs, amber reflector accent, asphalt ink.
   ===================================================================== */
:root {
  --paper:      #EEF1EC;
  --paper-raised: #FFFFFF;
  --ink:        #16241F;
  --ink-soft:   #4A5A54;
  --forest:     #643d76;
  --forest-dark:#4e2f5c;
  --amber:      #E8A33D;
  --amber-dark: #C77F1E;
  --line:       #D8DED9;
  --danger:     #C1432B;
  --header-bg:  #643d76;
  --header-height: 130px;
  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  22px;
  --shadow:     0 4px 18px rgba(22, 36, 31, 0.08);
  --font-display: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --font-body:    'Inter', 'Segoe UI', system-ui, sans-serif;
  --max-width: 1140px;
}

@font-face {
  font-family: 'Space Grotesk';
  src: local('Space Grotesk');
  font-display: swap;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
a { color: var(--forest); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--forest); color: #fff;
  padding: 10px 16px; z-index: 200; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

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

/* ---------- signature: dashed "route line" divider ---------- */
.route-divider {
  height: 14px;
  margin: 2.5rem 0;
  background-image: radial-gradient(circle, var(--forest) 2.5px, transparent 2.6px);
  background-size: 22px 14px;
  background-repeat: repeat-x;
  background-position: left center;
  opacity: .55;
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg);
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.header-inner {
  max-width: var(--max-width); margin: 0 auto; padding: 0 1rem;
  display: flex; align-items: center; justify-content: space-between; height: var(--header-height);
}
.brand {
  display: flex; align-items: center; gap: .5rem;
}
.brand-logo { height: calc(var(--header-height) - 40px); max-height: 90px; width: auto; display: block; }
.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  background: none; border: none; width: 40px; height: 40px; cursor: pointer;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: #fff; margin: 0 auto; }

.primary-nav { display: flex; align-items: center; gap: 1.25rem; }
.primary-nav a { color: #fff; font-weight: 500; font-size: .95rem; white-space: nowrap; }
.primary-nav a:hover { color: var(--amber); text-decoration: none; }
.nav-cta {
  background: var(--amber); color: var(--forest-dark) !important; padding: .5rem 1rem; border-radius: 999px;
}
.nav-cta:hover { background: var(--amber-dark); color: var(--forest-dark) !important; }
.nav-inbox { position: relative; }
.badge {
  background: var(--amber); color: var(--forest-dark); border-radius: 999px; font-size: .7rem;
  padding: 1px 6px; margin-left: 4px; font-weight: 700;
}
.nav-profile { display: flex; align-items: center; gap: .4rem; color: #fff; }
.avatar-sm { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.avatar-md { width: 38px; height: 38px; flex-shrink: 0; }
.avatar-placeholder { display: inline-block; background: var(--line); }

.nav-bubble {
  display: flex; align-items: center; gap: 1rem; background: #bd837f;
  border-radius: 999px; padding: .5rem 1.2rem;
}
.nav-bubble a { color: #fff; }
.nav-bubble a:hover { color: var(--ink); }

.nav-login-btn {
  background: #bd837f; color: #fff !important; padding: .5rem 1.1rem; border-radius: 999px;
}
.nav-login-btn:hover { background: #a86e6a; color: #fff !important; }
.lang-switch select {
  border: 1px solid rgba(255,255,255,.4); border-radius: 6px; padding: .3rem .4rem; background: transparent;
  font-size: .8rem; color: #fff;
}
.lang-switch select option { color: var(--ink); }

/* ---------- layout helpers ---------- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1rem; }
.section { padding: 3rem 1rem; }
.card {
  background: var(--paper-raised); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 1.5rem;
}
.grid { display: grid; gap: 1.5rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 800px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  /* Host profile page: keep the message box visually first on desktop
     (left column), but push it below the info/spots on mobile. */
  .host-profile-layout > :first-child { order: 2; }
  .host-profile-layout > :last-child { order: 1; }
}

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  background: #3e1e18; color: #fff; border: none; padding: .75rem 1.4rem;
  border-radius: 999px; font-weight: 600; font-size: .95rem; cursor: pointer; transition: background .15s;
}
.btn:hover { background: #2e1612; text-decoration: none; }
.btn-secondary { background: transparent; color: #3e1e18; border: 2px solid #3e1e18; }
.btn-secondary:hover { background: #3e1e18; color: #fff; }
.btn-amber { background: var(--amber); color: var(--forest-dark); }
.btn-amber:hover { background: var(--amber-dark); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: .45rem .9rem; font-size: .85rem; }

.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .35rem; }
.field .hint { font-size: .8rem; color: var(--ink-soft); margin-top: .3rem; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=search], input[type=file], textarea, select {
  width: 100%; padding: .65rem .8rem; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  font-size: 1rem; font-family: inherit; background: #fff; color: var(--ink);
}
textarea { resize: vertical; min-height: 100px; }
input:focus, textarea:focus, select:focus { border-color: var(--forest); }
.radio-group { display: flex; gap: 1rem; }
.radio-group-stacked { flex-direction: column; gap: .5rem; }
.radio-group label { display: flex; align-items: center; gap: .4rem; font-weight: 500; }
.consent-check { display: flex; align-items: flex-start; gap: .55rem; font-weight: 400 !important; font-size: .9rem; cursor: pointer; }
.consent-check input { margin-top: .2rem; width: auto; flex-shrink: 0; }
.consent-check a { text-decoration: underline; }
.consent-check-highlight {
  background: #FFF8EC; border: 1.5px solid var(--amber); border-radius: var(--radius-sm);
  padding: .8rem .9rem;
}
.consent-check-highlight .consent-check input { width: 18px; height: 18px; }
.form-narrow { max-width: 460px; margin: 0 auto; }
.alert {
  padding: .9rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: 1.2rem; font-size: .92rem;
}
.alert-success { background: #E4F3EA; color: #1F5C4E; border: 1px solid #BEE0CC; }
.alert-error { background: #FBE7E2; color: #7A2416; border: 1px solid #F0BCAE; }
.alert-info { background: #EAF1FB; color: #1C3D66; border: 1px solid #C7D9F2; }

/* ---------- legal pages (privacy / cookies / terms) ---------- */
.legal-page h3 { margin-top: 1.8rem; }
.legal-page h3:first-of-type { margin-top: .4rem; }

/* ---------- about page zigzag layout ---------- */
.zigzag { display: flex; flex-direction: column; gap: 3rem; margin-top: .5rem; }
.zigzag-row { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 2.5rem; }
.zigzag-row.reverse .zigzag-image { order: 2; }
.zigzag-row.reverse .zigzag-text { order: 1; }
.zigzag-image img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-md); }
.zigzag-text p { color: var(--ink-soft); line-height: 1.6; margin: 0; }
@media (max-width: 700px) {
  .zigzag-row { grid-template-columns: 1fr; gap: 1.2rem; }
  .zigzag-row.reverse .zigzag-image, .zigzag-row.reverse .zigzag-text { order: initial; }
}
.legal-page p, .legal-page li { color: var(--ink-soft); line-height: 1.55; }
.legal-page ul { padding-left: 1.3rem; margin: .6rem 0 1rem; }
.legal-page li { margin-bottom: .4rem; }
.legal-page code { background: var(--paper); padding: .1rem .35rem; border-radius: 4px; font-size: .85em; }
.legal-table { width: 100%; border-collapse: collapse; margin: .8rem 0 1.4rem; font-size: .88rem; }
.legal-table th, .legal-table td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.legal-table th { color: var(--ink); font-weight: 700; background: var(--paper); }
.legal-table td { color: var(--ink-soft); }
@media (max-width: 640px) {
  .legal-table, .legal-table thead, .legal-table tbody, .legal-table th, .legal-table td, .legal-table tr { display: block; }
  .legal-table tr { border-bottom: 2px solid var(--line); padding-bottom: .5rem; margin-bottom: .5rem; }
  .legal-table th:first-child { display: none; }
  .legal-table td { border-bottom: none; padding: .25rem .1rem; }
  .legal-table td::before { content: attr(data-label); display: block; font-weight: 700; color: var(--ink); font-size: .78rem; }
}

/* ---------- hero / home ---------- */
.hero {
  padding: 5rem 1rem;
  background-color: #000;
  background-image: linear-gradient(rgba(0,0,0,.3), rgba(0,0,0,.3)), url('/assets/img/hero-background-photo.jpg');
  background-repeat: no-repeat, no-repeat;
  background-position: center, center;
  background-size: cover, cover;
}
.hero-inner { text-align: left; }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 2.5rem; }
.hero-content { max-width: 720px; margin: 0; }
.hero-image img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-md); }
.hero h1 { font-size: clamp(2.1rem, 5.2vw, 3.4rem); color: #fff; margin: 0 0 .6em; }
.hero p { margin: 0 0 1.6em; color: rgba(255,255,255,.9); font-size: 1.2rem; }
.hero-read-more { margin: -1rem 0 1.6em; }
.hero-read-more a { color: #fff; text-decoration: underline; font-weight: 600; font-size: .95rem; }
.hero-read-more a:hover { color: var(--amber); }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: flex-start; }
.hero-actions .btn { background: #c08bbd; color: #fff; }
.hero-actions .btn:hover { background: #a86fa4; }
.hero-actions .btn-secondary { background: transparent; color: #c08bbd; border: 2px solid #c08bbd; }
.hero-actions .btn-secondary:hover { background: #c08bbd; color: #fff; }
@media (max-width: 700px) {
  .hero-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* ---------- image placeholders (swap for real <img> tags once assets arrive) ---------- */
.image-placeholder {
  display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(45deg, var(--paper-raised), var(--paper-raised) 10px, var(--paper) 10px, var(--paper) 20px);
  border: 2px dashed var(--line); border-radius: var(--radius-md);
  color: var(--ink-soft); font-size: .9rem; font-weight: 600; letter-spacing: .02em;
  aspect-ratio: 16 / 10; width: 100%;
}
.image-placeholder-wide { aspect-ratio: 21 / 9; margin: 1.6rem 0 2.2rem; }

.how-it-works-title { text-align: center; font-size: clamp(1.7rem, 3.5vw, 2.4rem); padding-top: 2.5rem; }

/* full-width banner below the "how it works" steps, now holding the FAQ block */
.bottom-banner {
  width: 100%; background: #bd837f;
}

/* ---------- FAQ / "everything you need to know" ---------- */
.faq-block { display: flex; gap: 3rem; align-items: flex-start; flex-wrap: wrap; }
.faq-intro { flex: 1 1 280px; }
.faq-intro h2 { margin-bottom: .6em; color: #fff; }
.faq-intro p { color: rgba(255,255,255,.9); }
.faq-list { flex: 1.4 1 380px; display: flex; flex-direction: column; gap: .7rem; }
.faq-item {
  background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: .2rem 1.1rem;
}
.faq-item summary {
  cursor: pointer; list-style: none; padding: 1rem 1.6rem 1rem 0; font-weight: 600; color: var(--ink);
  position: relative;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+'; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  font-size: 1.3rem; font-weight: 400; color: var(--forest); line-height: 1;
}
.faq-item[open] summary::after { content: '–'; }
.faq-item p { margin: 0 0 1rem; color: var(--ink-soft); font-size: .95rem; }

.steps { counter-reset: step; }
.step { position: relative; text-align: center; }

/* ---------- map page ---------- */
.map-page { display: flex; flex-direction: column; height: calc(100vh - var(--header-height)); }
.map-toolbar {
  display: flex; gap: .6rem; padding: .75rem 1rem; background: var(--paper-raised); border-bottom: 1px solid var(--line);
  flex-wrap: wrap; align-items: center;
}
.map-toolbar form { display: flex; gap: .5rem; flex: 1; min-width: 220px; }
#map { flex: 1; width: 100%; }
.maplibregl-popup-content {
  border-radius: var(--radius-md) !important; padding: 0 !important; overflow: hidden;
  font-family: var(--font-body);
}
.spot-popup { width: 230px; }
.spot-popup img { width: 100%; height: 110px; object-fit: cover; display: block; }
.spot-popup-photo-placeholder { width: 100%; height: 110px; background: var(--paper); }
.spot-popup-body { padding: .8rem; }
.spot-popup-body h4 { font-size: 1rem; margin-bottom: .25rem; }
.spot-popup-facts { list-style: none; margin: 0 0 .5rem; padding: 0; display: flex; flex-direction: column; gap: .15rem; }
.spot-popup-facts li { font-size: .82rem; color: var(--ink-soft); padding-left: 1rem; position: relative; }
.spot-popup-facts li::before { content: '•'; color: var(--forest); position: absolute; left: 0; }
.spot-popup-body p { font-size: .82rem; margin-bottom: .6rem; }
@media (max-width: 480px) {
  .spot-popup { width: 190px; max-height: 70vh; overflow-y: auto; }
  .spot-popup img, .spot-popup-photo-placeholder { height: 90px; }
  .spot-popup-body { padding: .6rem; }
}

/* ---------- profile ---------- */
.profile-photo-current { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; margin-bottom: .6rem; }
.host-profile-layout { align-items: start; gap: 1.5rem; }
.spot-list-item {
  display: flex; justify-content: space-between; align-items: center; padding: .9rem 0; border-bottom: 1px solid var(--line);
}
.spot-edit-form {
  display: none; padding: 1rem 0 1.2rem; border-bottom: 1px solid var(--line);
}
.spot-edit-form.open { display: block; }
.membership-box {
  border: 2px dashed var(--amber); border-radius: var(--radius-md); padding: 1.2rem; background: #FFF8EC;
}
.danger-zone {
  margin-top: 1.2rem; padding-top: 1.1rem; border-top: 1px dashed var(--line);
}
.danger-zone h4 { color: var(--danger); margin-bottom: .3rem; font-size: .95rem; }

/* ---------- inbox ---------- */
.inbox-layout { display: grid; grid-template-columns: 320px 1fr; height: calc(100vh - var(--header-height)); }
.conversation-list { border-right: 1px solid var(--line); overflow-y: auto; background: var(--paper-raised); min-height: 0; }
.conversation-item {
  display: block; padding: .9rem 1rem; border-bottom: 1px solid var(--line); color: var(--ink);
}
.conversation-item-row { display: flex; align-items: center; gap: .7rem; }
.conversation-item-main { flex: 1; min-width: 0; }
.conversation-item-name { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.conversation-item-city { font-weight: 400; color: var(--ink-soft); font-size: .85rem; }
.conversation-item:hover { background: var(--paper); text-decoration: none; }
.conversation-item.unread { font-weight: 700; background: #F6F1F8; }
.conversation-item.unread .conversation-item-city { color: var(--ink-soft); font-weight: 400; }
.conversation-item .snippet { font-weight: 400; color: var(--ink-soft); font-size: .85rem; }
.thread { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.thread-header { padding: 1rem; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.thread-header-user { display: flex; align-items: center; gap: .6rem; color: var(--ink); }
.thread-header-user:hover { text-decoration: none; color: var(--forest); }
.thread-messages { flex: 1; min-height: 0; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .6rem; }
.msg { max-width: 70%; padding: .6rem .9rem; border-radius: var(--radius-md); background: #fff; box-shadow: var(--shadow); overflow-wrap: break-word; word-break: break-word; }
.msg.mine { align-self: flex-end; background: var(--forest); color: #fff; }
.thread-composer { display: flex; gap: .5rem; padding: 1rem; border-top: 1px solid var(--line); }
.thread-composer-email {
  flex-direction: column; align-items: stretch; gap: .7rem;
}
.thread-composer-email textarea {
  resize: vertical; min-height: 120px; font-family: inherit; font-size: .95rem;
  padding: .8rem .9rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  line-height: 1.5;
}
.thread-composer-email .btn { align-self: flex-end; padding: .6rem 1.6rem; }
@media (max-width: 800px) {
  .inbox-layout { grid-template-columns: 1fr; }
  .conversation-list.has-active { display: none; }
}

/* ---------- footer ---------- */
.site-footer { background: #077f55; color: #E3D9E8; }
.footer-inner {
  max-width: var(--max-width); margin: 0 auto; padding: 0 1rem 2.2rem; display: flex; flex-wrap: wrap;
  gap: 1.2rem; align-items: center; justify-content: space-between;
}
.footer-brand { font-family: var(--font-display); font-weight: 700; display: flex; align-items: center; }
.footer-logo { height: 40px; width: auto; display: block; }
.footer-links { display: flex; gap: 1.2rem; }
.footer-links a, .footer-social a { color: #E3D9E8; }
.footer-social { display: flex; gap: .8rem; }
.footer-copy { width: 100%; font-size: .8rem; opacity: .75; text-align: center; }

/* ---------- cookie notice ---------- */
.cookie-notice {
  position: fixed; left: 1rem; right: 1rem; bottom: -200px; z-index: 200;
  max-width: 640px; margin: 0 auto;
  background: var(--ink); color: #fff; border-radius: var(--radius-md);
  padding: 1rem 1.2rem; box-shadow: 0 8px 24px rgba(0,0,0,.25);
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  transition: bottom .3s ease;
}
.cookie-notice.visible { bottom: 1rem; }
.cookie-notice p { margin: 0; font-size: .85rem; flex: 1 1 320px; color: #EAE3ED; }
.cookie-notice a { color: #fff; text-decoration: underline; }
.cookie-notice .btn { flex-shrink: 0; }

/* ---------- mobile nav ---------- */
@media (max-width: 880px) {
  :root { --header-height: 76px; }
  .brand-logo { height: 48px; max-height: 48px; }
  .nav-toggle { display: flex; }
  .primary-nav {
    position: absolute; top: var(--header-height); left: 0; right: 0; background: var(--header-bg);
    flex-direction: column; align-items: stretch; gap: 0; border-bottom: 1px solid rgba(255,255,255,.15);
    max-height: 0; overflow: hidden; transition: max-height .2s ease;
  }
  .primary-nav.open { max-height: 480px; }
  .primary-nav a, .primary-nav form { padding: .9rem 1rem; border-top: 1px solid rgba(255,255,255,.15); }
  .nav-cta { border-radius: 0; text-align: center; }
  .nav-bubble {
    flex-direction: column; align-items: stretch; gap: 0;
    background: #bd837f; border-radius: 0;
  }
  .nav-bubble a { color: #fff; }
  .nav-login-btn { border-radius: 0; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
