/* ===========================================================
   APEX SYSTEMS // RESPONSIVE CROSS-DEVICE SHELL
   - Mobile: 100% Native OS Homescreen
   - Desktop / Laptop (min-width: 1024px): Souveränes Dashboard / Stage
   - Reines CSS, keine externen Schriften, keine externen URLs
=========================================================== */

/* 1. GLOBALE DESIGN-TOKENS */
:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  --shell-width: 100%;
  --shell-max-mobile: 430px;
  --shell-max-desktop: 980px;

  --ink-primary: #0f1f38;
  --ink-secondary: #2d4363;
  --ink-muted: #536c8f;

  --accent-blue: #007aff;
  --accent-green: #34c759;
  --accent-orange: #ff9500;

  --os-bg-top: #e2ecf7;
  --os-bg-mid: #cbd9ea;
  --os-bg-bottom: #b4c7dc;

  --glass-surface: rgba(255, 255, 255, 0.72);
  --glass-inner: rgba(255, 255, 255, 0.84);
  --glass-border: rgba(255, 255, 255, 0.95);
  --glass-shadow: 0 12px 28px rgba(16, 36, 64, 0.08);

  --dock-surface: rgba(255, 255, 255, 0.8);
  --dock-border: rgba(255, 255, 255, 0.95);

  --radius-widget: 24px;
  --radius-card: 16px;
  --radius-btn: 14px;
}

/* 2. RESET & BASIS */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.bot-trap {
  display: none !important;
}

html, body {
  width: 100%;
  min-height: 100%;
  background: var(--os-bg-bottom);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  overflow-x: hidden;
}

/* 3. ROOT PAGE */
#apex-page {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 16px) + 8px) 16px calc(env(safe-area-inset-bottom, 12px) + 8px) 16px;
  background-color: var(--os-bg-mid);
  background-image:
    radial-gradient(circle at 85% 10%, rgba(255, 255, 255, 0.85) 0%, transparent 45%),
    radial-gradient(circle at 15% 40%, rgba(240, 246, 255, 0.65) 0%, transparent 40%),
    radial-gradient(circle at 85% 75%, rgba(185, 202, 220, 0.8) 0%, transparent 50%),
    linear-gradient(180deg, var(--os-bg-top) 0%, var(--os-bg-bottom) 100%);
}

#apex-light, #apex-page::before {
  display: none !important;
}

button, .action-btn, #lang-toggle, #status-bar {
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  cursor: pointer;
  pointer-events: auto;
}

/* 4. STATUSBAR */
#status-bar {
  width: 100%;
  max-width: var(--shell-max-mobile);
  margin: 0 auto var(--space-2);
  padding: 0 var(--space-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: none;
}

#status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px rgba(52, 199, 89, 0.8);
}

#status-text {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--ink-primary);
  text-align: center;
  line-height: 1.25;
  white-space: pre-line;
}

#lang-toggle {
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink-primary);
  font-size: 11px;
  font-weight: 700;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* BALLAST AUSBLENDEN */
#front-tag,
#front-foot,
#back-contacts,
#back-badge,
#back-foot,
#back-header,
.corner {
  display: none !important;
}

/* 5. MOBILE APP-CONTAINER */
#apex-card {
  width: 100%;
  max-width: var(--shell-max-mobile);
  margin: 0 auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-3);
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

#apex-card::before {
  display: none !important;
}

#card-scene,
#card-flipper {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  perspective: none;
  cursor: default;
  transform: none !important;
}

/* 6. HAUPT-WIDGET */
#card-front {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: 18px;
  border-radius: var(--radius-widget);
  border: 1px solid var(--glass-border);
  background: var(--glass-surface);
  backdrop-filter: blur(35px);
  -webkit-backdrop-filter: blur(35px);
  box-shadow: var(--glass-shadow);
}

#front-head {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

