/* ============================================================
   TripPathAI — web app
   iOS uygulamasının birebir görsel dili:
   beyaz zemin · systemGray kartlar · siyah seçimler · mono ikonlar.
   Apple cihazlarda gerçek SF (ui-rounded / -apple-system),
   diğerlerinde Nunito + Figtree ile aynı his.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@600;700;800;900&family=Figtree:wght@400;500;600;700&display=swap');

:root {
  /* iOS system palette */
  --bg: #FFFFFF;
  --gray6: #F2F2F7;
  --gray5: #E5E5EA;
  --gray4: #D1D1D6;
  --gray3: #C7C7CC;
  --ink: #0A0A0C;
  --ink-2: rgba(60, 60, 67, .64);   /* secondaryLabel */
  --ink-3: rgba(60, 60, 67, .32);   /* tertiaryLabel */
  --sel-wash: rgba(10, 10, 12, .07); /* primary.opacity(0.08) */

  --radius: 16px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .04), 0 2px 10px rgba(0, 0, 0, .04);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, .10), 0 14px 44px rgba(0, 0, 0, .08);

  --display: ui-rounded, 'Nunito', -apple-system, 'Segoe UI', sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Figtree', 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Code', Consolas, monospace;
  --maxw: 620px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

/* ---------- typography ---------- */
h1, h2, h3 { font-family: var(--display); font-weight: 800; letter-spacing: -.015em; line-height: 1.14; }
.kicker {
  font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-2); margin-bottom: 10px;
}
.muted { color: var(--ink-2); }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }

/* mono emoji trick — iOS'taki SF Symbol dilini yakalamak için
   kategori/ikon emojileri gri tona çevrilir */
.mono-ic { filter: grayscale(1) contrast(1.05); }

