/* ============================================================
   InduSLEEP Rechner – Falk Relaunch Layout

   Gemeinsame visuelle Ebene für die kompakte und die geführte
   Rechner-Variante. Berechnung und Interaktion bleiben in den
   jeweiligen Prototypen gekapselt.
   ============================================================ */

:root {
  --falk-blue: #006f9f;
  --falk-cyan: #00a0e3;
  --falk-blue-hover: #005f86;
  --soft-2: #eef3f8;
  --line-strong: #c6cdd8;
  --radius-lg: 16px;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas,
    "Liberation Mono", monospace;
  --max: 1200px;
  --shadow: 0 18px 48px rgba(17, 24, 39, 0.12);
}

body {
  padding: 0;
  background: var(--soft-2);
}

/* Eingebettet in die InduSLEEP-Landingpage bleibt nur der eigentliche
   Rechner sichtbar. Header, Produkteinleitung und Footer gehören dann
   bereits zur umgebenden Seite. */
html.is-embedded,
html.is-embedded body {
  min-height: 0;
  background: var(--soft-2);
}

html.is-embedded .module-header,
html.is-embedded .module-footer,
html.is-embedded .intro {
  display: none;
}

html.is-embedded .module-main {
  padding: 40px;
}

html.is-embedded .shell {
  width: 100%;
  max-width: none;
}

.shell {
  width: calc(100% - 40px);
  max-width: var(--max);
}

/* ---------- Reduzierter Modul-Header ---------- */

.module-header {
  border-bottom: 1px solid var(--line);
  background: var(--white);
}

.module-header__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  min-height: 80px;
  align-items: center;
}

.module-header__brand {
  display: inline-flex;
  width: fit-content;
  align-items: center;
}

.module-header__brand img {
  display: block;
  width: 178px;
  height: auto;
}

.module-header__product {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--falk-navy);
  white-space: nowrap;
}

.module-header__product span,
.module-header__product small {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.module-header__product span {
  color: var(--falk-blue);
}

.module-header__product strong {
  font-size: 0.92rem;
}

.module-header__product small {
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--soft-2);
}

.module-header__back {
  display: inline-flex;
  justify-self: end;
  align-items: center;
  gap: 8px;
  color: var(--falk-navy);
  font-size: 0.85rem;
  font-weight: 800;
  text-decoration: none;
}

.module-header__back span {
  color: var(--falk-blue);
  font-size: 1.1rem;
  transition: transform var(--ease);
}

.module-header__back:hover span {
  transform: translate(2px, -2px);
}

/* ---------- Bühne ---------- */

.module-main {
  padding: 40px 0 80px;
}