#front-title {
  width: 100%;
  margin: 0;
  text-align: center;
  color: var(--accent-orange);
  font-size: clamp(1.7rem, 6.7vw, 2.8rem);
  font-weight: 900;
  line-height: 0.86;
  letter-spacing: -0.05em;
  text-transform: uppercase;
}

#front-title.brand-title {
  text-shadow: 0 2px 0 rgba(255, 149, 0, 0.08);
}

#front-core {
  background: var(--glass-inner);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-card);
  padding: 12px 14px;
  text-align: center;
  width: 100%;
}

#front-core-title {
  color: var(--accent-blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.25;
}

#front-core-copy {
  margin-top: var(--space-1);
  color: var(--ink-secondary);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 500;
}

/* 7. SERVICES-GRID */
#card-back {
  display: block !important;
  width: 100%;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  transform: none !important;
}

#services-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
  list-style: none;
  width: 100%;
}

#services-list li {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  padding: 10px 6px;
  border-radius: var(--radius-card);
  border: 1px solid var(--glass-border);
  background: var(--glass-surface);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  box-shadow: var(--glass-shadow);
  min-height: 116px;
}

.service-title {
  width: 100%;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink-primary);
  line-height: 1.2;
  word-break: break-word;
  hyphens: auto;
  -webkit-hyphens: auto;
  margin-bottom: 4px;
}

.service-desc {
  font-size: 9.5px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--ink-secondary);
  word-break: normal;
}

/* 8. SUCH-PILL */
#card-hint {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: var(--space-1) auto;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 10px rgba(16, 36, 64, 0.06);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink-primary);
  text-align: center;
}

#card-hint::before {
  content: "🔍";
  font-size: 10px;
  opacity: 0.7;
}

/* 9. DOCK */
#action-bar {
  width: 100%;
  max-width: var(--shell-max-mobile);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  background: var(--dock-surface);
  border: 1px solid var(--dock-border);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border-radius: 24px;
  box-shadow: 0 12px 28px rgba(16, 36, 64, 0.12);
}

.action-btn {
  width: 100%;
  min-height: 56px;
  border-radius: var(--radius-btn);
  border: none;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  white-space: pre-line;
  word-break: normal;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.14);
  transition: transform 0.12s ease;
}

.action-btn:active {
  transform: scale(0.93);
}

#btn-intake {
  background: linear-gradient(180deg, #34c759 0%, #248a3d 100%);
  color: #ffffff;
  border-top: 1px solid rgba(255, 255, 255, 0.4);
}

#btn-map {
  background: linear-gradient(180deg, #007aff 0%, #0051a8 100%);
  color: #ffffff;
  border-top: 1px solid rgba(255, 255, 255, 0.4);
}

#btn-jobs {
  background: linear-gradient(180deg, #ff9500 0%, #d46300 100%);
  color: #ffffff;
  border-top: 1px solid rgba(255, 255, 255, 0.4);
}

/* 10. FOOTER */
#legal-footer {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-2) 0 var(--space-1);
  background: transparent;
  border: none;
}

#legal-footer a {
  color: var(--ink-muted);
  font-size: 11px;
  text-decoration: none;
  font-weight: 600;
}

#legal-footer a:hover {
  color: var(--ink-primary);
}

/* 11. BOTTOM SHEETS (Nativ verdeckt per Default) */
#jobs-panel,
#route-panel {
  position: fixed;
  inset: auto 0 0 0;
  max-height: 85dvh;
  border-radius: 28px 28px 0 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border-top: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 -16px 45px rgba(16, 36, 64, 0.18);
  z-index: 1000;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 20px calc(env(safe-area-inset-bottom, 16px) + 20px);
}

#jobs-panel[hidden],
#route-panel[hidden] {
  display: none !important;
}

#jobs-head::before,
#route-head::before {
  content: "";
  display: block;
  width: 36px;
  height: 4px;
  margin: 0 auto 12px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.18);
}

#jobs-head, #route-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  margin-bottom: 12px;
}

#jobs-title, #route-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-primary);
}