/* ---------- layout shell ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: saturate(1.1) blur(14px);
  -webkit-backdrop-filter: saturate(1.1) blur(14px);
  background: rgba(255, 255, 255, .8);
  border-bottom: 1px solid var(--gray5);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.brand { display: flex; align-items: center; gap: 9px; font-family: var(--display); font-weight: 800; font-size: 19px; color: var(--ink); text-decoration: none; letter-spacing: -.02em; }
.brand .mark {
  width: 29px; height: 29px; border-radius: 9px; display: grid; place-items: center;
  background: var(--ink); color: #fff; font-size: 15px;
}
.brand .pro {
  font-size: 10.5px; font-weight: 800; letter-spacing: .1em; color: var(--ink);
  border: 1.5px solid var(--ink); border-radius: 999px; padding: 1px 7px; margin-left: 2px;
}
.topnav { display: flex; gap: 20px; align-items: center; }
.topnav a { color: var(--ink-2); text-decoration: none; font-size: 14.5px; font-weight: 600; }
.topnav a:hover { color: var(--ink); }

/* ---------- buttons (iOS: siyah dolgu, radius 16) ---------- */
.btn {
  font-family: var(--sans); font-weight: 600; font-size: 16.5px; cursor: pointer;
  border: none; border-radius: var(--radius); padding: 15px 24px;
  transition: transform .12s ease, opacity .15s ease, background .2s ease;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { opacity: .88; }
.btn-primary:disabled { background: var(--gray4); color: #fff; cursor: not-allowed; opacity: 1; }
.btn-accent { background: var(--ink); color: #fff; }
.btn-accent:hover { opacity: .88; }
.btn-ghost { background: var(--gray6); color: var(--ink); }
.btn-ghost:hover { background: var(--gray5); }
.btn-block { width: 100%; }
.btn-sm { padding: 10px 18px; font-size: 14px; border-radius: 12px; }

/* ---------- step flow ---------- */
.stepbar { display: flex; gap: 5px; align-items: center; padding: 16px 0 4px; }
.stepbar .pill { height: 4px; border-radius: 999px; background: var(--gray5); flex: 1; transition: background .35s ease; }
.stepbar .pill.done { background: var(--ink); }
.stepbar .count { font-size: 12px; font-weight: 700; color: var(--ink-3); margin-left: 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }

.step { padding: 6px 0 130px; animation: rise .4s cubic-bezier(.2, .75, .25, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* iOS'taki gibi ortalanmış adım başlığı */
.step-head { text-align: center; padding: 14px 0 24px; }
.step-head .stepnum {
  display: inline-block; font-size: 12px; font-weight: 700; color: var(--ink);
  background: var(--gray6); border-radius: 999px; padding: 4px 13px; margin-bottom: 12px;
}
.step h1 { font-size: clamp(26px, 6vw, 30px); }
.step .sub { color: var(--ink-2); font-size: 15px; margin: 8px auto 0; max-width: 44ch; }

/* option cards — SelectableCard: gray6 dolgu, seçilince siyah kontur + koyu yıkama */
.opts { display: grid; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--gray6); border: 1.5px solid transparent; border-radius: 14px;
  padding: 15px 17px; cursor: pointer; font-family: var(--sans); color: var(--ink);
  transition: background .18s ease, border-color .18s ease, transform .1s ease;
}
.opt:hover { background: #ECECF1; }
.opt:active { transform: scale(.99); }
.opt.sel { border-color: var(--ink); background: var(--sel-wash); }
.opt .ic { font-size: 21px; width: 32px; text-align: center; flex: none; filter: grayscale(1) contrast(1.05); }
.opt .txt { flex: 1; min-width: 0; }
.opt .t { display: block; font-weight: 600; font-size: 16px; }
.opt .d { display: block; font-size: 13.5px; color: var(--ink-2); }
.opt .check {
  width: 22px; height: 22px; border-radius: 999px; flex: none;
  display: grid; place-items: center; color: #fff;
  background: transparent; transform: scale(.4); opacity: 0;
  transition: transform .22s cubic-bezier(.3, 1.4, .5, 1), opacity .15s ease;
}
.opt.sel .check { background: var(--ink); transform: scale(1); opacity: 1; }
.opt .check::after { content: '✓'; font-size: 12px; font-weight: 800; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1.5px solid transparent; background: var(--gray6); border-radius: 999px; padding: 9px 16px;
  font-family: var(--sans); font-weight: 600; font-size: 14.5px; color: var(--ink); cursor: pointer;
  transition: background .18s ease, color .18s ease, transform .1s ease;
}
.chip:hover { background: var(--gray5); }
.chip:active { transform: scale(.96); }
.chip.sel { background: var(--ink); color: #fff; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 7px; }
.input {
  width: 100%; font-family: var(--sans); font-size: 16px; color: var(--ink); background: var(--gray6);
  border: 1.5px solid transparent; border-radius: var(--radius-sm); padding: 14px 15px;
  transition: border-color .15s ease, background .15s ease; -webkit-appearance: none; appearance: none;
}
.input:focus { outline: none; border-color: var(--ink); background: var(--bg); }
.input::placeholder { color: var(--ink-3); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* sticky footer action */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: linear-gradient(to top, var(--bg) 68%, transparent);
  padding: 22px 20px calc(16px + env(safe-area-inset-bottom));
}
.dock .wrap { max-width: var(--maxw); display: grid; gap: 8px; }
.dock .btn-ghost { padding: 11px 24px; background: transparent; color: var(--ink-2); font-size: 14.5px; }
.dock .btn-ghost:hover { color: var(--ink); background: var(--gray6); }

/* ---------- generating screen ---------- */
.gen { min-height: 66vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 0; }
.gen .spinner {
  width: 58px; height: 58px; border-radius: 999px; position: relative;
  border: 2.5px dashed var(--gray4); animation: spin 8s linear infinite;
}
.gen .spinner::after {
  content: ''; position: absolute; inset: -2.5px; border-radius: 999px;
  border: 2.5px solid transparent; border-top-color: var(--ink);
  animation: spin 1.1s cubic-bezier(.5, .15, .5, .85) infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.gen h1 { font-size: 27px; margin: 26px 0 8px; }
.gen .line { color: var(--ink-2); min-height: 24px; transition: opacity .3s; }
.gen .track { width: 200px; height: 4px; background: var(--gray5); border-radius: 999px; margin-top: 26px; overflow: hidden; }
.gen .track i { display: block; height: 100%; width: 40%; background: var(--ink); border-radius: 999px; animation: slide 1.4s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-120%); } 100% { transform: translateX(320%); } }

/* ---------- plan view ---------- */
.plan-head { padding: 22px 0 4px; text-align: center; }
.plan-head h1 { font-size: clamp(26px, 6.5vw, 32px); }
.plan-head .meta { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.plan-head .meta span {
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  background: var(--gray6); border-radius: 999px; padding: 5px 13px;
}
.plan-head .meta b { color: var(--ink); font-weight: 700; }

/* gün seçici — mobildeki iki satırlı çipler */
.daytabs { display: flex; gap: 8px; overflow-x: auto; padding: 16px 0 14px; scrollbar-width: none; }
.daytabs::-webkit-scrollbar { display: none; }
.daytab {
  flex: none; border: 1px solid transparent; background: var(--gray6); border-radius: var(--radius-sm);
  padding: 9px 16px; font-family: var(--sans); color: var(--ink); cursor: pointer; text-align: center;
  transition: background .2s ease, color .2s ease, transform .12s ease;
}
.daytab:active { transform: scale(.97); }
.daytab .dt { display: block; font-weight: 600; font-size: 14px; white-space: nowrap; }
.daytab .th { display: block; font-size: 11.5px; color: var(--ink-2); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.daytab.sel { background: var(--ink); color: #fff; }
.daytab.sel .th { color: rgba(255, 255, 255, .65); }
.daytab.locked { background: var(--gray6); color: var(--ink-2); border: 1px dashed var(--gray3); }
.daytab.locked .th { color: var(--ink-3); }
.daytab .lk { font-size: 10px; margin-right: 4px; }

/* ---------- map ---------- */
.mapwrap { position: relative; }
.map {
  height: 300px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--gray5);
  margin-bottom: 4px; background: var(--gray6); z-index: 1;
}
@media (min-width: 700px) { .map { height: 380px; } }

/* leaflet mono görünüm — gri harita karoları */
.map .leaflet-tile-pane { filter: grayscale(1) contrast(.94) brightness(1.04); }
.map .leaflet-control-attribution { font-size: 9px; background: rgba(255,255,255,.7); color: var(--ink-3); }
.map .leaflet-control-attribution a { color: var(--ink-2); }
.map .leaflet-control-zoom { border: none; box-shadow: var(--shadow-sm); border-radius: 10px; overflow: hidden; }
.map .leaflet-control-zoom a { color: var(--ink); border-color: var(--gray5); }

/* rota çizgileri */
.tp-route-casing { stroke: #fff; stroke-opacity: .9; }
.tp-route {
  stroke: var(--ink); stroke-opacity: .82;
  animation: tpFlow 40s linear infinite;
}
@keyframes tpFlow { to { stroke-dashoffset: -600; } }
.tp-route-stay { stroke: var(--ink); stroke-opacity: .35; }

/* numaralı pin — mobildeki siyah gövde + beyaz halka + nabız */
.tp-pin { position: relative; width: 34px; height: 34px; }
.tp-pin .dot {
  position: absolute; inset: 0; border-radius: 999px; background: var(--ink);
  border: 2.5px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
  display: grid; place-items: center; color: #fff;
  font-family: var(--display); font-weight: 800; font-size: 14px;
  transition: transform .18s cubic-bezier(.3, 1.3, .5, 1);
  cursor: pointer;
}
.tp-pin::before {
  content: ''; position: absolute; inset: -3px; border-radius: 999px;
  border: 2px solid var(--ink); opacity: 0;
  animation: tpPulse 1.6s ease-out infinite;
}
@keyframes tpPulse {
  0% { transform: scale(.9); opacity: .45; }
  70% { transform: scale(1.65); opacity: 0; }
  100% { transform: scale(1.65); opacity: 0; }
}
.tp-pin:hover .dot, .tp-pin.on .dot { transform: scale(1.22); }
.tp-pin.on::before { animation: none; opacity: 0; }
.tp-pin.on { z-index: 1000 !important; }

/* pin callout — Leaflet popup'ın mobildeki karşılığı */
.tp-pop .leaflet-popup-content-wrapper {
  border-radius: 13px; box-shadow: var(--shadow-md); border: 1px solid var(--gray5); padding: 0;
}
.tp-pop .leaflet-popup-content { margin: 12px 14px; font-family: var(--sans); text-align: center; min-width: 150px; }
.tp-pop .leaflet-popup-tip { box-shadow: var(--shadow-sm); }
.tp-pop .t { font-weight: 700; font-size: 13.5px; color: var(--ink); }
.tp-pop .h { font-size: 11.5px; color: var(--ink-2); margin-top: 3px; }
.tp-pop .g {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 8px;
  font-size: 11.5px; font-weight: 700; color: var(--ink); text-decoration: none;
  background: var(--gray6); border-radius: 999px; padding: 5px 11px;
}
.tp-pop .g:hover { background: var(--gray5); }
.tp-pop .leaflet-popup-close-button { display: none; }

/* ---------- timeline (mobildeki ActivityItemRow) ---------- */
.daytheme { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 19px; font-weight: 800; margin: 14px 0 16px; }
.daytheme .budget {
  font-family: var(--sans); font-size: 12.5px; font-weight: 700; color: var(--ink-2);
  background: var(--gray6); padding: 4px 11px; border-radius: 999px; flex: none;
}

.timeline { position: relative; }
.tl-item {
  display: grid; grid-template-columns: 44px 1fr; gap: 12px;
  border-radius: var(--radius-sm); cursor: pointer;
  transition: background .18s ease, transform .12s ease;
  padding: 4px 8px 4px 4px; margin: 0 -8px 0 -4px;
}
.tl-item:hover { background: var(--gray6); }
.tl-item:active { transform: scale(.99); }
.tl-item.hot { background: var(--sel-wash); }

.tl-rail { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 10px; }
.tl-num {
  width: 26px; height: 26px; border-radius: 999px; background: var(--gray6);
  display: grid; place-items: center; flex: none;
  font-family: var(--display); font-weight: 800; font-size: 13px; color: var(--ink);
  transition: background .18s ease, color .18s ease;
}
.tl-item:hover .tl-num, .tl-item.hot .tl-num { background: var(--ink); color: #fff; }
.tl-rail .cord { width: 1px; flex: 1; background: var(--gray4); min-height: 12px; }

.tl-card { padding: 9px 0 14px; min-width: 0; }
.tl-card .top { display: flex; align-items: center; gap: 8px; }
.tl-card .cat { font-size: 15px; filter: grayscale(1) contrast(1.05); flex: none; }
.tl-card .name { font-weight: 600; font-size: 15.5px; min-width: 0; }
.tl-card .cost {
  margin-left: auto; flex: none; font-family: var(--mono); font-size: 11.5px; font-weight: 600;
  color: var(--ink-2); background: var(--gray6); padding: 3px 9px; border-radius: 999px;
}
.tl-card .desc { color: var(--ink-2); font-size: 13.5px; margin-top: 3px; }
.tl-card .foot { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 7px; font-size: 12px; color: var(--ink-3); font-weight: 500; }

.tl-transport {
  display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 12.5px; font-weight: 500;
  padding: 2px 0 2px 56px;
}
.tl-transport .ic { filter: grayscale(1); font-size: 13px; }
.tl-transport .dash { flex: 1; border-top: 1.5px dashed var(--gray4); }

.backup {
  margin-top: 12px; font-size: 13.5px; color: var(--ink-2); background: var(--gray6);
  border-radius: var(--radius-sm); padding: 12px 14px;
}
.backup b { color: var(--ink); }

/* ---------- paywall / locked ---------- */
.lock {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: var(--bg); border: 1px solid var(--gray5); margin-top: 14px;
}
.lock .blur { filter: blur(7px); opacity: .55; pointer-events: none; padding: 18px 18px 6px; user-select: none; }
.lock .cover {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 5px; padding: 24px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, .5), rgba(255, 255, 255, .94));
}
.lock .cover .badge {
  font-size: 11px; font-weight: 800; letter-spacing: .13em; color: var(--ink);
  background: var(--gray6); border-radius: 999px; padding: 4px 12px;
}
.lock .cover h3 { font-size: 22px; margin-top: 4px; }
.lock .cover p { color: var(--ink-2); font-size: 14px; max-width: 36ch; }
.lock .cover .price { font-family: var(--display); font-size: 32px; font-weight: 800; margin: 2px 0; }
.lock .cover .price span { font-family: var(--sans); font-size: 15px; font-weight: 500; color: var(--ink-2); }

/* ---------- generic content pages ---------- */
.page { padding: 40px 0 80px; }
.page h1 { font-size: clamp(30px, 7vw, 42px); margin-bottom: 6px; }
.page .updated { color: var(--ink-3); font-size: 13.5px; margin-bottom: 30px; }
.page h2 { font-size: 21px; margin: 30px 0 10px; }
.page p, .page li { color: var(--ink-2); font-size: 15.5px; margin-bottom: 12px; }
.page ul { padding-left: 22px; }
.prose { max-width: 62ch; }

/* ---------- pricing ---------- */
.hero { text-align: center; padding: 56px 0 28px; }
.hero h1 { font-size: clamp(32px, 8.5vw, 52px); }
.hero .lede { color: var(--ink-2); font-size: 17.5px; margin: 14px auto 0; max-width: 42ch; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 34px; }
.pcard { background: var(--gray6); border: 1.5px solid transparent; border-radius: var(--radius); padding: 26px; }
.pcard.pro { background: var(--bg); border-color: var(--ink); position: relative; }
.pcard.pro::before {
  content: 'POPULAR'; position: absolute; top: -11px; left: 24px; background: var(--ink); color: #fff;
  font-size: 10px; font-weight: 800; letter-spacing: .12em; padding: 4px 11px; border-radius: 999px;
}
.pcard h3 { font-size: 21px; }
.pcard .amt { font-family: var(--display); font-size: 42px; font-weight: 800; margin: 10px 0 2px; }
.pcard .amt span { font-family: var(--sans); font-size: 15px; font-weight: 500; color: var(--ink-2); }
.pcard ul { list-style: none; margin: 18px 0 22px; }
.pcard li { color: var(--ink-2); font-size: 14.5px; padding: 6px 0 6px 25px; position: relative; }
.pcard li::before { content: '✓'; position: absolute; left: 0; color: var(--ink); font-weight: 800; }
.pcard li.off { color: var(--ink-3); }
.pcard li.off::before { content: '—'; color: var(--gray4); }
.pcard .btn-ghost { background: var(--bg); }
.pcard .btn-ghost:hover { background: var(--gray5); }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--gray5); margin-top: 40px; padding: 28px 0; }
.footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px; align-items: center; }
.footer .links { display: flex; gap: 20px; }
.footer a { color: var(--ink-2); text-decoration: none; font-size: 13.5px; font-weight: 500; }
.footer a:hover { color: var(--ink); }
.footer .cr { color: var(--ink-3); font-size: 13px; }

.center { text-align: center; }
.mt { margin-top: 16px; }
.hidden { display: none !important; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px;
  font-size: 14px; font-weight: 500; z-index: 100; box-shadow: var(--shadow-md); animation: rise .3s ease;
}

@media (max-width: 520px) {
  .cards { grid-template-columns: 1fr; }
  .topnav { gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .tp-route, .tp-pin::before, .gen .spinner, .gen .spinner::after { animation: none; }
  * { transition-duration: .01ms !important; }
}
