/* ── Reset & base ─────────────────────────────────────────── */
    *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
    html { scroll-behavior: smooth; }
    body {
      font-family: Onest, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
      background: #f0f4f8;
      min-height: 100vh;
      padding: 20px 16px 40px;
      line-height: 1.6;
    }

    /* ── Card ─────────────────────────────────────────────────── */
    .calculator-container { width: 100%; max-width: 600px; margin: 0 auto; }
    .calculator-card {
      background: #fff;
      border-radius: 16px;
      box-shadow: 0 10px 40px rgba(0,0,0,.10);
      padding: 32px;
      transition: .3s cubic-bezier(.4,0,.2,1);
    }
    .calculator-card:hover { transform: translateY(-2px); box-shadow: 0 20px 60px rgba(0,0,0,.14); }

    /* ── Provider header ──────────────────────────────────────── */
    .provider-header {
      text-align: center;
      margin-bottom: 28px;
    }
    .calculator-title {
      font-size: 26px;
      font-weight: 600;
      color: #1a1a1a;
      position: relative;
      display: inline-block;
      margin-bottom: 10px;
    }
    .calculator-title::after {
      content: '';
      position: absolute;
      bottom: -6px;
      left: 50%;
      transform: translateX(-50%);
      width: 50px;
      height: 3px;
      background: #2aa6fb;
      border-radius: 2px;
    }
    .provider-name-display {
      margin-top: 14px;
      font-size: 14px;
      color: #666;
      font-weight: 400;
    }

    /* ── Provider error / loading ─────────────────────────────── */
    .provider-error-screen {
      text-align: center;
      padding: 32px 16px;
    }
    .provider-error-screen .error-icon { font-size: 40px; margin-bottom: 12px; }
    .provider-error-screen h2 { font-size: 18px; font-weight: 600; margin-bottom: 8px; color: #1a1a1a; }
    .provider-error-screen p { font-size: 14px; color: #666; }

    /* ── Form ─────────────────────────────────────────────────── */
    .trip-form { display: flex; flex-direction: column; gap: 16px; }
    .form-group { display: flex; flex-direction: column; gap: 6px; }
    .form-label { font-weight: 500; color: #333; font-size: 14px; letter-spacing: .3px; }
    .form-input, .form-textarea {
      width: 100%;
      padding: 13px 15px;
      border: 2px solid #e1e5e9;
      font-size: 15px;
      color: #333;
      background: #fff;
      font-family: Onest, sans-serif;
      transition: .25s cubic-bezier(.4,0,.2,1);
    }
    .form-input { border-radius: 8px; }
    input[type="datetime-local"].form-input,
    input[type="time"].form-input {
      width: 100%;
      min-width: 0;
      appearance: none;
      -webkit-appearance: none;
      cursor: pointer;
    }
    /* ── Address suggestion dropdown ─────────────────────────── */
    .suggestion-dropdown {
      position: absolute;
      left: 0; right: 0;
      background: #fff;
      border: 1px solid #e1e5e9;
      border-top: none;
      border-radius: 0 0 8px 8px;
      box-shadow: 0 8px 24px rgba(0,0,0,.10);
      z-index: 100;
      overflow: hidden;
    }
    .suggestion-item {
      padding: 10px 14px;
      cursor: pointer;
      font-size: 14px;
      color: #333;
      border-bottom: 1px solid #f3f4f6;
      transition: background .15s;
    }
    .suggestion-item:last-child { border-bottom: none; }
    .suggestion-item:hover, .suggestion-item.active { background: #f0f7ff; }
    .suggestion-item-primary { font-weight: 500; }
    .suggestion-item-secondary { font-size: 12px; color: #888; margin-top: 1px; }
    .address-input-wrapper { position: relative; }

    /* ── Address geocode status line ──────────────────────────── */
    .address-status {
      font-size: 12px;
      margin-top: 4px;
      min-height: 0;
      color: #888;
      transition: opacity .2s;
      word-break: break-word;
    }
    .address-status.geocoding { color: #888; font-style: italic; }
    .address-status.confirmed { color: #15803d; }
    .address-status.warning   { color: #b45309; }
    .form-input:focus, .form-textarea:focus {
      outline: none;
      border-color: #2aa6fb;
      box-shadow: 0 0 0 4px rgba(42,166,251,.10);
      transform: translateY(-1px);
    }
    .form-input::placeholder { color: #9ca3af; }
    .form-textarea { border-radius: 8px; resize: vertical; min-height: 88px; }
    .form-input.error { border-color: #ef4444; box-shadow: 0 0 0 4px rgba(239,68,68,.10); }
    .field-error {
      font-size: 12px;
      color: #ef4444;
      font-weight: 500;
      min-height: 0;
      max-height: 0;
      overflow: hidden;
      transition: max-height .25s ease, opacity .25s ease;
      opacity: 0;
    }
    .field-error.show { max-height: 40px; opacity: 1; padding-top: 2px; }

    /* ── Section heading ──────────────────────────────────────── */
    .section-heading {
      font-size: 12px;
      font-weight: 600;
      color: #888;
      text-transform: uppercase;
      letter-spacing: .08em;
      margin-top: 6px;
      margin-bottom: 0;
      padding-bottom: 6px;
      border-bottom: 1px solid #f0f0f0;
    }

    /* ── Passenger composition ────────────────────────────────── */
    .composition-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
    }
    .count-group { display: flex; flex-direction: column; gap: 4px; }
    .count-label { font-size: 12px; color: #555; font-weight: 500; }
    .count-input {
      width: 100%;
      padding: 9px 12px;
      border: 2px solid #e1e5e9;
      border-radius: 8px;
      font-size: 15px;
      color: #333;
      font-family: Onest, sans-serif;
      text-align: center;
      transition: .2s;
    }
    .count-input:focus {
      outline: none;
      border-color: #2aa6fb;
      box-shadow: 0 0 0 3px rgba(42,166,251,.10);
    }
    .composition-total {
      font-size: 13px;
      color: #666;
      text-align: right;
      margin-top: 8px;
    }
    .composition-total.error { color: #ef4444; }
    /* simple passenger row */
    .passenger-simple {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }
    .passenger-simple-label { font-size: 14px; color: #555; font-weight: 500; flex: 1; }
    /* advanced expand button */
    .passenger-expand-btn {
      background: none;
      border: none;
      padding: 0;
      font-family: Onest, sans-serif;
      font-size: 12px;
      color: #2aa6fb;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 5px;
      margin-top: 8px;
    }
    .passenger-expand-btn:hover { color: #1e90e6; }
    .passenger-expand-btn .expand-arrow { transition: transform .2s; display: inline-block; }
    .passenger-expand-btn.open .expand-arrow { transform: rotate(180deg); }
    .passenger-active-badge {
      display: inline-block;
      background: #fef9c3;
      color: #854d0e;
      font-size: 10px;
      font-weight: 600;
      padding: 1px 6px;
      border-radius: 8px;
      margin-left: 2px;
    }

    /* ── Toggle ───────────────────────────────────────────────── */
    .toggle-container { display: flex; align-items: center; gap: 12px; margin: 4px 0; }
    .toggle-label { display: flex; align-items: center; gap: 12px; cursor: pointer; }
    .toggle-input { display: none; }
    .toggle-slider {
      position: relative;
      width: 46px;
      height: 24px;
      background: #e1e5e9;
      border-radius: 12px;
      transition: .25s cubic-bezier(.4,0,.2,1);
      flex-shrink: 0;
    }
    .toggle-input:checked + .toggle-slider { background: #2aa6fb; }
    .toggle-slider::before {
      content: '';
      position: absolute;
      top: 2px; left: 2px;
      width: 20px; height: 20px;
      background: #fff;
      border-radius: 50%;
      box-shadow: 0 2px 4px rgba(0,0,0,.2);
      transition: .25s cubic-bezier(.4,0,.2,1);
    }
    .toggle-input:checked + .toggle-slider::before { transform: translateX(22px); }
    .toggle-text { font-size: 14px; font-weight: 500; color: #333; user-select: none; }
    .return-day-badge {
      font-size: 11px;
      font-weight: 600;
      padding: 2px 8px;
      border-radius: 10px;
      letter-spacing: .03em;
    }
    .return-day-badge.same-day  { background: #e0f2fe; color: #0369a1; }
    .return-day-badge.other-day { background: #fef9c3; color: #854d0e; }

    /* ── Collapsible conditional fields ──────────────────────── */
    .collapsible { overflow: hidden; max-height: 0; opacity: 0; transition: max-height .35s cubic-bezier(.4,0,.2,1), opacity .25s ease; }
    .collapsible.open { max-height: 400px; opacity: 1; }
    .collapsible.open-lg { max-height: 140px; opacity: 1; }

    /* ── Buttons ──────────────────────────────────────────────── */
    .calculate-btn, .request-ride-btn {
      width: 100%;
      padding: 15px 24px;
      border: none;
      border-radius: 8px;
      font-size: 15px;
      font-weight: 600;
      font-family: Onest, sans-serif;
      cursor: pointer;
      position: relative;
      overflow: hidden;
      transition: .25s cubic-bezier(.4,0,.2,1);
    }
    .calculate-btn { background: #2aa6fb; color: #fff; margin-top: 4px; }
    .calculate-btn:hover { background: #1e90e6; transform: translateY(-2px); box-shadow: 0 8px 25px rgba(42,166,251,.30); }
    .calculate-btn:active { transform: translateY(0); }
    .request-ride-btn { background: #10b981; color: #fff; margin-top: 16px; display: none; }
    .request-ride-btn.visible { display: block; }
    .request-ride-btn:hover { background: #059669; transform: translateY(-2px); box-shadow: 0 8px 25px rgba(16,185,129,.30); }
    .calculate-btn:disabled, .request-ride-btn:disabled { opacity: .65; cursor: not-allowed; transform: none; }
    .btn-text { transition: opacity .2s; }
    .btn-loader {
      position: absolute;
      top: 50%; left: 50%;
      transform: translate(-50%,-50%);
      width: 18px; height: 18px;
      border: 2px solid rgba(255,255,255,.3);
      border-top-color: #fff;
      border-radius: 50%;
      animation: spin 1s linear infinite;
      opacity: 0;
      transition: opacity .2s;
    }
    .btn-loading .btn-text { opacity: 0; }
    .btn-loading .btn-loader { opacity: 1; }
    @keyframes spin { to { transform: translate(-50%,-50%) rotate(360deg); } }

    /* ── Fare display ─────────────────────────────────────────── */
    .fare-display {
      margin-top: 24px;
      padding: 22px;
      background: linear-gradient(135deg, #2aa6fb 0%, #1e90e6 100%);
      border-radius: 12px;
      color: #fff;
      text-align: center;
      display: none;
      animation: fadeUp .35s ease forwards;
    }
    .fare-display.visible { display: block; }
    @keyframes fadeUp { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
    .fare-label { font-size: 15px; font-weight: 500; opacity: .9; margin-bottom: 6px; }
    .fare-value { font-size: 34px; font-weight: 700; text-shadow: 0 2px 4px rgba(0,0,0,.10); }
    .fare-non-binding {
      font-size: 11px;
      opacity: .8;
      margin-top: 4px;
      font-weight: 400;
    }
    .fare-distance { font-size: 14px; opacity: .85; margin-top: 6px; }

    /* ── Flash messages ───────────────────────────────────────── */
    .flash {
      padding: 12px 16px;
      border-radius: 8px;
      font-size: 14px;
      font-weight: 500;
      margin-top: 14px;
      display: none;
    }
    .flash.visible { display: block; }
    .flash-error { background: #fef2f2; color: #dc2626; border: 1px solid #fca5a5; }
    .flash-success { background: #f0fdf4; color: #15803d; border: 1px solid #86efac; }

    /* ── Confirmation screen ──────────────────────────────────── */
    .confirmation-screen {
      text-align: center;
      padding: 24px 16px;
      display: none;
    }
    .confirmation-screen.visible { display: block; }
    .confirmation-icon { font-size: 48px; margin-bottom: 16px; }
    .confirmation-title { font-size: 22px; font-weight: 600; color: #1a1a1a; margin-bottom: 10px; }
    .confirmation-body { font-size: 14px; color: #555; line-height: 1.7; }
    .confirmation-non-binding {
      margin-top: 16px;
      padding: 12px 16px;
      background: #f0f7ff;
      border: 1px solid #bfdbfe;
      border-radius: 8px;
      font-size: 13px;
      color: #1d4ed8;
    }

    /* ── Modal ────────────────────────────────────────────────── */
    .modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,.50);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 2000;
      opacity: 0;
      visibility: hidden;
      backdrop-filter: blur(3px);
      transition: opacity .25s ease, visibility .25s ease;
    }
    .modal-overlay.show { opacity: 1; visibility: visible; }
    .modal-content {
      background: #fff;
      border-radius: 16px;
      width: 92%;
      max-width: 480px;
      max-height: 92vh;
      overflow-y: auto;
      transform: translateY(16px) scale(.97);
      transition: .25s cubic-bezier(.4,0,.2,1);
    }
    .modal-overlay.show .modal-content { transform: translateY(0) scale(1); }
    .modal-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 22px 28px;
      border-bottom: 1px solid #e1e5e9;
    }
    .modal-title { font-size: 18px; font-weight: 600; color: #1a1a1a; }
    .modal-close {
      background: none;
      border: none;
      font-size: 22px;
      cursor: pointer;
      color: #666;
      width: 30px; height: 30px;
      display: flex; align-items: center; justify-content: center;
      border-radius: 4px;
      transition: .2s;
    }
    .modal-close:hover { color: #2aa6fb; background: #f0f7ff; }
    .request-form { padding: 24px 28px; display: flex; flex-direction: column; gap: 12px; }
    .privacy-row {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      margin: 4px 0;
    }
    .privacy-checkbox {
      width: 18px; height: 18px;
      accent-color: #2aa6fb;
      cursor: pointer;
      flex-shrink: 0;
      margin-top: 2px;
    }
    .privacy-text {
      font-size: 13px;
      color: #555;
      line-height: 1.5;
    }
    .privacy-link { color: #2aa6fb; text-decoration: none; }
    .privacy-link:hover { text-decoration: underline; }
    .modal-fare-reminder {
      font-size: 12px;
      color: #e07000;
      background: #fff8f0;
      border: 1px solid #e07000;
      border-radius: 6px;
      padding: 8px 12px;
    }
    .modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }
    .cancel-btn, .submit-btn {
      padding: 11px 22px;
      font-size: 14px;
      font-family: Onest, sans-serif;
      font-weight: 500;
      cursor: pointer;
      border-radius: 8px;
      border: none;
      transition: .2s;
    }
    .cancel-btn { background: #f3f4f6; color: #666; }
    .cancel-btn:hover { background: #e5e7eb; color: #333; }
    .submit-btn { background: #2aa6fb; color: #fff; position: relative; overflow: hidden; }
    .submit-btn:hover { background: #1e90e6; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(42,166,251,.30); }
    .submit-btn:disabled { opacity: .65; cursor: not-allowed; transform: none; }
    .submit-btn .btn-loader { width: 15px; height: 15px; }

    /* ── Accessibility — focus-visible ───────────────────────── */
    /* Preserve visual focus ring for keyboard users on all interactive elements */
    :focus-visible {
      outline: 3px solid #2aa6fb;
      outline-offset: 2px;
    }
    /* Inputs already use box-shadow focus — add outline on top for keyboard nav */
    .form-input:focus-visible,
    .count-input:focus-visible {
      outline: 3px solid #2aa6fb;
      outline-offset: 0;
    }
    .calculate-btn:focus-visible,
    .request-ride-btn:focus-visible,
    .cancel-btn:focus-visible,
    .submit-btn:focus-visible,
    .modal-close:focus-visible,
    .passenger-expand-btn:focus-visible {
      outline: 3px solid #2aa6fb;
      outline-offset: 2px;
    }

    /* ── Touch targets ─────────────────────────────────────────── */
    .toggle-label {
      min-height: 44px;
      padding: 6px 0;
    }
    .passenger-expand-btn {
      min-height: 44px;
      padding: 6px 0;
    }
    .modal-close {
      min-width: 44px;
      min-height: 44px;
    }
    .suggestion-item {
      min-height: 44px;
      display: flex;
      flex-direction: column;
      justify-content: center;
    }

    /* ── Screenreader announcement region ─────────────────────── */
    .sr-announce {
      position: absolute;
      width: 1px; height: 1px;
      padding: 0; margin: -1px;
      overflow: hidden;
      clip: rect(0,0,0,0);
      white-space: nowrap;
      border: 0;
    }

    /* ── Contrast: improve low-contrast helper text ────────────── */
    /* Bumped from #888 to #666 for better contrast on white */
    .address-status { color: #666; }
    .address-status.geocoding { color: #666; }
    .suggestion-item-secondary { color: #666; }

    /* ── Progressive reveal sections ─────────────────────────── */
    .flow-section {
      max-height: 0;
      overflow: hidden;
      opacity: 0;
      /* No padding-top when hidden */
      transition: max-height .45s cubic-bezier(.4,0,.2,1),
                  opacity .35s ease,
                  padding-top .35s ease;
    }
    .flow-section.revealed {
      max-height: 1200px;   /* generous ceiling; content never approaches this */
      opacity: 1;
      padding-top: 4px;
      overflow: visible;    /* allow focus rings / dropdowns to bleed out */
    }
    /* Addresses section is always revealed — no animation needed */
    #section-addresses {
      max-height: none;
      opacity: 1;
      overflow: visible;
      padding-top: 0;
      transition: none;
    }
    .flow-section-divider {
      height: 1px;
      background: #f0f0f0;
      margin: 10px 0 6px;
    }
    /* ── Flow section headers ─────────────────────────────────── */
    .flow-section-header {
      font-size: 11px;
      font-weight: 600;
      color: #bbb;
      text-transform: uppercase;
      letter-spacing: .08em;
      margin-bottom: 8px;
    }

    /* ── Responsive ───────────────────────────────────────────── */
    @media (max-width: 600px) {
      .calculator-card { padding: 22px; }
      .request-form { padding: 20px; }
      .calculator-title { font-size: 22px; }
      .fare-value { font-size: 28px; }
      .composition-grid { grid-template-columns: 1fr; }
      .modal-actions { flex-direction: column; }
      .cancel-btn, .submit-btn { width: 100%; }
    }

/* ── Info box (So funktioniert's) ───────────────────────── */
.calc-info-box {
  background: #f0f7ff;
  border: 1px solid #c0d8f0;
  border-radius: 8px;
  padding: 14px 18px;
  margin: 0 0 20px 0;
}
.calc-info-title {
  font-weight: 600;
  font-size: 14px;
  color: #1a4a7a;
  margin-bottom: 6px;
}
.calc-info-body {
  font-size: 13px;
  color: #2a4a6a;
  line-height: 1.5;
}

/* ── Preferred contact method (Batch 2) ──────────────────────────── */
.contact-method-row {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.contact-method-option {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 14px;
  color: #333;
  padding: 8px 14px;
  border: 1.5px solid #e1e5e9;
  border-radius: 8px;
  transition: border-color .15s, background .15s;
  min-height: 44px;
}

.contact-method-option:has(input:checked) {
  border-color: #2aa6fb;
  background: #f0f9ff;
}

.contact-method-option input[type="radio"] {
  accent-color: #2aa6fb;
  width: 16px;
  height: 16px;
  cursor: pointer;
}
