/* KennzeichenRadar – Blau / Gelb / Weiß (EU-Kennzeichen Look) */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  color-scheme: light;
  --eu-blue: #003399;
  --eu-blue-deep: #002266;
  --eu-blue-soft: #E8EEF9;
  --yellow: #FFCC00;
  --yellow-deep: #E6B800;
  --yellow-soft: #FFF6CC;
  --white: #FFFFFF;
  --bg: #F3F6FB;
  --bg-elevated: #FFFFFF;
  --surface: #FFFFFF;
  --surface-hover: #F7F9FC;
  --border: #D5DEEB;
  --border-strong: #A8B8D0;
  --text: #0B1B33;
  --text-muted: #5A6B82;
  --primary: var(--eu-blue);
  --primary-dim: rgba(0, 51, 153, 0.1);
  --accent: var(--yellow);
  --success: #1B7F4A;
  --success-dim: rgba(27, 127, 74, 0.12);
  --danger: #C62828;
  --danger-dim: rgba(198, 40, 40, 0.1);
  --warn: #B8860B;
  --warn-dim: rgba(255, 204, 0, 0.28);
  --plate-bg: #FFFFFF;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(0, 34, 102, 0.08);
  --shadow-soft: 0 2px 8px rgba(0, 34, 102, 0.06);
  --font: 'Manrope', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  min-height: 100vh;
  background:
    linear-gradient(180deg, #E8EEF9 0%, var(--bg) 28%, #EEF2F8 100%);
  background-attachment: fixed;
}

.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 24px 20px 56px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 3px solid var(--eu-blue);
  position: relative;
}

.site-header::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 88px;
  height: 3px;
  background: var(--yellow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}

.brand img {
  height: 44px;
  width: auto;
  display: block;
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}

.install-btn {
  display: none;
  background: var(--eu-blue-soft);
  color: var(--eu-blue);
  border: 1px solid var(--border);
  font-size: 0.85rem;
}

.install-btn.visible { display: inline-flex; }

#push-btn { font-size: 0.85rem; }

.hero-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: visible;
}

.hero-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  border-radius: var(--radius) 0 0 var(--radius);
  background: linear-gradient(180deg, var(--eu-blue) 0%, var(--eu-blue) 62%, var(--yellow) 62%);
}

.hero-kicker {
  margin: 0 0 8px;
  color: var(--eu-blue);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.hero-card h2 {
  margin: 0 0 6px;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.hero-sub {
  margin: 0 0 20px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.plate-composer {
  display: flex;
  align-items: stretch;
  max-width: 560px;
  border-radius: var(--radius-sm);
  border: 2px solid #1A1A1A;
  background: var(--plate-bg);
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
  box-shadow: var(--shadow-soft);
}

.plate-composer:focus-within {
  border-color: var(--eu-blue);
  box-shadow: 0 0 0 3px rgba(0, 51, 153, 0.18);
}

.plate-composer.is-invalid { border-color: var(--danger); }
.plate-composer.is-valid { border-color: var(--success); }

.plate-eu {
  width: 44px;
  background: var(--eu-blue);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  flex-shrink: 0;
  border-radius: 6px 0 0 6px;
}

.plate-eu .d {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--yellow);
  border: 1.5px solid #1A1A1A;
  margin-top: 4px;
}

.plate-fields {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  flex: 1;
  padding: 8px 10px 10px;
  min-width: 0;
}

.plate-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
  min-width: 0;
}

.plate-field:first-of-type { flex: 0 1 92px; }
.plate-field:nth-of-type(2) { flex: 0 1 72px; }
.plate-field-digits { flex: 1 1 110px; }

.plate-label {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #64748B;
}

.plate-field input {
  width: 100%;
  border: none !important;
  background: transparent !important;
  color: #0B1B33 !important;
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 2px !important;
  min-width: 0;
  border-radius: 0;
  text-transform: uppercase;
  box-shadow: none !important;
}

.plate-field input::placeholder {
  color: #94A3B8;
  font-weight: 500;
}

.plate-field input:focus {
  outline: none;
  border: none !important;
}

.plate-dash {
  color: #0B1B33;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.4rem;
  padding-bottom: 4px;
  line-height: 1;
}

.plate-suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 240px;
  max-height: 220px;
  overflow: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 30;
}

.plate-suggest li {
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
}

