@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=Space+Grotesk:wght@500;600&display=swap');

:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #0b1220;
  --muted: #64748b;
  --accent: #275FAC;
  --accent-2: #00A666;
  --accent-soft: rgba(39, 95, 172, 0.14);
  --shadow: 0 12px 36px rgba(15, 23, 42, 0.10);
  --border: rgba(15, 23, 42, 0.08);
}

body[data-theme="dark"] {
  --bg: #0b1018;
  --panel: #121827;
  --text: #e5e7eb;
  --muted: #9aa4b2;
  --accent: #4b8bff;
  --accent-2: #00c77a;
  --accent-soft: rgba(75, 139, 255, 0.18);
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  --border: rgba(148, 163, 184, 0.2);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Manrope', system-ui, sans-serif;
  background:
    radial-gradient(900px 600px at 12% -10%, rgba(39, 95, 172, 0.12), transparent 55%),
    radial-gradient(900px 600px at 88% 0%, rgba(0, 166, 102, 0.12), transparent 55%),
    var(--bg);
  color: var(--text);
}

.hidden { display: none; }

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(520px, 92vw);
  background: var(--panel);
  padding: 28px;
  border-radius: 22px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.login-split {
  width: min(1100px, 96vw);
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
  align-items: stretch;
}

.login-left {
  background: linear-gradient(135deg, rgba(39,95,172,0.08), rgba(0,166,102,0.08));
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: grid;
  grid-template-rows: 1fr auto;
}

.hero-img {
  width: 100%;
  height: 100%;
  display: block;
}

.hero-img svg {
  width: 100%;
  height: 100%;
  display: block;
}

.login-left-copy {
  padding: 20px 24px 24px;
}

.login-left-copy h1 {
  margin: 0 0 8px;
  font-family: 'Space Grotesk', sans-serif;
}

.login-left-copy p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.5;
}

.logo-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.logo-row img {
  height: 56px;
  width: auto;
  object-fit: contain;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  justify-self: center;
  justify-content: center;
  width: 100%;
}

.brand-logo {
  height: 64px;
  width: auto;
  object-fit: contain;
}

.brand-logo--small {
  height: 54px;
}

.brand-logo--login {
  height: 86px;
  max-width: 280px;
  width: 100%;
}

.brand h1, .brand h2 {
  font-family: 'Space Grotesk', sans-serif;
  margin: 0;
  letter-spacing: 0.2px;
}

.brand p, .brand span {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.field input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}

.btn {
  border: none;
  padding: 12px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 10px 24px var(--accent-soft);
}

.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn.block { width: 100%; }

.btn:hover { transform: translateY(-1px); }

.error { color: #ef4444; min-height: 20px; margin-top: 8px; }

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(10px);
}

body[data-theme="dark"] .topbar {
  background: rgba(18, 24, 39, 0.72);
}

.partner-logos {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.partner-logos img {
  height: 80px;
  width: auto;
  object-fit: contain;
  border-radius: 12px;
  padding: 6px;
  border: 1px solid rgba(39, 95, 172, 0.35);
  animation: pulseBorder 1.8s ease-in-out infinite;
  box-shadow: 0 0 24px rgba(0, 166, 102, 0.25);
}

@keyframes pulseBorder {
  0%, 100% { box-shadow: 0 0 0 rgba(39, 95, 172, 0.0); border-color: rgba(39, 95, 172, 0.35); }
  50% { box-shadow: 0 0 18px rgba(0, 166, 102, 0.25); border-color: rgba(0, 166, 102, 0.6); }
}

.actions { justify-self: end; display: inline-flex; gap: 8px; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  padding: 16px;
  flex: 1;
}

.map-area {
  position: relative;
  background: var(--panel);
  border-radius: 20px;
  padding: 6px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.search {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 500;
}

.search input {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
}

.map {
  width: 100%;
  height: calc(100vh - 190px);
  border-radius: 16px;
  overflow: hidden;
}

.coord-hint {
  position: absolute;
  right: 24px;
  bottom: 12px;
  font-size: 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border);
  padding: 6px 8px;
  border-radius: 10px;
  z-index: 600;
}

.side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel {
  background: var(--panel);
  border-radius: 16px;
  padding: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.legend {
  display: grid;
  gap: 12px;
}

.legend-row {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  display: inline-block;
}

.dot.green { background: #22c55e; }
.dot.yellow { background: #eab308; }
.dot.magenta { background: #d946ef; }

.meta { color: var(--muted); font-size: 0.85rem; }

.parcel-info {
  display: grid;
  gap: 10px;
}

.parcel-info .title { font-weight: 600; }

.pdf-wrap {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  height: 260px;
}

.pdf-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
}

.footer {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.7);
}

body[data-theme="dark"] .footer {
  background: rgba(18, 24, 39, 0.72);
}

.footer a { color: var(--accent); text-decoration: none; font-weight: 600; }

.label {
  font-size: 12px;
  font-weight: 600;
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.7);
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  white-space: nowrap;
}

.label.parsel { cursor: default; }

.label.mahalle,
.label.bolge,
.label.etiket {
  font-size: 11px;
  font-weight: 500;
  background: rgba(15, 23, 42, 0.55);
  letter-spacing: 0.2px;
}

.label.etiket {
  background: rgba(0, 166, 102, 0.6);
}

/* Popup polish */
.leaflet-popup {
  z-index: 900;
}
.leaflet-popup-content-wrapper {
  border-radius: 16px;
  padding: 6px 10px;
}
.leaflet-popup-content {
  margin: 8px 10px;
  min-width: 160px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.leaflet-popup-tip {
  box-shadow: none;
}
 .leaflet-popup-content .btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
 }

.label.ada {
  font-size: 11px;
  font-weight: 600;
  background: rgba(39, 95, 172, 0.7);
  letter-spacing: 0.2px;
}

.loader {
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 23, 0.6);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  z-index: 2000;
}

.loader-card {
  position: relative;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  padding: 24px 28px;
  display: grid;
  place-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
}

.loader-img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  border-radius: 16px;
}

.loader-ring {
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 999px;
  border: 4px solid rgba(15, 23, 42, 0.15);
  border-top-color: var(--accent);
  border-right-color: var(--accent-2);
  animation: spin 1.2s linear infinite;
}

.loader.hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

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

@media (max-width: 980px) {
  .login-split {
    grid-template-columns: 1fr;
  }
  .layout {
    grid-template-columns: 1fr;
    padding: 12px;
  }
  .map { height: 56vh; }
  .topbar {
    grid-template-columns: 1fr;
    gap: 10px;
    text-align: center;
  }
  .brand { justify-content: center; margin-bottom: 8px; }
  .partner-logos { justify-self: center; }
  .actions { justify-self: center; }
  .search {
    right: 10px;
    left: 10px;
    top: 10px;
    justify-content: space-between;
  }
  .search input { flex: 1; }
  .side { gap: 12px; }
  .panel { padding: 12px; }
}

@media (max-width: 540px) {
  .login-card { padding: 20px; border-radius: 18px; }
  .login-left-copy { padding: 16px; }
  .map { height: 52vh; }
  .search input { font-size: 14px; }
  .btn { padding: 10px 12px; }
  .partner-logos img { height: 60px; }
}
.toki-panel {
  display: grid;
  place-items: center;
  padding: 10px;
}

.toki-panel img {
  width: 100%;
  max-width: 220px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 16px 40px rgba(39, 95, 172, 0.25));
}

.footer-row {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.footer-row img {
  height: 32px;
  width: auto;
  object-fit: contain;
}
