* { box-sizing: border-box; }

:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #dbe3ef;
  --brand: #0f4c81;
  --soft: #eef5fb;
  --danger: #b42318;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}

body { padding: 18px; }

.container {
  max-width: 1280px;
  margin: 0 auto;
}

.top, .summary, .card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
}

.top {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}

.brand {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1, h2, h3 { margin: 0 0 8px; }

.intro, .card-head p, .tariff-bar p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.hint {
  background: var(--soft);
  border: 1px solid #d6e5f3;
  border-radius: 12px;
  padding: 14px;
  font-size: 14px;
}

.hint p {
  margin: 8px 0 0;
  line-height: 1.5;
}

.hint a {
  color: var(--brand);
  text-decoration: none;
}

.main-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

#rides {
  display: grid;
  gap: 18px;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 16px 0;
}

.summary-box, .summary-item {
  background: #fafcff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}

.summary-box span {
  display: block;
  color: var(--muted);
  margin-bottom: 6px;
}

.summary-list {
  display: grid;
  gap: 10px;
}


.grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

label span {
  font-weight: 700;
}

input, select {
  min-height: 44px;
  width: 100%;
  border: 1px solid #c9d4e5;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 15px;
  background: #fff;
}

.tariff-bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-top: 18px;
}

.tariff-select {
  min-width: 240px;
  max-width: 280px;
}

.tariffs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.tariff-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: #fbfdff;
}

.tariff-list {
  display: grid;
  gap: 8px;
  font-size: 14px;
}

.tariff-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.tariff-row strong {
  color: var(--text);
}

.tariff-price {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--brand);
  font-size: 28px;
  font-weight: 700;
}

.booked {
  margin-top: 18px;
  background: #fafcff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}

.booked p {
  margin: 0;
  line-height: 1.6;
}

.message {
  min-height: 22px;
  margin: 14px 0 0;
  color: var(--danger);
  font-weight: 700;
}

@media (max-width: 900px) {
  .main-layout {
    grid-template-columns: 1fr;
  }

  .sticky-summary {
    position: static;
  }
}

@media (max-width: 1000px) {
  .top, .grid, .tariffs {
    grid-template-columns: 1fr;
  }

  .tariff-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .tariff-select {
    min-width: 0;
    max-width: 100%;
  }
}


.tariff-controls {
  display: flex;
  gap: 12px;
  align-items: end;
  margin-left: auto;
}

.voucher-select {
  min-width: 220px;
  max-width: 260px;
}

.tariff-select {
  min-width: 220px;
  max-width: 260px;
}

@media (max-width: 1000px) {
  .tariff-controls {
    flex-direction: column;
    align-items: stretch;
    margin-left: 0;
  }

  .voucher-select,
  .tariff-select {
    min-width: 0;
    max-width: 100%;
  }
}


.summary {
  align-self: start;
  width: 100%;
  min-width: 0;
}

.sticky-summary {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow: auto;
  z-index: 5;
}

@media (max-width: 900px) {
  .summary {
    align-self: auto;
  }

  .sticky-summary {
    position: static;
    max-height: none;
    overflow: visible;
  }
}


.quantity-field.is-hidden {
  visibility: hidden;
  pointer-events: none;
}

.quantity-field.is-hidden input {
  background: #f7f9fc;
}


.dependent-field.is-hidden {
  visibility: hidden;
  pointer-events: none;
}

.dependent-field.is-hidden select,
.dependent-field.is-hidden input {
  background: #f7f9fc;
}


/* Projektübersicht bleibt rechts fixiert; erst unter 900px unter dem Rechner */


.mail-box {
  margin-top: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
}

.mail-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.mail-form {
  margin-top: 18px;
}

.mail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.full-width {
  grid-column: 1 / -1;
}

textarea {
  width: 100%;
  border: 1px solid #c9d4e5;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 15px;
  background: #fff;
  resize: vertical;
  min-height: 110px;
  font-family: Arial, Helvetica, sans-serif;
}

.mail-preview {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafcff;
  line-height: 1.6;
}

.send-button {
  margin-top: 16px;
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  padding: 0 18px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
}

.send-button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

@media (max-width: 1000px) {
  .mail-grid {
    grid-template-columns: 1fr;
  }
}


.route-box {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: #fafcff;
}

.route-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.route-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.route-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.route-button {
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
}

.route-button.secondary {
  background: #e8f0f8;
  color: var(--brand);
  border: 1px solid #cfe0f1;
}

.route-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.route-info {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.route-map {
  margin-top: 14px;
  min-height: 280px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.route-map.is-hidden {
  display: none;
}

@media (max-width: 1000px) {
  .route-head,
  .route-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .route-actions {
    justify-content: stretch;
  }

  .route-button {
    width: 100%;
  }
}


.route-autocomplete.is-loading {
  background-image: linear-gradient(90deg, #fff, #f3f7fb, #fff);
  background-size: 200% 100%;
  animation: routeLoading 1.2s linear infinite;
}

@keyframes routeLoading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}


.customer-box {
  margin-bottom: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
}

.customer-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.customer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.customer-status {
  grid-column: 1 / -1;
  max-width: 340px;
}

.customer-detail.is-hidden {
  display: none;
}

.customer-email-only {
  max-width: 420px;
}

.summary-email-box {
  margin-bottom: 16px;
  padding: 14px;
  background: #fafcff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.summary-email-box span {
  display: block;
  color: var(--muted);
  margin-bottom: 6px;
}

#summary-customer-email[readonly],
#mail-customer-email[readonly] {
  background: #f7f9fc;
}

@media (max-width: 1000px) {
  .customer-grid {
    grid-template-columns: 1fr;
  }

  .customer-status,
  .customer-email-only {
    max-width: 100%;
  }
}


.ride-hidden {
  display: none;
}

.ride-toggle-wrap {
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 18px;
  text-align: center;
}

.ride-toggle-wrap p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.5;
}

.ride-toggle-button {
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  padding: 0 18px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
}