.plate-suggest li:hover,
.plate-suggest li[aria-selected="true"] {
  background: var(--eu-blue-soft);
  color: var(--eu-blue);
}

.plate-suggest .mono {
  color: var(--eu-blue);
  margin-right: 6px;
  font-family: var(--font-mono);
  font-weight: 700;
}

.plate-hint {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  min-height: 1.35em;
}

.plate-hint.is-error { color: var(--danger); }
.plate-hint.is-ok { color: var(--success); }

.authority-select {
  margin-top: 12px;
  max-width: 280px;
  display: block;
}

.hero-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
  align-items: center;
}

.check-result {
  margin-top: 14px;
  color: var(--text-muted);
  min-height: 1.2em;
}

.manual-box {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--yellow-soft);
  border: 1px solid rgba(230, 184, 0, 0.55);
  color: var(--text);
}

.manual-box p {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--eu-blue);
  color: var(--white) !important;
  font-weight: 700;
  text-decoration: none;
}

.btn-link:hover { background: var(--eu-blue-deep); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-soft);
}

.card h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--eu-blue-deep);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.stats-card { padding: 12px 16px; }

.stats { display: flex; gap: 12px; flex-wrap: wrap; }

.stat {
  min-width: 88px;
  padding: 12px 14px;
  background: var(--eu-blue-soft);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}

.stat b {
  display: block;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--eu-blue);
  font-family: var(--font-mono);
}

.stat span { color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }

.more-card summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--eu-blue-deep);
  list-style: none;
}

.more-card summary::-webkit-details-marker { display: none; }

.more-card summary::after {
  content: '+';
  float: right;
  color: var(--text-muted);
}

.more-card[open] summary::after { content: '–'; }

.more-body { margin-top: 14px; }

.inline-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.inline-form input { flex: 1; min-width: 180px; }

.region-results {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.log-title {
  margin: 18px 0 8px;
  font-size: 0.95rem;
  color: var(--eu-blue-deep);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--eu-blue);
  border: none;
  color: var(--white);
  padding: 12px 18px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 50;
  font-size: 0.92rem;
  font-weight: 600;
  max-width: calc(100vw - 32px);
}

.toast.hidden { display: none; }

input, select {
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: var(--font);
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--eu-blue);
  box-shadow: 0 0 0 3px rgba(0, 51, 153, 0.12);
}

button {
  background: var(--yellow);
  color: var(--text);
  border: 1px solid var(--yellow-deep);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  cursor: pointer;
  font-weight: 800;
  font-family: var(--font);
  transition: transform 0.1s, filter 0.15s, background 0.15s;
}

button:hover { filter: brightness(0.97); }
button:active { transform: scale(0.98); }

button.secondary {
  background: var(--white);
  color: var(--eu-blue);
  border: 1.5px solid var(--eu-blue);
  font-weight: 700;
}

button.secondary:hover {
  background: var(--eu-blue-soft);
  filter: none;
}

button:disabled { opacity: 0.55; cursor: wait; filter: none; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 6px; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-size: 0.82rem; font-weight: 700; }
td.mono { font-family: var(--font-mono); font-weight: 600; letter-spacing: 0.02em; }

.pill {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: var(--font-mono);
}

.available { background: var(--success-dim); color: var(--success); }
.taken { background: var(--danger-dim); color: var(--danger); }
.error, .unknown { background: var(--warn-dim); color: #7A5A00; }
.scanning { background: var(--primary-dim); color: var(--eu-blue); animation: pulse 1.2s ease infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.log {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  white-space: pre-wrap;
  color: #334155;
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  max-height: 280px;
  overflow: auto;
}

.hint { color: var(--text-muted); font-size: 0.85rem; margin-top: 8px; }
a { color: var(--eu-blue); font-weight: 600; }
.hidden { display: none !important; }
.mono { font-family: var(--font-mono); }

.site-footer {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 2px solid var(--border);
  color: var(--text-muted);
  font-size: 0.82rem;
  text-align: center;
}

.site-footer strong { color: var(--eu-blue); }

@media (max-width: 760px) {
  .plate-field input { font-size: 1.15rem; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions button { width: 100%; }
}

@media (display-mode: standalone) {
  body { padding-top: env(safe-area-inset-top); }
  .site-header { padding-top: 8px; }
}