#jobs-close, #route-close {
  min-height: 30px;
  padding: 4px 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.04);
  color: var(--ink-primary);
  font-size: 11px;
  font-weight: 600;
}

#route-frame {
  display: block;
  width: 100%;
  height: 340px;
  border: 0;
  border-radius: 16px;
}

#jobs-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--ink-secondary);
}

.jobs-headline {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink-primary);
}

.jobs-headline em {
  font-style: normal;
  color: var(--accent-orange);
}

.jobs-lead {
  font-size: 13.5px;
  line-height: 1.45;
}

.jobs-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.jobs-list li {
  position: relative;
  padding-left: 16px;
  font-size: 13px;
  line-height: 1.4;
}

.jobs-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent-blue);
  font-size: 16px;
  line-height: 1;
}

.jobs-badge {
  padding: 8px 10px;
  border-left: 3px solid var(--accent-blue);
  background: rgba(0, 122, 255, 0.06);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-primary);
}

.jobs-rule {
  padding: 8px 12px;
  border: 1px dashed rgba(0, 122, 255, 0.3);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.4;
}

.jobs-rule b {
  color: var(--accent-blue);
}

#jobs-mail {
  background: var(--ink-primary);
  color: #ffffff;
  width: 100%;
  min-height: 46px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 700;
}


/* ===========================================================
   12. MEDIA QUERIES (DESKTOP & LAPTOP ARCHITEKTUR)
=========================================================== */

/* A. TABLET & LAPTOP AB 768px */
@media screen and (min-width: 768px) {
  #apex-page {
    padding: 32px 24px;
    align-items: center;
  }

  #status-bar {
    max-width: 520px;
  }

  #apex-card {
    max-width: 520px;
  }

  #action-bar {
    max-width: 520px;
  }
}

/* B. LAPTOP & GROSSBILDSCHIRME AB 1024px */
/* Beendet das "mickrige" Aussehen: Saubere, präsente Device-Stage */
@media screen and (min-width: 1024px) {
  #apex-page {
    padding: 48px 32px;
    justify-content: center;
    gap: 20px;
  }

  /* Der Screen wird zu einer zentrierten, plastischen Tablet-/OS-Stage */
  #apex-card {
    max-width: 680px;
    gap: 20px;
  }

  #card-front {
    padding: 24px 32px;
  }

  .apex-brand-logo {
    max-height: 72px;
  }

  #front-core-title {
    font-size: 14px;
  }

  #front-core-copy {
    font-size: 15px;
  }

  #services-list {
    gap: 16px;
  }

  #services-list li {
    padding: 16px 12px;
    min-height: 130px;
  }

  .service-title {
    font-size: 12px;
  }

  .service-desc {
    font-size: 11px;
    line-height: 1.4;
  }

  #action-bar {
    max-width: 680px;
    padding: 12px 18px;
    gap: 14px;
  }

  .action-btn {
    min-height: 60px;
    font-size: 11.5px;
  }

  #status-bar {
    max-width: 680px;
  }

  #status-text {
    font-size: 13px;
  }

  /* Auf Desktop wird das Bottom-Sheet zu einem echten zentrierten Modal */
  #jobs-panel,
  #route-panel {
    inset: auto auto auto auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 640px;
    max-height: 80vh;
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
    padding: 24px 28px;
  }

  #jobs-head::before,
  #route-head::before {
    display: none;
  }
}

/* C. NATIVE DARK-MODE */
@media (prefers-color-scheme: dark) {
  :root {
    --os-bg-top: #152238;
    --os-bg-mid: #0e1726;
    --os-bg-bottom: #080d17;
    --ink-primary: #ffffff;
    --ink-secondary: #c5d4eb;
    --ink-muted: #8ba3c7;
    --glass-surface: rgba(255, 255, 255, 0.09);
    --glass-dock: rgba(20, 30, 48, 0.85);
    --glass-border: rgba(255, 255, 255, 0.14);
  }

  #front-core {
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.08);
  }

  #jobs-panel, #route-panel {
    background: rgba(15, 23, 38, 0.96);
    border-color: rgba(255, 255, 255, 0.15);
  }

  #route-consent {
    background: rgba(255, 255, 255, 0.06);
  }
}

