/* ==========================================================================
   DERMA-FORTE® – Landingpage
   Umsetzung nach Figma „261009_FARCO_DermaForte_Webflyer“
   Breakpoints: Mobil < 600px · Tablet 600–1023px · Desktop ≥ 1024px
   ========================================================================== */

/* ---------- Schriften (lokal gehostet, kein Google-CDN) ---------- */
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("../fonts/barlow-400.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 500;
  font-display: block;
  src: url("../fonts/barlow-500.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 600;
  font-display: block;
  src: url("../fonts/barlow-600.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("../fonts/barlow-condensed-400.woff2") format("woff2");
}

/* ---------- Design-Tokens aus Figma ---------- */
:root {
  --farco-blau: #253746;
  --df-text-primary: #152a43;
  --df-surface: #ffffff;
  --badge-orange: #f57f45;

  --font-sans: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --font-condensed: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;

  --footer-h: 120px;
}

/* ---------- Basis ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: #fff;
  color: var(--df-text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--badge-orange);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
}

/* ==========================================================================
   Hero – Mobil (Basis, Figma-Frame 390 × 844)
   ========================================================================== */
.hero {
  position: relative;
  flex: 1 0 auto;
  overflow: hidden;
  isolation: isolate;
}

.hero__panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 18px;
  min-height: 350px;
  padding: 30px 24px 28px;
  background: var(--farco-blau);
  color: #fff;
}

.hero__title {
  margin: 0;
  font-family: var(--font-condensed);
  font-weight: 400;
  font-size: 52px;
  line-height: 0.98;
  letter-spacing: 0;
}

.hero__title span {
  display: block;
}

.hero__title sup {
  font-size: 0.62em;
  line-height: 0;
  vertical-align: 0.62em;
}

.hero__text {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
}

.hero__text span {
  display: block;
}

/* Button „Jetzt Muster anfordern →“ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 18px;
  border-radius: 10px;
  background: var(--df-surface);
  color: var(--farco-blau);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 20px;
  line-height: 19px;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.btn__arrow {
  width: 1em;
  height: 1em;
  flex: none;
  transition: transform 0.2s ease;
}

.btn:hover {
  background: #eef2f5;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.btn:hover .btn__arrow,
.btn:focus-visible .btn__arrow {
  transform: translateX(4px);
}

/* Produktkomposition: alle Positionen in % der Figma-Bühne */
.hero__visual {
  position: relative;
  z-index: 2;
  /* Bühne 390 × 452 (y 284 → 736 im Figma-Frame) */
  aspect-ratio: 390 / 452;
  margin-top: -16.923%; /* −66 / 390: überlappt den dunklen Bereich */
  container-type: inline-size;
}

/* dunkle Fläche, die hinter das Produkt reicht: beginnt an der Panel-Unterkante
   (Überlappung 66 / 452) und endet bei y 478 */
.hero__visual::before {
  content: "";
  position: absolute;
  top: 14.602%;    /* 66 / 452 */
  left: 0;
  right: 0;
  height: 28.319%; /* (478 − 350) / 452 */
  background: var(--farco-blau);
  border-bottom-right-radius: 36px;
}

.hero__img {
  position: absolute;
  height: auto;
  max-width: none;
  pointer-events: none;
  user-select: none;
}

.hero__img--flasche {
  left: -13.846%;  /* −54 / 390 */
  top: 13.274%;    /* 60 / 452 */
  width: 119.487%; /* 466 / 390 */
  aspect-ratio: 760 / 652;
}

.hero__img--verpackung {
  left: 24.872%;   /* 97 / 390 */
  top: 0;
  width: 95.128%;  /* 371 / 390 */
  aspect-ratio: 605 / 813;
}

.badge {
  position: absolute;
  left: 65.641%;   /* 256 / 390 */
  top: 51.77%;     /* 234 / 452 */
  width: 31.795%;  /* 124 / 390 */
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  background: url("../img/badge-ellipse.svg") center / 100% 100% no-repeat;
  color: #fff;
  font-weight: 600;
  font-size: 6.154cqw; /* 24 / 390 */
  line-height: 1.25;
  text-align: center;
}

.footnote {
  margin: 0;
  color: var(--farco-blau);
  font-size: 10px;
  line-height: 14px;
}

.footnote strong {
  display: block;
  font-weight: 600;
}

/* auf Mobil steht die Fußnote im Footer */
.footnote--hero {
  display: none;
}

/* Intro-Animation: Produkt fährt von rechts ein, danach blendet der Badge ein.
   Ohne JavaScript oder bei „Bewegung reduzieren“ bleibt alles statisch sichtbar. */
@media (prefers-reduced-motion: no-preference) {
  .js .hero__img,
  .js .hero .badge,
  .js .hero .footnote--hero,
  .js .hero + .site-footer .footnote--footer {
    opacity: 0;
  }

  /* Fußnote zur Studie nach dem Badge (Mobil steht sie im Footer) */
  .hero.is-ready .footnote--hero,
  .hero.is-ready + .site-footer .footnote--footer {
    animation: fade-in 0.6s ease-out 1.7s both;
  }

  .hero.is-ready .hero__img {
    animation: hero-slide-in 1.4s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  /* Reihenfolge: Flasche → Verpackung (+0,5 s) → Badge (+0,5 s) */
  .hero.is-ready .hero__img--verpackung {
    animation-delay: 0.5s;
  }

  /* Badge blendet ein und pulsiert ab demselben Moment durchgehend (keine Pause).
     Eigene GPU-Ebene: Text wird einmal gerastert und als Ganzes skaliert,
     statt pro Frame neu am Pixelraster ausgerichtet zu werden (kein Flimmern). */
  .hero.is-ready .badge {
    animation:
      fade-in 0.7s ease-out 1s both,
      badge-pulse 3s ease-in-out 1s infinite;
    will-change: transform, opacity;
    backface-visibility: hidden;
  }
}

@keyframes hero-slide-in {
  from {
    opacity: 0;
    transform: translateX(48px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes badge-pulse {
  0%,
  100% {
    transform: translateZ(0) scale(1);
  }
  50% {
    transform: translateZ(0) scale(1.05);
  }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  min-height: 108px;
  padding: 12px 24px;
  background: #fff;
}

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

.footnote--footer {
  max-width: 169px;
}

.logo {
  position: relative;
  display: block;
  flex: none;
  width: 110px;
  aspect-ratio: 180 / 51.861;
}

.logo img {
  position: absolute;
  top: 0.1%;
  height: 99.79%;
}

.logo__bildmarke {
  left: 0.01%;
  width: 28.76%;
}

.logo__textmarke {
  left: 36.49%;
  width: 63.5%;
}

.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-nav a {
  color: var(--df-text-primary);
  font-weight: 500;
  font-size: 14px;
  line-height: 25px;
  text-decoration: none;
  white-space: nowrap;
}

.footer-nav a:hover,
.footer-nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ==========================================================================
   Tablet (Figma-Frame 768 × 1024)
   ========================================================================== */
@media (min-width: 600px) {
  .hero__panel {
    gap: 24px;
    min-height: 360px;
    padding: 40px 48px;
  }

  .hero__title {
    font-size: clamp(56px, 8.854vw, 68px);
  }

  .hero__text {
    font-size: 22px;
  }

  .hero__visual {
    /* Bühne 768 × 746 (y 174 → 920) */
    aspect-ratio: 768 / 746;
    margin-top: -24.219%; /* −186 / 768 */
  }

  .hero__visual::before {
    top: 24.933%;    /* 186 / 746 */
    height: 24.129%; /* (540 − 360) / 746 */
    border-bottom-right-radius: 48px;
  }

  .hero__img--flasche {
    left: -6.38%;    /* −49 / 768 */
    top: 13.003%;    /* 97 / 746 */
    width: 98.958%;  /* 760 / 768 */
  }

  .hero__img--verpackung {
    left: 29.948%;   /* 230 / 768 */
    top: 0;
    width: 78.776%;  /* 605 / 768 */
  }

  .badge {
    left: 74.479%;   /* 572 / 768 */
    top: 13.941%;    /* 104 / 746 */
    width: 19.792%;  /* 152 / 768 */
    font-size: 3.646cqw; /* 28 / 768 */
    line-height: 1.214;
  }

  .footnote--hero {
    display: block;
    position: absolute;
    right: 4.167%;   /* 768 − (486 + 250) = 32 → 32 / 768 */
    bottom: 4px;
    width: 250px;
    max-width: calc(100% - 48px);
  }

  .footnote--footer {
    display: none;
  }

  .site-footer {
    padding: 20px 48px;
  }

  .logo {
    width: 150px;
  }

  .footer-nav a {
    font-size: 16px;
  }
}

/* Footer einzeilig ab Tablet-Breite 768px (Figma-Frame Tablet) */
@media (min-width: 768px) {
  .site-footer {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    min-height: 104px;
    padding: 24px 48px;
  }

  .footer-nav ul {
    justify-content: flex-end;
    gap: 4px 24px;
  }
}

/* ==========================================================================
   Desktop (Figma-Frame 1440 × 900, Version 1)
   ========================================================================== */
@media (min-width: 1024px) {
  .hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: max(600px, calc(100svh - var(--footer-h)));
  }

  .hero__panel {
    min-height: 0;
    gap: 24px;
    padding: 40px clamp(48px, 5.556vw, 80px);
    border-radius: 0 48px 48px 0;
  }

  .hero__title {
    font-size: clamp(60px, 6.111vw, 88px);
  }

  .hero__text {
    font-size: clamp(20px, 1.667vw, 24px);
  }

  .hero__visual {
    aspect-ratio: auto;
    margin-top: 0;
    container-type: size;
  }

  .hero__visual::before {
    content: none;
  }

  /* Bühne 720 × 780 – passt sich der verfügbaren Höhe an */
  .hero__stage {
    position: absolute;
    left: 0;
    top: 50%;
    width: min(100cqw, 100cqh * 720 / 780);
    aspect-ratio: 720 / 780;
    transform: translateY(-50%);
    container-type: inline-size;
  }

  .hero__img--flasche {
    left: -30.417%;  /* (501 − 720) / 720 */
    top: 8.077%;     /* 63 / 780 */
    width: 105.556%; /* 760 / 720 */
  }

  .hero__img--verpackung {
    left: 8.333%;    /* 60 / 720 */
    top: -4.487%;    /* −35 / 780 */
    width: 84.028%;  /* 605 / 720 */
  }

  .badge {
    left: 55.833%;   /* 402 / 720 */
    top: 20.385%;    /* 159 / 780 */
    width: 21.111%;  /* 152 / 720 */
    font-size: 3.889cqw; /* 28 / 720 */
  }

  .footnote--hero {
    right: 7.917%;   /* 720 − (413 + 250) = 57 → 57 / 720 */
    bottom: 2px;
  }

  .site-footer {
    min-height: var(--footer-h);
    padding: 24px clamp(48px, 5.556vw, 80px);
  }

  .logo {
    width: 180px;
  }
}

/* Unterhalb Desktop ist die Bühne nur ein Durchreicher */
@media (max-width: 1023.98px) {
  .hero__stage {
    position: absolute;
    inset: 0;
  }
}

/* ==========================================================================
   Einwilligung Webanalyse (Consent)
   Basis: schlanke Leiste am unteren Bildschirmrand.
   Ab 1340px sitzt sie in der freien Mitte der Footer-Leiste (gleiche Höhe).
   ========================================================================== */
.footer-nav__btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--df-text-primary);
  font: 500 14px/25px var(--font-sans);
  white-space: nowrap;
  cursor: pointer;
}

.footer-nav__btn:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ohne JavaScript bzw. bei offenem Banner nicht nötig */
html:not(.js) .nav-consent,
.consent-open .nav-consent {
  display: none;
}

.consent {
  position: fixed;
  z-index: 50;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 24px calc(16px + env(safe-area-inset-bottom, 0px));
  background: #eef2f5;
  box-shadow: 0 -6px 24px rgba(21, 42, 67, 0.12);
  color: var(--df-text-primary);
}

.consent[hidden] {
  display: none;
}

.consent__text {
  margin: 0;
  font-size: 13px;
  line-height: 18px;
}

.consent__text strong {
  font-weight: 600;
}

.consent__text a {
  color: var(--farco-blau);
  text-underline-offset: 2px;
}

.consent__actions {
  display: flex;
  gap: 8px;
  flex: none;
}

/* beide Optionen gleichwertig gestaltet */
.consent__btn {
  flex: 1 1 0;
  min-width: 112px;
  padding: 10px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--farco-blau);
  color: #fff;
  font: 600 15px/20px var(--font-sans);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.consent__btn:hover {
  background: var(--df-text-primary);
}

/* Inhalt bleibt oberhalb der Leiste vollständig erreichbar */
.consent-open body {
  padding-bottom: var(--consent-h, 0px);
}

@media (min-width: 600px) {
  .consent {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding-inline: 48px;
  }

  .consent__text {
    max-width: 640px;
  }

  .footer-nav__btn {
    font-size: 16px;
  }
}

@media (min-width: 1340px) {
  .site-footer {
    gap: 32px;
  }

  .footer-nav {
    flex: none;
  }

  .footer-nav ul {
    flex-wrap: nowrap;
  }

  .consent {
    position: static;
    flex: 1 1 0;
    min-width: 0;
    align-self: stretch;
    margin-block: -24px;
    padding: 12px 24px;
    box-shadow: none;
  }

  .consent__text {
    max-width: 420px;
  }

  /* Buttons übereinander, damit die Leiste 120px hoch bleibt */
  .consent__actions {
    flex-direction: column;
    width: 128px;
  }

  .consent__btn {
    flex: none;
    padding-block: 8px;
  }

  .consent-open body {
    padding-bottom: 0;
  }

  /* Footer-Leiste bleibt sichtbar, solange die Entscheidung aussteht */
  .consent-open .site-footer {
    position: sticky;
    bottom: 0;
    z-index: 50;
  }

  .consent-open .legal + .site-footer {
    box-shadow: 0 -6px 24px rgba(21, 42, 67, 0.08);
  }
}

/* ==========================================================================
   Rechtstexte (Impressum, Datenschutz)
   ========================================================================== */
.legal-header {
  background: var(--farco-blau);
  color: #fff;
  border-bottom-right-radius: 36px;
}

.legal-header__inner,
.legal {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding-inline: 24px;
}

.legal-header__inner {
  padding-block: 28px 40px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-weight: 500;
  font-size: 16px;
  text-decoration: none;
  opacity: 0.85;
}

.back-link:hover {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.back-link svg {
  width: 1em;
  height: 1em;
}

.legal-header h1 {
  margin: 24px 0 0;
  font-family: var(--font-condensed);
  font-weight: 400;
  font-size: clamp(44px, 7vw, 72px);
  line-height: 0.98;
}

.legal {
  flex: 1 0 auto;
  padding-block: 40px 64px;
  color: var(--df-text-primary);
  font-size: 17px;
  line-height: 1.6;
}

.legal h2 {
  margin: 2.2em 0 0.6em;
  color: var(--farco-blau);
  font-weight: 600;
  font-size: 24px;
  line-height: 1.25;
}

.legal h3 {
  margin: 1.8em 0 0.4em;
  color: var(--farco-blau);
  font-weight: 600;
  font-size: 19px;
  line-height: 1.3;
}

.legal h4 {
  margin: 1.4em 0 0.3em;
  font-weight: 600;
  font-size: 17px;
}

.legal > :first-child {
  margin-top: 0;
}

.legal p,
.legal ul,
.legal ol,
.legal address {
  margin: 0 0 1em;
}

.legal address {
  font-style: normal;
}

.legal ul,
.legal ol {
  padding-left: 1.3em;
}

.legal li + li {
  margin-top: 0.25em;
}

.legal a {
  color: var(--farco-blau);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.legal dl {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 32px;
  margin: 0 0 1em;
}

.legal dt {
  margin-top: 1em;
  font-weight: 600;
}

.legal dd {
  margin: 0;
}

.legal .meta {
  margin-top: 3em;
  color: #5b6875;
  font-size: 15px;
}

@media (min-width: 600px) {
  .legal-header {
    border-bottom-right-radius: 48px;
  }

  .legal-header__inner,
  .legal {
    padding-inline: 48px;
  }

  .legal-header__inner {
    padding-block: 36px 56px;
  }

  .legal dl {
    grid-template-columns: max-content 1fr;
  }

  .legal dt {
    margin-top: 0.75em;
  }

  .legal dd {
    margin-top: 0.75em;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

/* Text-Link als Button (Widerruf in der Datenschutzerklärung) */
.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--farco-blau);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