.intro {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(280px, 0.62fr);
  gap: 48px;
  max-width: none;
  margin-bottom: 40px;
  padding: 56px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  color: var(--white);
  background:
    linear-gradient(90deg, rgba(0, 160, 227, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(0, 160, 227, 0.08) 1px, transparent 1px),
    linear-gradient(135deg, #08142f 0%, var(--navy-deep) 58%, #162e69 100%);
  background-size: 56px 56px, 56px 56px, auto;
}

.intro::before,
.intro::after {
  position: absolute;
  width: 80px;
  height: 80px;
  content: "";
  pointer-events: none;
}

.intro::before {
  top: 24px;
  left: 24px;
  border-top: 2px solid var(--falk-cyan);
  border-left: 2px solid var(--falk-cyan);
}

.intro::after {
  right: 24px;
  bottom: 24px;
  border-right: 2px solid var(--falk-cyan);
  border-bottom: 2px solid var(--falk-cyan);
}

.intro__copy,
.intro__meta {
  position: relative;
  z-index: 1;
}

.intro .eyebrow {
  color: #8be0ff;
}

.intro h1 {
  max-width: 760px;
  margin-bottom: 20px;
  color: var(--white);
  font-size: clamp(2.6rem, 5vw, 4rem);
  letter-spacing: -0.025em;
}

.intro__copy > p:last-child {
  max-width: 760px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 1.1rem;
}

.intro__meta {
  display: grid;
  align-content: end;
  gap: 8px;
  padding: 28px 0 28px 32px;
  border-left: 2px solid var(--falk-cyan);
}

.intro__meta span {
  color: #8be0ff;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.intro__meta strong {
  color: var(--white);
  font-size: 1.9rem;
  line-height: 1.12;
}

.intro__meta small {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.92rem;
}

/* ---------- Eingabeabschnitte ---------- */

.card {
  margin-bottom: 24px;
  padding: 40px;
  border: 0;
  border-top: 3px solid var(--falk-navy);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: var(--white);
  box-shadow: none;
}

.card__head {
  max-width: 920px;
  margin-bottom: 32px;
}

.card__head h2 {
  margin-bottom: 12px;
  font-size: 1.9rem;
}

.card__head p {
  color: var(--muted);
  font-size: 1rem;
}

.step {
  display: inline-flex;
  width: auto;
  min-width: 32px;
  height: auto;
  align-items: flex-end;
  justify-content: flex-start;
  margin-right: 12px;
  padding-top: 4px;
  border-top: 2px solid var(--falk-blue);
  border-radius: 0;
  color: var(--falk-blue);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  vertical-align: 5px;
}

.grid {
  gap: 24px 32px;
}

.field {
  gap: 8px;
}

.field label {
  color: var(--falk-navy);
  font-size: 0.92rem;
}

.field input[type="text"],
.part-row input[type="text"] {
  min-height: 52px;
  border-color: var(--line);
  border-radius: 6px;
  background: var(--soft);
}

.field input[type="text"]:focus,
.part-row input[type="text"]:focus {
  border-color: var(--falk-blue);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(0, 111, 159, 0.22);
  outline: 2px solid var(--falk-blue);
  outline-offset: 2px;
}

.switch {
  margin-bottom: 24px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-2);
}

.switch label {
  border-radius: 6px;
}

.switch input:checked + label {
  color: var(--white);
  background: var(--falk-navy);
  box-shadow: none;
}

.link-btn {
  margin-top: 16px;
  border-color: rgba(34, 58, 142, 0.42);
  background: var(--soft);
}

.slider-box {
  margin-top: 32px;
  padding: 28px 32px;
  border: 0;
  border-left: 3px solid var(--falk-blue);
  border-radius: 0 8px 8px 0;
  background: var(--soft-2);
}

.slider-value {
  color: var(--falk-blue);
  font-size: 2.2rem;
}

.result-rows {
  margin-top: 32px;
  padding: 8px 24px;
  border: 0;
  border-radius: 8px;
  background: var(--soft);
}

.result-row {
  padding: 16px 0;
}

.result-row--total {
  padding: 20px 0;
  border-top: 2px solid var(--line-strong);
}

.result-row--total strong {
  color: var(--falk-blue);
  font-size: 1.9rem;
}

/* ---------- Ergebnis und Auswertung ---------- */

.hero-card {
  position: relative;
  margin: 32px 0 24px;
  padding: 48px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(90deg, rgba(0, 160, 227, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(0, 160, 227, 0.08) 1px, transparent 1px),
    linear-gradient(135deg, #08142f 0%, var(--falk-navy) 100%);
  background-size: 56px 56px, 56px 56px, auto;
  box-shadow: var(--shadow);
}

.hero-card::after {
  position: absolute;
  right: 24px;
  bottom: 24px;
  width: 64px;
  height: 64px;
  border-right: 2px solid var(--falk-cyan);
  border-bottom: 2px solid var(--falk-cyan);
  content: "";
}

.hero-card__item {
  position: relative;
  z-index: 1;
}

.hero-card__label {
  color: #8be0ff;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-card__value {
  font-size: clamp(2.2rem, 4.4vw, 3.2rem);
}

.pdf-bar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: center;
  margin-bottom: 32px;
  padding: 32px 36px;
  overflow: hidden;
  border: 1px solid #c8e2ed;
  border-left: 5px solid var(--falk-blue);
  border-radius: 0 12px 12px 0;
  background: linear-gradient(135deg, #e8f5fa 0%, #f8fbfd 72%);
  box-shadow: 0 12px 30px rgba(15, 30, 70, 0.09);
}

.pdf-bar::after {
  position: absolute;
  top: -50px;
  right: 210px;
  width: 150px;
  height: 150px;
  border: 1px solid rgba(0, 111, 159, 0.15);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.pdf-bar__copy {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.pdf-bar__eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--falk-blue);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.pdf-bar h3 {
  margin: 0 0 6px;
  color: var(--falk-navy);
  font-size: clamp(1.25rem, 2vw, 1.55rem);
}

.pdf-bar p {
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
}

.pdf-bar__button {
  position: relative;
  z-index: 1;
  min-height: 56px;
  padding: 15px 24px;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(0, 111, 159, 0.24);
}

.pdf-bar__button:hover {
  box-shadow: 0 10px 24px rgba(0, 95, 134, 0.3);
}

.chart-card {
  border-top-color: var(--falk-blue);
}

.chart-wrap {
  margin-top: 16px;
  padding: 16px;
  border-radius: 8px;
  background: var(--soft);
}

.note {
  margin: 24px 0 0;
  padding: 24px 28px;
  border-left-width: 3px;
  background: var(--white);
}

.cta {
  margin-top: 24px;
  padding: 40px;
  border: 0;
  border-radius: var(--radius-lg);
  color: var(--white);
  background: var(--navy-deep);
}

.cta h3 {
  color: var(--white);
  font-size: 1.2rem;
}

.cta p {
  color: rgba(255, 255, 255, 0.68);
}

.btn {
  min-height: 48px;
  padding: 12px 24px;
  border-radius: 6px;
  background: var(--falk-blue);
}

.btn:hover {
  background: var(--falk-blue-hover);
}

.btn--ghost {
  color: var(--falk-navy);
  border-color: var(--line-strong);
  background: var(--white);
}

.btn--ghost:hover {
  color: var(--falk-navy);
  border-color: var(--falk-navy);
  background: var(--soft-2);
}

/* ---------- Geführte Variante ---------- */

.stepper {
  margin: 0 0 24px;
  padding: 24px 32px;
  border-top: 3px solid var(--falk-blue);
  border-radius: 0 0 8px 8px;
  background: var(--white);
}

.stepper__dot {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.stepper__item:not(:first-child)::before {
  top: 17px;
}

.stepper__item.is-active .stepper__dot {
  border-color: var(--falk-navy);
  background: var(--falk-navy);
}

.stepper__item.is-done .stepper__dot {
  border-color: var(--falk-blue);
  background: var(--falk-blue);
}

.step-panel:not(.card) {
  padding: 40px;
  border-top: 3px solid var(--falk-blue);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: var(--white);
}

.wiz-nav {
  position: static;
  margin-top: 24px;
  padding: 16px;
  border: 0;
  border-top: 3px solid var(--falk-blue);
  border-radius: 0 0 8px 8px;
  background: var(--white);
}

.wiz-nav .btn[hidden] {
  display: none !important;
}

/* ---------- Abschluss ---------- */

.module-footer {
  padding: 32px 0;
  color: rgba(255, 255, 255, 0.62);
  background: #08142f;
}

.module-footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-size: 0.85rem;
}

@media (max-width: 860px) {
  html.is-embedded .module-main {
    padding: 28px;
  }

  .module-header__inner {
    grid-template-columns: 1fr auto;
  }

  .module-header__product {
    display: none;
  }

  .module-main {
    padding: 24px 0 64px;
  }

  .intro {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    padding: 40px 32px;
  }

  .intro h1 {
    font-size: 2.6rem;
  }

  .intro__meta {
    padding: 24px 0 0;
    border-top: 2px solid var(--falk-cyan);
    border-left: 0;
  }

  .card,
  .step-panel:not(.card) {
    padding: 32px 24px;
  }

  .card__head h2 {
    font-size: 1.9rem;
  }

  .hero-card {
    padding: 40px 32px;
  }

  .cta {
    padding: 32px;
  }
}

@media (max-width: 560px) {
  html.is-embedded .module-main {
    padding: 20px;
  }

  .shell {
    width: calc(100% - 32px);
  }

  .module-header__inner {
    min-height: 72px;
  }

  .module-header__brand img {
    width: 142px;
  }

  .module-header__back {
    font-size: 0.78rem;
  }

  .module-main {
    padding-top: 16px;
  }

  .intro {
    gap: 24px;
    margin-bottom: 24px;
    padding: 40px 24px;
    border-radius: 8px;
  }

  .intro::before,
  .intro::after {
    width: 48px;
    height: 48px;
  }

  .intro::before {
    top: 16px;
    left: 16px;
  }

  .intro::after {
    right: 16px;
    bottom: 16px;
  }

  .intro h1 {
    font-size: 2.2rem;
    overflow-wrap: break-word;
    hyphens: auto;
  }

  .intro__copy > p:last-child {
    font-size: 1rem;
  }

  .intro__meta strong {
    font-size: 1.2rem;
  }

  .card,
  .step-panel:not(.card) {
    margin-bottom: 16px;
    padding: 28px 20px;
    border-radius: 0 0 8px 8px;
  }

  .card__head {
    margin-bottom: 24px;
  }

  .card__head h2 {
    font-size: 1.45rem;
  }

  .switch {
    display: flex;
  }

  .switch label {
    flex: 1;
    padding: 9px 10px;
    text-align: center;
  }

  .slider-box {
    margin-top: 24px;
    padding: 24px 20px;
  }

  .result-rows {
    margin-top: 24px;
    padding: 4px 20px;
  }

  .result-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .result-row strong {
    white-space: normal;
  }

  .hero-card {
    margin-top: 24px;
    padding: 32px 24px;
    border-radius: 8px;
  }

  .pdf-bar,
  .note,
  .cta {
    padding: 24px 20px;
  }

  .pdf-bar {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    border-radius: 0 8px 8px 0;
  }

  .pdf-bar::after {
    top: auto;
    right: -40px;
    bottom: -70px;
  }

  .pdf-bar .btn {
    width: 100%;
  }

  .chart-wrap {
    margin-right: -8px;
    margin-left: -8px;
    padding: 8px;
  }

  .stepper {
    padding: 20px 16px;
  }

  .wiz-nav {
    gap: 8px;
    padding: 12px;
  }

  .wiz-nav .btn {
    padding: 10px 12px;
  }

  .wiz-progress {
    font-size: 0.78rem;
  }

  .module-footer__inner {
    flex-direction: column;
    gap: 8px;
  }
}

/* Die bestehenden Print- und PDF-Funktionen bleiben bewusst erhalten. */
@media print {
  body {
    padding: 0;
    background: var(--white);
  }

  .module-header,
  .module-footer {
    display: none !important;
  }

  .module-main {
    padding: 0;
  }

  .intro {
    display: none !important;
  }

  .card,
  .step-panel:not(.card) {
    margin-bottom: 16px;
    padding: 0 0 14px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: var(--white);
    box-shadow: none;
    break-inside: avoid;
  }

  .card__head {
    margin-bottom: 12px;
  }

  .card__head h2 {
    font-size: 12pt;
  }

  .step {
    display: inline-grid;
    width: 20px;
    min-width: 20px;
    height: 20px;
    place-items: center;
    margin-right: 10px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: var(--white);
    background: var(--falk-navy);
    font-family: inherit;
    font-size: 8pt;
    vertical-align: 2px;
  }

  .slider-box {
    margin-top: 14px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
  }

  .result-rows {
    margin-top: 14px;
    padding: 2px 14px;
    background: var(--white);
    border: 1px solid var(--line);
  }

  .result-row {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 7px 0;
  }

  .result-row--total {
    padding: 10px 0;
    border-top: 0;
  }

  .result-row--total strong {
    font-size: 12pt;
  }

  .hero-card {
    padding: 16px 20px;
    border: 2px solid var(--falk-navy);
    border-radius: var(--radius);
    background: var(--white) !important;
    box-shadow: none;
    break-inside: avoid;
  }

  .hero-card::after {
    display: none;
  }
}
