/* route-to-drone — mobil öncelikli, karanlık tema, çerçevesiz. */
:root {
  --bg: #0f1115;
  --panel: rgba(20, 23, 30, 0.94);
  --card: #171a21;
  --line: #2a2f3a;
  --text: #e8eaf0;
  --muted: #9aa1b2;
  --accent: #4f8cff;
  --accent-text: #ffffff;
  --start: #34c38f;
  --end: #ff5d6c;
  --error: #ff7a85;
  --ok: #34c38f;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }

.view { min-height: 100dvh; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--error); margin: 8px 0 0; font-size: 14px; }
.hint { color: var(--muted); font-size: 13px; margin: 6px 2px 0; }

h1 { font-size: 26px; margin: 0 0 4px; letter-spacing: -0.02em; }
h2 { font-size: 20px; margin: 0 0 4px; }

button, .button, input {
  font: inherit;
  border-radius: 10px;
}
button, .button {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: #222734; color: var(--text);
  min-height: 44px; padding: 0 16px; cursor: pointer; text-decoration: none;
}
button:disabled { opacity: 0.45; cursor: not-allowed; }
.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.secondary { background: transparent; }
.big { width: 100%; min-height: 52px; font-size: 17px; }
.link { background: none; border: 0; color: var(--muted); min-height: 32px; padding: 0; font-size: 13px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

input[type="password"], input[type="text"] {
  width: 100%; min-height: 46px; padding: 0 12px;
  background: #0f1218; color: var(--text); border: 1px solid var(--line);
}

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; width: min(520px, calc(100% - 24px)); margin: 0 auto;
}

/* Giriş */
#view-login { display: grid; place-items: center; padding: 16px; }
.login { display: grid; gap: 10px; }
.login label { font-size: 14px; color: var(--muted); margin-top: 8px; }

/* Seçim */
#view-pick { position: relative; height: 100dvh; overflow: hidden; }
#map, .map-fallback { position: absolute; inset: 0; background: #1b1f27; }
.map-fallback { display: grid; place-items: center; padding: 120px 24px 220px; text-align: center; color: var(--muted); }
.panel {
  position: absolute; left: 0; right: 0; z-index: 2;
  background: var(--panel); backdrop-filter: blur(8px);
  padding: 10px 12px;
}
.panel.top { top: 0; padding-top: max(10px, env(safe-area-inset-top)); border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.panel.bottom {
  bottom: 0; padding-bottom: max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); display: grid; gap: 8px;
}
.field { display: grid; grid-template-columns: 14px 1fr 44px; align-items: center; gap: 8px; }
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.start { background: var(--start); }
.dot.end { background: var(--end); }
.ac { min-width: 0; }
.ac gmp-place-autocomplete, .ac input { width: 100%; }
.ac gmp-place-autocomplete { color-scheme: dark; }
.tap { padding: 0; width: 44px; font-size: 18px; }
.tap[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); }
.route-info { font-size: 14px; min-height: 20px; }
.quota { font-size: 14px; display: flex; align-items: center; gap: 8px; }
.quota::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.quota.off::before { background: var(--error); }
.quota.off { color: var(--error); }

/* Bekleme */
#view-progress, #view-result { padding: max(16px, env(safe-area-inset-top)) 0 24px; display: grid; align-content: start; }
.stages { list-style: none; margin: 16px 0; padding: 0; display: grid; gap: 2px; }
.stages li {
  display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 8px;
  padding: 9px 4px; color: var(--muted); border-bottom: 1px solid #20242d;
}
.stages li:last-child { border-bottom: 0; }
.stages .icon { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 12px; }
.stages li.done { color: var(--text); }
.stages li.done .icon { background: var(--ok); border-color: var(--ok); color: #0b1a12; }
.stages li.done .icon::after { content: "✓"; font-weight: 700; }
.stages li.active { color: var(--text); font-weight: 600; }
.stages li.active .icon { border-color: var(--accent); border-top-color: transparent; animation: spin 0.9s linear infinite; }
.stages li.failed .icon { background: var(--error); border-color: var(--error); }
.stages .sub { font-size: 12px; color: var(--muted); font-weight: 400; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .stages li.active .icon { animation: none; border-top-color: var(--accent); } }
.eta .bar { height: 6px; background: #232836; border-radius: 3px; overflow: hidden; }
.eta .bar > div { height: 100%; width: 0; background: var(--accent); transition: width 0.8s ease; }
.eta p { margin: 8px 0 0; font-size: 14px; }

/* Sonuç */
.result video {
  width: 100%; max-height: 70dvh; aspect-ratio: 9 / 16; object-fit: contain;
  background: #000; border-radius: 10px; margin: 12px 0;
}
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

@media (min-width: 900px) {
  /* Masaüstü: harita tam ekran, paneller sol üstte kart. */
  .panel.top, .panel.bottom {
    left: 16px; right: auto; width: 400px; border: 1px solid var(--line); border-radius: var(--radius);
  }
  .panel.top { top: 16px; }
  .panel.bottom { bottom: 16px; }
}
