/* =========================================================================
   Head & Shoulders – Video Landingpage
   Mobile-first, Portrait. Optimiert für 360–430px Breite.
   ========================================================================= */

:root {
  /* Branding */
  --hs-blue: #0046BE;          /* Primärfarbe – am H&S-CI orientiert */
  --hs-blue-dark: #003494;     /* Active/Press-State */
  --hs-blue-tint: #e8eefc;     /* sehr helles Blau für Flächen */

  --bg: #ffffff;
  --bg-soft: #f5f6f8;
  --text: #1a1d24;
  --text-muted: #5b6170;
  --border: #d7dbe3;

  --live-red: #e3001b;

  /* Maße */
  --radius-video: 22px;
  --radius-btn: 16px;
  --tap-target: 52px;           /* > 44px Touch-Target */
  --page-pad: 20px;
  --maxw: 460px;

  --shadow-video: 0 12px 30px rgba(0, 30, 90, 0.18);
  --shadow-btn: 0 4px 14px rgba(0, 70, 190, 0.28);
}

* { box-sizing: border-box; }

/* Das HTML-Attribut [hidden] muss display-Regeln (flex/grid) sicher schlagen. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- Seiten-Layout: vertikal, zentriert, mit sicheren Rändern ---- */
.page {
  min-height: 100svh;
  max-width: var(--maxw);
  margin: 0 auto;
  padding:
    calc(env(safe-area-inset-top, 0px) + 24px)
    var(--page-pad)
    calc(env(safe-area-inset-bottom, 0px) + 24px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

/* ---- Logo ---- */
.brand {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 6px 0 2px;
}
.brand__logo {
  display: block;
  width: auto;
  height: 54px;
  max-width: 70%;
}

/* ---- Video ---- */
.video {
  width: 100%;
}
.video__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;          /* Hochformat */
  border-radius: var(--radius-video);
  overflow: hidden;
  background: #0a0c12;
  box-shadow: var(--shadow-video);
}
.video__el {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #0a0c12;
}

/* LIVE-Badge */
.badge-live {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  backdrop-filter: blur(2px);
}
.badge-live__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live-red);
  box-shadow: 0 0 0 0 rgba(227, 0, 27, 0.6);
  animation: pulse 1.6s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(227, 0, 27, 0.6); }
  70%  { box-shadow: 0 0 0 7px rgba(227, 0, 27, 0); }
  100% { box-shadow: 0 0 0 0 rgba(227, 0, 27, 0); }
}

/* Play-Overlay */
.play-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  margin: 0;
  border: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: opacity 0.25s ease;
}
.play-overlay::before {
  content: "";
  position: absolute;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}
.play-overlay__icon {
  position: relative;
  width: 38px;
  height: 38px;
  fill: var(--hs-blue);
  margin-left: 4px; /* optische Mitte des Play-Dreiecks */
}
.play-overlay:active::before { transform: scale(0.94); }
/* Overlay ausblenden, sobald Wiedergabe gestartet */
.video[data-state="playing"] .play-overlay {
  opacity: 0;
  pointer-events: none;
}

/* Loading-Indicator */
.loader {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0c12;
}
.loader__spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Loader & Play-Overlay zustandsabhängig zeigen/verstecken */
.video[data-state="loading"] .play-overlay,
.video[data-state="error"] .play-overlay { display: none; }
.video:not([data-state="loading"]) .loader { display: none; }
.video[data-state="error"] .video__frame { display: none; }

/* Fehlerzustand */
.video__error {
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: var(--radius-video);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  padding: 28px;
}
.video__error-icon {
  width: 54px;
  height: 54px;
  fill: var(--text-muted);
}
.video__error-text {
  margin: 0;
  font-size: 16px;
  line-height: 1.45;
  color: var(--text-muted);
  max-width: 24ch;
}

/* ---- Aktionen / Buttons ---- */
.actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.btn {
  width: 100%;
  min-height: var(--tap-target);
  border-radius: var(--radius-btn);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 18px;
  transition: transform 0.06s ease, background-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn__icon { width: 22px; height: 22px; flex: none; }

.btn--primary {
  border: 0;
  background: var(--hs-blue);
  color: #fff;
  box-shadow: var(--shadow-btn);
}
.btn--primary .btn__icon { fill: #fff; }
.btn--primary:hover { background: #0050d8; }
.btn--primary:active { background: var(--hs-blue-dark); transform: translateY(1px); }

.btn--secondary {
  border: 2px solid var(--hs-blue);
  background: #fff;
  color: var(--hs-blue);
}
.btn--secondary .btn__icon { fill: var(--hs-blue); }
.btn--secondary:hover { background: var(--hs-blue-tint); }
.btn--secondary:active { background: #dbe5fb; transform: translateY(1px); }

.btn:disabled {
  opacity: 0.65;
  cursor: default;
  transform: none;
}

/* Sichtbarer Keyboard-Focus */
.btn:focus-visible,
.play-overlay:focus-visible {
  outline: 3px solid var(--hs-blue);
  outline-offset: 3px;
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 24px);
  transform: translateX(-50%) translateY(12px);
  background: var(--text);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
}
.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---- Tablet/Desktop: zentriert halten, nicht aufblähen ---- */
@media (min-width: 600px) {
  .page { gap: 26px; }
}
