:root {
  --bg: #050816;
  --card-bg: #0b1633;
  --accent: #1f7ae0;
  --accent-soft: rgba(31, 122, 224, 0.1);
  --text: #f9fbff;
  --muted: #9aa4c2;
  --danger: #ff5b5b;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow-soft: 0 14px 35px rgba(0, 0, 0, 0.35);
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-main);
  background: radial-gradient(circle at top, #142449 0, #050816 45%, #000 100%);
  color: var(--text);
  min-height: 100vh;
}

.app-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px 16px 32px;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 4px 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1f7ae0, #26d5ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #ffffff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-weight: 600;
  letter-spacing: 0.03em;
}

.brand-subtitle {
  font-size: 0.8rem;
  color: var(--muted);
}

.app-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center; /* centreer de kaarten */
}

.card {
  background: rgba(11, 22, 51, 0.95);
  border-radius: var(--radius-lg);
  padding: 18px 18px 20px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
  width: 100%;
  max-width: 640px;    /* zelfde breedte voor formulier én resultaat */
  margin: 0 auto;      /* centreer binnen de app-container */
}

h1,
h2 {
  margin-top: 0;
  letter-spacing: 0.02em;
}

h1 {
  font-size: 1.4rem;
}

h2 {
  font-size: 1.2rem;
}

.intro {
  margin-top: 4px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
}

.form-row {
  display: grid;
  gap: 10px;
}

@media (min-width: 640px) {
  .form-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.label {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 4px;
}

input,
select {
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(7, 14, 34, 0.9);
  color: var(--text);
  padding: 9px 10px;
  font-size: 0.9rem;
  outline: none;
  transition: border 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input::placeholder {
  color: #576287;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(31, 122, 224, 0.5);
}

.primary-btn,
.secondary-btn {
  width: 100%;
  border-radius: var(--radius-md);
  padding: 10px 12px;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  margin-top: 6px;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.15s ease, color 0.15s ease;
}

.primary-btn {
  background: linear-gradient(135deg, #1f7ae0, #26d5ff);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}

.primary-btn:disabled {
  opacity: 0.7;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.secondary-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--muted);
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.status {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--muted);
  min-height: 16px;
}

.status.error {
  color: var(--danger);
}

.status.success {
  color: #32d47b;
}

.results-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-top: 8px;
}

@media (min-width: 640px) {
  .results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.result-item {
  background: rgba(5, 13, 31, 0.9);
  border-radius: var(--radius-md);
  padding: 10px 10px 9px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.result-item.highlight {
  border-color: rgba(31, 122, 224, 0.5);
  background: radial-gradient(circle at top left, rgba(31, 122, 224, 0.15), rgba(5, 13, 31, 0.9));
}

.result-item.total {
  grid-column: 1 / -1;
}

.result-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 2px;
}

.result-value {
  font-size: 1rem;
  font-weight: 500;
}

.route-summary {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--muted);
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  padding-top: 10px;
}

.app-footer {
  margin-top: 16px;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
}

.autocomplete-group {
  position: relative;
}

.autocomplete-list {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 2px;
  background: rgba(7, 14, 34, 0.98);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.7);
  max-height: 220px;
  overflow-y: auto;
  z-index: 30;
  display: none; /* standaard verborgen */
}

.autocomplete-item {
  padding: 8px 10px;
  font-size: 0.9rem;
  cursor: pointer;
}

.autocomplete-item:hover {
  background: rgba(31, 122, 224, 0.12);
}

@media (min-width: 880px) {
  .app-main {
    display: grid;
    gap: 16px;
    align-items: flex-start;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  }

  .card {
    max-width: none;   /* laat de kaart de kolombreedte vullen */
    width: 100%;
    margin: 0;         /* niet meer centreren, grid regelt dit */
  }
}