/* ===========================================================
   13. ÜBER DIE ARBEIT (direkt unter den Kacheln, ohne Klick)
=========================================================== */
#about-block {
  width: 100%;
  max-width: var(--shell-max-mobile);
  margin: 0 auto;
  padding: 18px;
  border-radius: var(--radius-widget);
  border: 1px solid var(--glass-border);
  background: var(--glass-surface);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  box-shadow: var(--glass-shadow);
}

#about-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.about-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.about-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-blue);
}

.about-text {
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink-secondary);
}

.about-bewusst {
  padding: 8px 10px;
  border-left: 3px solid var(--accent-orange);
  background: rgba(255, 149, 0, 0.07);
  border-radius: 0 10px 10px 0;
}

.about-bewusst b {
  color: var(--ink-primary);
}

.about-list {
  list-style: none;
  counter-reset: grund;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.about-list li {
  counter-increment: grund;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--glass-inner);
  border: 1px solid var(--glass-border);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-primary);
}

.about-list li::before {
  content: counter(grund);
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
  background: var(--accent-blue);
}

/* Karten-Einwilligung: Google Maps lädt erst nach Klick */
#route-frame[hidden],
#route-consent[hidden] {
  display: none !important;
}

#route-consent {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: 16px;
  border-radius: 16px;
  background: rgba(0, 122, 255, 0.06);
  color: var(--ink-secondary);
  font-size: 13px;
  line-height: 1.45;
}

#route-load {
  background: linear-gradient(180deg, #007aff 0%, #0051a8 100%);
  color: #ffffff;
  min-height: 46px;
  font-size: 12px;
}

#route-external {
  color: var(--accent-blue);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

@media screen and (min-width: 768px) {
  #about-block { max-width: 520px; }
}

@media screen and (min-width: 1024px) {
  #about-block { max-width: 680px; padding: 24px 32px; }
  .about-text { font-size: 15px; }
  .about-title { font-size: 13px; }
  .about-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (prefers-color-scheme: dark) {
  .about-list li { background: rgba(0, 0, 0, 0.25); }
}

/* ===========================================================
   14. SPRACHUMSCHALTER ALS LINK (statisch gebaut)
=========================================================== */
a#lang-toggle {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

/* ===========================================================
   15. RECHTSSEITEN (Impressum, Datenschutz, AGB)
=========================================================== */
#legal-panel {
  width: 100%;
  padding: 20px 18px;
  border-radius: var(--radius-widget);
  border: 1px solid var(--glass-border);
  background: var(--glass-surface);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  box-shadow: var(--glass-shadow);
  color: var(--ink-secondary);
}

#legal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

#legal-title {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--ink-primary);
}

#legal-close {
  flex: none;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink-primary);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

#legal-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  font-size: 13.5px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

#legal-body h2 {
  margin-top: var(--space-3);
  font-size: 14px;
  font-weight: 800;
  color: var(--ink-primary);
}

#legal-body h3 {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-blue);
}

#legal-body ul {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#legal-body a {
  color: var(--accent-blue);
}

#legal-body strong {
  color: var(--ink-primary);
}

.legal-badge-box {
  padding: 10px 12px;
  border-left: 3px solid var(--accent-blue);
  border-radius: 0 10px 10px 0;
  background: rgba(0, 122, 255, 0.06);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-primary);
}

@media screen and (min-width: 1024px) {
  #legal-panel { padding: 28px 36px; }
  #legal-body { font-size: 15px; }
}

@media (prefers-color-scheme: dark) {
  #legal-close { background: rgba(255, 255, 255, 0.08); }
  #legal-head { border-bottom-color: rgba(255, 255, 255, 0.1); }
}