@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&family=Zalando+Sans:ital,wght@0,200..900;1,200..900&display=swap');

:root {
  --color-white: #ffffff;
  --color-brand-100: #cfedff;
  --color-brand-200: #dbe9f6;
  --color-brand-300: #c3daf2;
  --color-brand-400: #9bc2e9;
  --color-brand-500: #68a3de;
  --color-brand-600: #0466c8;
  --color-brand-700: #0353a4;
  --color-brand-800: #023e7d;
  --color-brand-900: #011f3f;
  --color-highlight-500: #4ebcff;
  --color-highlight-600: #28aeff;
  --color-mcgray-100: #fafbfb;
  --color-mcgray-200: #f3f4f6;
  --color-mcgray-300: #e0e4e8;
  --color-mcgray-400: #6e7378;

  --bg: var(--color-brand-100);
  --panel: var(--color-white);
  --panel-2: var(--color-white);
  --text: var(--color-brand-900);
  --muted: var(--color-mcgray-600);
  --accent: var(--color-highlight-500);
  --accent-2: var(--color-highlight-600);
  --danger: #ef4444;
  --border: var(--color-brand-300);

  --font: "Zalando Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

header h1 { font-size: 20px; margin: 0; }
header a { color: var(--muted); text-decoration: none; margin-left: 16px; font-size: 14px; }
header a:hover { color: var(--text); }

.admin-link {
  position: fixed;
  top: 16px;
  right: 20px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 6px;
  z-index: 20;
}
.admin-link:hover { color: var(--text); background: rgba(255,255,255,0.04); }

main { max-width: 1100px; margin: 0 auto; padding: 32px; }

main.centered {
  max-width: none;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 48px 24px;
}

.quote-card {
  width: 100%;
  max-width: 1200px;
  margin-bottom: 0;
}
#results.quote-card { max-width: 1200px; }

.brand {
  font-size: 26px;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.model-tag {
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}
.model-tag #active-model { color: var(--accent); font-weight: 600; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 5px;
}

h2 { 
  margin: 0 0 16px; font-size: 18px; 
}

label { 
  display: block; 
  margin: 12px 0 6px; 
  font-size: 15px; 
  color: var(--muted); 
  font-weight: 500;
}

input[type=text], input[type=password], input[type=number], input[type=file], select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 14px;
}

button {
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: var(--color-brand-800);
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}
button:hover { background: var(--accent-2); }
button.secondary { background: var(--panel-2); color: var(--text); }
button.danger { background: var(--danger); color: white; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.row { display: flex; gap: 12px; align-items: stretch; }
.row > input { flex: 1; }

.results {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  margin-top: 24px;
}
@media (max-width: 800px) { .results { grid-template-columns: 1fr; } }

.preview {
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.preview img { width: 100%; display: block; }

/* Map container */
.map-wrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
  min-height: 640px;
}
#map { width: 100%; height: 640px; }
.pin-actions {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
  z-index: 5;
}
.pin-actions span {
  font-size: 12px;
  color: var(--muted);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.pin-actions[hidden] { display: none; }
.pin-actions button { padding: 6px 12px; font-size: 13px; }

.redraw-btn {
  margin-top: 16px;
  width: 100%;
  font-size: 13px;
  padding: 8px 12px;
}

.stat { padding: 14px 0; border-bottom: 1px solid var(--border); }
.stat:last-child { border-bottom: none; }
.stat .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stat .value { font-size: 22px; font-weight: 600; margin-top: 4px; }
.price { color: var(--accent); font-size: 30px; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; }

.badge { padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.badge.active { background: var(--accent); color: #052e1a; }
.badge.inactive { background: var(--panel-2); color: var(--muted); }

.error { color: var(--danger); margin-top: 12px; font-size: 14px; }
.detect-fail {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid var(--danger);
  color: #fecaca;
  padding: 10px 14px;
  border-radius: 8px;
  margin: 8px 0 16px;
  font-size: 14px;
  font-weight: 500;
}
.muted { color: var(--muted); font-size: 13px; }
.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid var(--muted); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite; margin-right: 8px;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Address autocomplete dropdown */
.ac-dropdown {
  list-style: none;
  margin: 4px 0 0;
  padding: 4px 0;
  position: absolute;
  top: 100%;
  left: 0;
  right: 100px; /* leave space for the Quote button */
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 50;
  max-height: 280px;
  overflow-y: auto;
}
.ac-dropdown li {
  padding: 8px 12px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}
.ac-dropdown li:hover, .ac-dropdown li.active {
  background: var(--panel-2);
}
