/* TrailSync */
:root {
  --navy: #14202b;
  --navy-2: #1c2b38;
  --navy-3: #26394a;
  /* accent = groen verloop uit het TrailSync-logo */
  --green: #16a34a;
  --green-2: #12873d;
  --green-soft: #e7f7ea;
  --grad: linear-gradient(60deg, #16a34a 0%, #a3f03c 100%);
  --grad-btn: linear-gradient(60deg, #16a34a 0%, #5cc93a 100%);
  --bg: #f2f4f6;
  --card: #ffffff;
  --text: #16212b;
  --muted: #687684;
  --line: #e3e8ec;
  --danger: #c4372f;
  --blue: #1f6feb;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 32, 43, .05), 0 6px 20px rgba(20, 32, 43, .07);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--green-2); }
button, input { font: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ------------------------------------------------------------ layout */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--navy); color: #c9d4de; display: flex; flex-direction: column; padding: 22px 16px; position: sticky; top: 0; height: 100vh; }
.logo { display: block; padding: 0 6px 22px; }
.logo { padding: 8px 4px 26px; }
.logo img { width: 100%; max-width: 220px; height: auto; display: block; margin: 0 auto; }
.mhead { display: none; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 999px; color: #c9d4de; text-decoration: none; font-weight: 550; }
.nav a svg { width: 20px; height: 20px; flex: none; opacity: .85; }
.nav a:hover { background: var(--navy-2); color: #fff; }
.nav a.on { background: var(--grad); color: #fff; text-shadow: 0 1px 2px rgba(0, 60, 20, .35); }
.nav a.on svg { opacity: 1; }
.nav .logout { margin-top: 8px; color: #8fa0b0; font-weight: 450; }
.premium { margin-top: auto; background: linear-gradient(160deg, var(--navy-3), var(--navy-2)); border: 1px solid #2f4456; border-radius: var(--radius); padding: 16px; position: relative; overflow: hidden; }
.premium svg.peaks { position: absolute; right: -10px; bottom: -6px; width: 120px; opacity: .25; }
.premium h4 { margin: 0 0 4px; color: #fff; font-size: 15px; }
.premium p { margin: 0 0 12px; font-size: 13px; color: #9fb0bf; position: relative; }
.premium .btn { width: 100%; position: relative; padding: 9px; }
.premium small { display: block; text-align: center; margin-top: 6px; font-size: 11px; color: #7f92a3; position: relative; }

.main { min-width: 0; padding: 20px 24px 40px; }
.wrap { max-width: 1280px; margin: 0 auto; }

/* ------------------------------------------------------------ hero */
.hero { position: relative; border-radius: 18px; overflow: hidden; min-height: 200px; color: #fff; padding: 30px 34px; display: flex; flex-direction: column; justify-content: center;
  background: linear-gradient(180deg, #2a2f5a 0%, #6b3f6e 38%, #d9725a 70%, #f4b26b 100%); box-shadow: var(--shadow); }
/* met foto (assets/hero.jpg): donker verloop links houdt de tekst leesbaar */
.hero.photo { background: linear-gradient(90deg, rgba(8, 14, 22, .72) 0%, rgba(8, 14, 22, .42) 45%, rgba(8, 14, 22, 0) 72%), url(hero.jpg) center 42% / cover no-repeat, #2a2f5a; }
.hero.photo svg.mountains, .hero.photo .sun { display: none; }
.hero.photo { min-height: 240px; }
.hero svg.mountains { position: absolute; inset: auto 0 0 0; width: 100%; height: 72%; }
.hero .sun { position: absolute; right: 22%; bottom: 30%; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, #ffe3a3 0%, #ffc574 45%, rgba(255, 180, 100, 0) 70%); }
.hero h1 { position: relative; margin: 0; font-size: clamp(22px, 3vw, 34px); line-height: 1.15; font-weight: 750; letter-spacing: -.02em; max-width: 620px; text-shadow: 0 2px 14px rgba(0, 0, 0, .25); }
.hero p { position: relative; margin: 10px 0 0; font-size: 16px; color: #ffe9d6; font-weight: 500; }
.hero .cta { position: relative; margin-top: 18px; align-self: flex-start; }
.user { position: absolute; top: 16px; right: 18px; display: flex; align-items: center; gap: 10px; background: rgba(10, 18, 26, .35); backdrop-filter: blur(6px); padding: 5px 12px 5px 5px; border-radius: 999px; font-weight: 600; font-size: 14px; z-index: 2; color: #fff; text-decoration: none; }
.user i { width: 32px; height: 32px; border-radius: 50%; background: var(--grad); text-shadow: 0 1px 2px rgba(0, 60, 20, .4); display: grid; place-items: center; font-style: normal; font-weight: 700; }

/* ------------------------------------------------------------ cards & controls */
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; margin-top: 20px; align-items: start; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 20px; }
.card h2 { margin: 0 0 14px; font-size: 17px; font-weight: 700; }
.card h3 { margin: 18px 0 8px; font-size: 15px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px; padding: 10px 18px; font-weight: 650; cursor: pointer; text-decoration: none; background: var(--grad-btn); color: #fff; white-space: nowrap; text-shadow: 0 1px 1px rgba(0, 60, 20, .3); }
.btn:hover { background: var(--green-2); }
.btn svg { width: 18px; height: 18px; }
.btn.ghost { background: #fff; color: var(--text); border: 1px solid var(--line); text-shadow: none; }
.btn.ghost:hover { background: #f6f8f9; }
.btn.danger { background: #fff; color: var(--danger); border: 1px solid #f0d2cf; text-shadow: none; }
.btn.danger:hover { background: #fdf3f2; }
.btn.done { background: var(--green-soft); color: var(--green-2); text-shadow: none; }
.link { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; }
.link.danger { color: var(--danger); }
input[type=text], input[type=password] { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); }
input:focus { outline: 2px solid rgba(47, 174, 79, .35); border-color: var(--green); }
label { display: block; margin: 12px 0; font-weight: 550; font-size: 14px; }
label input { margin-top: 6px; font-weight: 400; }
.flash { padding: 10px 14px; border-radius: 10px; margin-top: 16px; font-weight: 550; }
.flash.ok { background: var(--green-soft); color: var(--green-2); }
.flash.err { background: #fdecea; color: var(--danger); }

/* ------------------------------------------------------------ route list */
.chips { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; margin: 20px 0 -4px; scrollbar-width: thin; }
.chip { flex: none; display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px 8px 8px; text-decoration: none; color: var(--text); max-width: 260px; }
.chip .thumb { width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--line); background: #f4f8f2; flex: none; display: block; }
.chip b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.chip span { font-size: 12px; color: var(--muted); }
.chip.on { border-color: var(--green); box-shadow: 0 0 0 2px rgba(47, 174, 79, .2); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; margin-left: 4px; }

/* ------------------------------------------------------------ route card */
.rhead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ficon { width: 46px; height: 46px; border-radius: 12px; background: var(--green-soft); color: var(--green-2); display: grid; place-items: center; flex: none; }
.ficon svg { width: 24px; height: 24px; }
.rtitle { flex: 1; min-width: 200px; }
.rtitle form { display: flex; align-items: center; gap: 6px; }
.rtitle input { border-color: transparent; font-size: 19px; font-weight: 700; padding: 4px 6px; margin-left: -6px; background: transparent; }
.rtitle input:hover { border-color: var(--line); }
.rtitle .pen { color: var(--muted); display: inline-flex; cursor: pointer; }
.rtitle .pen svg { width: 16px; height: 16px; }
.meta { color: var(--muted); font-size: 14px; margin-top: 2px; }
.ractions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 18px 0 16px; }
.tabs button { background: none; border: 0; padding: 10px 14px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--text); border-bottom-color: var(--green); }
.pane { display: none; }
.pane.on { display: block; }
#map { height: 420px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); z-index: 0; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.stat { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat span { display: block; font-size: 12px; color: var(--muted); font-weight: 550; text-transform: uppercase; letter-spacing: .03em; }
.stat b { display: block; font-size: 22px; font-weight: 750; letter-spacing: -.01em; margin-top: 2px; }
.stat small { color: var(--muted); }
.diff { display: flex; gap: 4px; margin-top: 8px; }
.diff i { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.diff i.on { background: var(--grad); }
.diff.l4 i.on, .diff.l5 i.on { background: #e8833a; }
.elev { width: 100%; height: 240px; display: block; }
.elev-stats { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 10px; font-size: 14px; }
.wps { list-style: none; margin: 0; padding: 0; }
.wps li { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.wps li:last-child { border: 0; }
.wps .ic { width: 34px; height: 34px; border-radius: 50%; background: #eef2f5; display: grid; place-items: center; flex: none; }
.wps .ic svg { width: 18px; height: 18px; }
.wps .d { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 8px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 550; }

/* map markers */
.m-start { width: 16px; height: 16px; border-radius: 50%; background: var(--green); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
.m-finish { width: 20px; height: 20px; border-radius: 4px; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
  background: conic-gradient(#000 25%, #fff 0 50%, #000 0 75%, #fff 0) 0 0 / 8px 8px; }
.m-turn { width: 20px; height: 20px; display: grid; place-items: center; }
.m-turn svg { width: 20px; height: 20px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .5)); }

/* ------------------------------------------------------------ watch preview */
.watch { position: relative; width: 260px; max-width: 100%; aspect-ratio: 1; margin: 6px auto 0; }
.watch .bezel { position: absolute; inset: -14px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #4a5561, #1a2027 60%, #0d1115); box-shadow: 0 10px 24px rgba(0, 0, 0, .35), inset 0 0 0 2px #2c353f; }
.watch .btn-l, .watch .btn-r { position: absolute; width: 8px; height: 30px; background: #2a323b; border-radius: 3px; }
.watch canvas { position: relative; width: 100%; height: 100%; border-radius: 50%; display: block; background: #000; }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 26px; }
.thumbs button { background: none; border: 0; padding: 0; cursor: pointer; text-align: center; color: var(--muted); font-size: 12px; font-weight: 550; }
.thumbs canvas { width: 100%; aspect-ratio: 1; border-radius: 50%; display: block; margin-bottom: 4px; box-shadow: 0 0 0 3px #1a2027; background: #000; }
.thumbs button.on canvas { box-shadow: 0 0 0 3px var(--green); }
.thumbs button.on { color: var(--text); }
.ready { display: flex; gap: 14px; align-items: flex-start; }
.ready .check { width: 42px; height: 42px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; flex: none; }
.ready .check svg { width: 22px; height: 22px; }
.ready h2 { margin: 2px 0 4px; }
.ready p { margin: 0 0 6px; font-size: 14px; color: var(--muted); }

/* ------------------------------------------------------------ upload, devices */
.drop { border: 2px dashed #c9d3db; border-radius: var(--radius); padding: 40px 20px; text-align: center; background: #fafbfc; transition: .15s; }
.drop.over { border-color: var(--green); background: var(--green-soft); }
.drop svg { width: 46px; height: 46px; color: var(--green); }
.drop h3 { margin: 10px 0 4px; font-size: 18px; }
.drop .files { margin-top: 12px; font-size: 14px; color: var(--muted); }
.jobs { margin-top: 16px; }
.job { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.job .status.ok { color: var(--green-2); font-weight: 600; }
.job .status.err { color: var(--danger); }
.dev { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.dev:first-of-type { border-top: 0; }
.dev .wicon { width: 40px; height: 40px; border-radius: 50%; background: #eef2f5; display: grid; place-items: center; flex: none; }
.dev .wicon svg { width: 22px; height: 22px; }
.dev .who { display: flex; gap: 12px; align-items: center; flex: 1; min-width: 200px; }
.dev input[type=text] { flex: 1 1 200px; width: auto; }
.code { font-family: ui-monospace, Consolas, monospace; font-weight: 700; letter-spacing: .06em; }
.steps { margin: 0; padding-left: 20px; }
.steps li { margin: 6px 0; }
.mono { font-family: ui-monospace, Consolas, monospace; background: #f3f5f7; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; word-break: break-all; }
.narrow { max-width: 420px; margin: 8vh auto; padding: 0 16px; }
.narrow .brandbox { background: var(--navy); border-radius: var(--radius); padding: 22px 30px 16px; margin-bottom: 16px; box-shadow: var(--shadow); }
.narrow .brandbox { padding: 26px 28px; }
.narrow .brandbox img { width: 100%; max-width: 300px; height: auto; display: block; margin: 0 auto; }
.foot { margin-top: 28px; font-size: 12px; color: var(--muted); text-align: center; }
.foot a { color: inherit; }

/* ------------------------------------------------------------ voortgang (route omkeren) */
.work .job.working { display: flex; gap: 18px; align-items: center; justify-content: flex-start; flex-wrap: nowrap; border: 0; padding: 6px 0 14px; }
.work { max-width: 640px; }
.work .job.working h2 { margin: 0 0 2px; }
.work .job.working p { margin: 2px 0; }
.work .status { font-weight: 600; }
.spinner { width: 42px; height: 42px; flex: none; border-radius: 50%; border: 4px solid var(--green-soft); border-top-color: var(--green); animation: spin 0.9s linear infinite; }
.job.finished .spinner, .job.failed .spinner { animation: none; border-color: var(--green); }
.job.failed .spinner { border-color: #f3c9c5; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

/* ------------------------------------------------------------ account, licentie, beheer */
.pairform { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; padding-bottom: 14px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.pairform label { margin: 0; }
.pairform input.code { text-transform: uppercase; letter-spacing: .12em; }
.license .lstate { font-weight: 600; margin: 0 0 10px; }
.license.licensed .lstate { color: var(--green-2); }
.license.expired .lstate { color: var(--danger); }
.price { font-size: 15px; margin: 6px 0 8px; }
.price b { font-size: 30px; letter-spacing: -.02em; }
.ticks { list-style: none; padding: 0; margin: 0 0 16px; }
.ticks li { padding-left: 24px; position: relative; margin: 6px 0; font-size: 14px; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: 5px; width: 12px; height: 7px; border-left: 2.5px solid var(--green); border-bottom: 2.5px solid var(--green); transform: rotate(-45deg); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.flash.lic a { margin-left: 8px; font-weight: 700; }
.verifybar { background: #fff7e0; color: #7a5a00; }
.verifybar .link { color: inherit; font-weight: 700; text-decoration: underline; margin-left: 6px; }
.tag { font-size: 11px; background: var(--green-soft); color: var(--green-2); border-radius: 6px; padding: 1px 6px; font-weight: 700; }
.urow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.urow b { word-break: break-all; }

/* ------------------------------------------------------------ phone */
@media (max-width: 1100px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .side-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
  .side-col .card + .card { margin-top: 0; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: auto 0 0 0; height: auto; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); z-index: 1000; flex-direction: row; border-top: 1px solid #263644; }
  .side .logo, .premium, .nav .logout { display: none; }
  .mhead { display: flex; position: absolute; top: 14px; left: 16px; z-index: 2; align-items: center; gap: 8px; color: #fff; font-weight: 800; font-style: italic; font-size: 18px; letter-spacing: -.02em; text-decoration: none; }
  .mhead img { width: 40px; height: auto; }
  .mhead span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .nav { flex-direction: row; width: 100%; justify-content: space-around; gap: 0; }
  .nav a { flex-direction: column; gap: 2px; padding: 6px 4px; font-size: 10.5px; border-radius: 10px; flex: 1; text-align: center; }
  .nav a.on { background: var(--navy-2); color: var(--green); }
  .main { padding: 12px 12px 90px; }
  .hero { padding: 64px 20px 22px; min-height: 180px; }
  .hero.photo { background: linear-gradient(180deg, rgba(8, 14, 22, .55) 0%, rgba(8, 14, 22, .35) 60%, rgba(8, 14, 22, .55) 100%), url(hero.jpg) 72% center / cover no-repeat, #2a2f5a; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pairform { grid-template-columns: 1fr; }
  /* tabbladen op de gsm: even breed naast elkaar, niets om opzij te schuiven */
  .tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0; }
  .tabs button { padding: 10px 2px; font-size: 14px; white-space: normal; text-align: center; line-height: 1.2; }
  #map { height: 320px; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .card { padding: 16px; }
}
