/* ============================================================
   Digitalsignal — Responsive-Schicht (lädt nach styles.css)
   Mobile-first Korrekturen für Handy (≤560px), Tablet (561–900px)
   und Desktop (>900px). Desktop-Layout bleibt unverändert.
   ============================================================ */

/* ---------- Grundlagen ---------- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overflow-x: hidden; }
img, svg, video, iframe { max-width: 100%; height: auto; }
table { display: block; max-width: 100%; overflow-x: auto; }
p, li, h1, h2, h3, h4, a { overflow-wrap: break-word; word-wrap: break-word; }
a, button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
input, select, textarea { font-size: 16px; } /* verhindert Auto-Zoom auf iOS */
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 4px; }

.wrap { padding-left: 24px; padding-right: 24px; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--forest); color: #fff; padding: 10px 16px; z-index: 999; }
.skip-link:focus { left: 16px; top: 12px; }

/* ---------- Topbar & Navigation ---------- */
.topbar { font-size: 11px; letter-spacing: .05em; line-height: 1.45; padding: 9px 16px; }
.nav-inner { padding: 12px 16px; gap: 12px; }
.logo { font-size: 22px; letter-spacing: -.01em; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.logo svg { width: 26px; height: 26px; flex-shrink: 0; }
.burger { min-width: 44px; min-height: 44px; display: none; align-items: center; justify-content: center; font-size: 24px; cursor: pointer; }
@media (max-width: 820px) {
  .burger { display: inline-flex; }
  .nav-links { top: 0; /* nach header-Höhe via JS nicht nötig */ }
  .nav-links a { min-height: 48px; display: flex; align-items: center; font-size: 16px; border-bottom: 1px solid var(--line); }
  .nav-links a.nav-cta { justify-content: center; border-bottom: 0; margin-top: 8px; min-height: 52px; }
}

/* ---------- Typografie ---------- */
h1 { font-size: clamp(30px, 7.5vw, 56px); line-height: 1.12; }
h2 { font-size: clamp(24px, 5.5vw, 40px); line-height: 1.18; }
h3 { line-height: 1.25; }
.lead, .hero .lead { font-size: clamp(15px, 3.8vw, 18px); line-height: 1.6; }
.eyebrow { font-size: 11px; letter-spacing: .12em; }

/* ---------- Buttons & Touch ---------- */
.btn, .btn-primary, .btn-ghost, .btn-next, .btn-back, .btn-prod, .btn-plan, .nav-cta {
  min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
  max-width: 100%; text-align: center; white-space: normal; line-height: 1.25;
}
.btn-row, .hero-buttons { gap: 12px; }

/* ---------- Tablet & Handy: Raster ---------- */
@media (max-width: 900px) {
  .wrap { padding-left: 20px; padding-right: 20px; }
  .hero, .hero-grid { gap: 32px; }
  .section, section { padding-top: clamp(48px, 9vw, 80px); padding-bottom: clamp(48px, 9vw, 80px); }
  .steps { grid-template-columns: 1fr 1fr; gap: 16px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 28px 16px; }
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 32px 20px; }
  /* Inline-Raster (z. B. Launch-Bereich, Anwendungs-Zeilen) auf Tablet/Handy einspaltig */
  [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  [style*="direction:rtl"] { direction: ltr !important; }
}

@media (max-width: 640px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .grid-3, .grid-2, .glossar-grid, .co-layout { grid-template-columns: 1fr !important; gap: 16px; }
  .steps { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .hero { padding-top: 40px; }
  .hero-buttons, .btn-row { flex-direction: column; align-items: stretch; }
  .hero-buttons .btn, .btn-row .btn, .btn-row a { width: 100%; }
  .card, .plan-card, .prod-card, .testi { padding: 22px 20px; }
  .prod-card { border-radius: 16px; }
  .price-row { flex-wrap: wrap; gap: 6px; }
  .foot-grid { grid-template-columns: 1fr; gap: 28px; }
  .foot-copy { flex-direction: column; gap: 8px; text-align: center; }
  .foot-copy span { font-size: 12px; }
  footer { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .legal, .legal h2 { font-size: inherit; }
  .legal h2 { font-size: 20px; margin-top: 30px; }
  .legal .box { padding: 18px; }
  .crumbs { font-size: 13px; flex-wrap: wrap; }
  .modal { width: min(94vw, 620px); max-height: 86vh; overflow: auto; }
  .modal-body { padding: 18px; }
}

/* ---------- Checkout (Handy) ---------- */
@media (max-width: 880px) {
  [style*="position:sticky"], .co-side, .co-summary { position: static !important; }
}
@media (max-width: 640px) {
  .co-step .form-group, .co-step input, .co-step select { width: 100%; }
  .co-step [style*="display:flex"] { flex-direction: column !important; gap: 0 !important; }
  .co-step [style*="display:flex"] > .form-group { width: 100%; flex: none !important; }
  .co-actions { flex-direction: column-reverse; gap: 10px; }
  .co-actions .btn-next, .co-actions .btn-back { width: 100%; }
  .co-steps, .step-dots { flex-wrap: wrap; gap: 6px; }
}

/* ---------- Glossar & Ratgeber (Handy) ---------- */
@media (max-width: 640px) {
  details summary { min-height: 44px; display: flex; align-items: center; }
  .faq-item, details { padding: 14px 16px; }
  .glossar-grid a, .ratgeber-grid a { display: block; }
}

/* ---------- Kleine Handys (≤380px) ---------- */
@media (max-width: 380px) {
  .topbar { font-size: 10px; }
  .wrap { padding-left: 14px; padding-right: 14px; }
  .stats { grid-template-columns: 1fr; }
  .logo { font-size: 19px; }
  .btn { font-size: 15px; padding-left: 14px; padding-right: 14px; }
}

/* ---------- Ergänzungen: Hero, Fixbreiten, Inline-Container ---------- */
@media (max-width: 900px) {
  .hero { min-height: auto; }
  .hero-glow { width: 520px; height: 520px; }
  .hero-glow.b { display: none; }
  [style*="width:220px"], [style*="width:120px"], [style*="width:300px"] { max-width: 100% !important; }
}
@media (max-width: 380px) {
  .hero-badges { font-size: 12px; gap: 10px; }
  h1 { font-size: 28px; }
  .card, .plan-card, .prod-card { padding: 20px 16px; }
}
@media (max-width: 640px) {
  [style*="max-width:760px"], [style*="max-width:780px"], [style*="max-width:820px"], [style*="max-width:860px"] { max-width: 100% !important; }
  [style*="width:760px"], [style*="width:780px"], [style*="width:820px"], [style*="width:860px"] { width: 100% !important; }
}

/* ---------- Überschriften-Hierarchie: Stil bleibt nach Korrektur ---------- */
.foot-grid .foot-h { font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; margin: 0 0 16px; color: #fff; line-height: 1.3; }
.card h2 { font-size: 21px; font-weight: 700; margin: 18px 0 10px; color: var(--forest); line-height: 1.25; }

/* ---------- Bewegung reduzieren ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal, .reveal-scale { opacity: 1 !important; transform: none !important; }
}
