/* ==========================================================================
   33Greentech · Kontakt-Widget (Video) · v1.0 · 2026-10-22
   Design: Canvas "CTA- und Newsletter-Banner", Zeilen v7 (Desktop) und
   v4/v5 (Mobil). Abhängigkeiten: keine. Schriften wie site.css
   ('Archivo', 'IBM Plex Mono'). Alle Klassen mit Präfix .cw-
   ========================================================================== */

.cw-root {
  --cw-black: #0B0B0B;
  --cw-paper: #EDEBE6;
  --cw-green: #22E06A;
  --cw-green-hover: #3BEA7E;
  --cw-grey: #9A9892;
  --cw-grey-light: #B8B6B0;
  --cw-grey-lighter: #CFCDC7;
  --cw-x: #8F8D88;
  --cw-ease: cubic-bezier(.2, .7, .2, 1);
  position: fixed;
  right: 40px;
  bottom: 32px;
  z-index: 55; /* unter dem Cookie-Banner (.consent 60), über dem Header (20) */
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: 'Archivo', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.cw-root[hidden] { display: none; }
.cw-root *, .cw-root *::before, .cw-root *::after { box-sizing: border-box; }
:where(.cw-root) button { font: inherit; letter-spacing: inherit; text-transform: none; }

/* ---------- Animation ---------- */
@keyframes cw-wipe-in {
  from { clip-path: inset(100% 0 0 0); transform: translateY(12px); }
  to   { clip-path: inset(0 0 0 0);    transform: none; }
}
@keyframes cw-fade-in { from { opacity: 0; } to { opacity: 1; } }
.cw-in   { animation: cw-wipe-in .45s var(--cw-ease) both; }
.cw-fade { animation: cw-fade-in .3s ease .35s both; }

/* ---------- Glas ---------- */
.cw-glass {
  position: relative;
  overflow: hidden;
  color: var(--cw-paper);
  background: linear-gradient(170deg, rgba(28,28,27,.92) 0%, rgba(12,12,12,.96) 55%, rgba(9,9,9,.97) 100%);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
  backdrop-filter: blur(28px) saturate(140%);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.09);
}

/* ---------- Video ---------- */
.cw-video { position: relative; z-index: 1; display: block; object-fit: cover; opacity: 0; transition: opacity .25s ease; }
.cw-video.is-on { opacity: 1; }
.cw-poster { position: absolute; inset: 0; background-size: cover; background-position: 50% 0%; }
.cw-compact__media .cw-poster { background-position: 50% 40%; }
@media (prefers-reduced-motion: reduce) { .cw-video { opacity: 1; transition: none; } }

/* ==========================================================================
   1 · Kompakte Karte (Desktop)
   ========================================================================== */
.cw-compact-wrap { position: relative; }
.cw-compact {
  display: grid;
  grid-template-columns: 76px max-content 36px;
  align-items: center;
  width: max-content;
  height: 72px;
  padding: 0 18px 0 0;
  margin: 0;
  text-align: left;
  cursor: pointer;
  transition: border-color .2s ease;
}
.cw-compact:hover { border-color: rgba(255,255,255,.28); }
.cw-compact:focus-visible { outline: 2px solid var(--cw-paper); outline-offset: 3px; }
.cw-compact__media { position: relative; display: block; width: 76px; height: 72px; overflow: hidden; background: #161615; }
.cw-compact__media .cw-video { position: absolute; left: -5px; top: -4px; width: 80px; height: 80px; }
.cw-compact__media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(110% 100% at 45% 40%, rgba(0,0,0,0) 55%, rgba(0,0,0,.32) 100%),
    linear-gradient(90deg, rgba(18,18,17,0) 62%, rgba(18,18,17,.5) 84%, rgba(18,18,17,.92) 100%);
}
.cw-compact__text { display: flex; flex-direction: column; gap: 3px; padding: 0 20px 0 10px; }
.cw-compact__title { font-size: 14px; font-weight: 600; line-height: 1.3; letter-spacing: -.005em; color: var(--cw-paper); white-space: nowrap; }
.cw-compact__name  { font-size: 12px; line-height: 1.3; color: var(--cw-grey); white-space: nowrap; }
.cw-arrowbox {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  background: var(--cw-green); color: var(--cw-black); transition: background .15s ease;
}
.cw-arrowbox svg { transition: transform .2s var(--cw-ease); }
.cw-compact:hover .cw-arrowbox { background: var(--cw-green-hover); }
.cw-compact:hover .cw-arrowbox svg { transform: translateX(2px); }

/* schlichtes X über der Karte */
.cw-close {
  position: absolute; top: -28px; right: -6px;
  width: 24px; height: 24px; padding: 0; border: 0; background: transparent;
  display: flex; align-items: center; justify-content: center;
  color: var(--cw-x); opacity: .75; cursor: pointer; transition: opacity .15s ease;
}
.cw-close:hover, .cw-close:focus-visible { opacity: 1; }
.cw-close:focus-visible { outline: 2px solid var(--cw-x); outline-offset: 1px; }

/* Mobil-Leiste (nur ≤ 640 px sichtbar) */
.cw-bar { display: none; }

/* ==========================================================================
   2 · Geöffnete Karte / Formular / Danke
   ========================================================================== */
.cw-card { width: 300px; }
.cw-card__media { position: relative; height: 200px; background: #161615; }
.cw-card__media .cw-video { width: 100%; height: 200px; object-position: 50% 0%; }
.cw-card__media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(130% 100% at 50% 30%, rgba(0,0,0,0) 50%, rgba(0,0,0,.36) 100%),
    linear-gradient(180deg, rgba(13,13,13,0) 45%, rgba(13,13,13,.6) 72%, rgba(13,13,13,.97) 100%);
}
.cw-card__name { position: absolute; z-index: 2; left: 14px; bottom: 10px; font-size: 12px; font-weight: 500; letter-spacing: .01em; color: var(--cw-paper); }
.cw-card__name span { color: var(--cw-grey); font-weight: 400; }
.cw-card__body { position: relative; z-index: 2; padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 12px; }
.cw-card__q { margin: 0; font-size: 14.5px; font-weight: 600; line-height: 1.35; white-space: nowrap; color: var(--cw-paper); outline: none; }

.cw-iconbtn {
  position: absolute; z-index: 3; top: 8px;
  width: 28px; height: 28px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(11,11,11,.5);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.16); color: var(--cw-paper); cursor: pointer;
}
.cw-iconbtn:hover { border-color: var(--cw-paper); }
.cw-iconbtn:focus-visible { outline: 2px solid var(--cw-paper); outline-offset: 2px; }
.cw-iconbtn--right { right: 8px; }
.cw-iconbtn--left  { left: 8px; }

.cw-btn-pri {
  height: 44px; width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; border: 0; background: var(--cw-green); color: var(--cw-black); text-decoration: none;
  font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 12px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; cursor: pointer; transition: background .15s ease;
}
.cw-btn-pri:hover { background: var(--cw-green-hover); color: var(--cw-black); }
.cw-btn-pri:focus-visible { outline: 2px solid var(--cw-paper); outline-offset: 2px; }
.cw-btn-pri[disabled] { opacity: .6; cursor: progress; }

.cw-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cw-row--single { grid-template-columns: minmax(0, 1fr); }
.cw-btn-sec {
  height: 40px; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.38); color: var(--cw-paper);
  text-decoration: none; font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 11.5px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; cursor: pointer; transition: border-color .15s ease, background .15s ease;
}
.cw-btn-sec:hover { border-color: var(--cw-paper); background: rgba(255,255,255,.08); color: var(--cw-paper); }
.cw-btn-sec:focus-visible { outline: 2px solid var(--cw-paper); outline-offset: 2px; }

.cw-meta { font-size: 12px; line-height: 1.4; color: var(--cw-grey-light); }
.cw-meta a { color: var(--cw-paper); text-decoration: none; }
.cw-meta a:hover { text-decoration: underline; }

/* Formular */
.cw-card--form .cw-card__media { height: 150px; }
.cw-card--form .cw-card__media .cw-video { height: 150px; object-position: 50% 8%; }
.cw-card--form .cw-card__media::after { background: linear-gradient(180deg, rgba(13,13,13,0) 40%, rgba(13,13,13,.6) 70%, rgba(13,13,13,.97) 100%); }
.cw-form { position: relative; z-index: 2; margin: -18px 0 0; padding: 0 14px 14px; display: flex; flex-direction: column; gap: 9px; }
.cw-form__title { font-size: 15px; font-weight: 600; line-height: 1.3; outline: none; }
.cw-label { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 10.5px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--cw-grey-light); }
.cw-label:first-of-type { margin-top: 4px; }
.cw-input {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 0;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.38);
  color: var(--cw-paper); font-family: 'Archivo', system-ui, sans-serif; font-size: 14px;
}
.cw-input::placeholder { color: #8F8D88; }
.cw-input:focus { outline: none; border-color: var(--cw-paper); }
.cw-input:user-invalid { border-color: #E5484D; }
textarea.cw-input { height: 72px; padding: 10px 12px; resize: none; line-height: 1.4; }
.cw-form .cw-btn-pri { margin-top: 4px; }
.cw-error { font-size: 12px; line-height: 1.4; color: #FF8A8E; }
.cw-error[hidden] { display: none; }
.cw-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.cw-sent { position: relative; z-index: 2; padding: 20px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.cw-sent__label { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 10.5px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--cw-grey-lighter); }
.cw-sent__text { font-size: 16px; font-weight: 600; line-height: 1.35; outline: none; }

/* ==========================================================================
   3 · Minimiert: grünes Quadrat mit Kalender
   ========================================================================== */
.cw-min {
  position: relative; width: 56px; height: 56px; padding: 0; border: 0;
  background: var(--cw-green); color: var(--cw-black);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.cw-min::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  border: 1px solid var(--cw-green); transition: transform .28s var(--cw-ease);
}
.cw-min svg { transition: transform .28s var(--cw-ease); }
.cw-min__label {
  position: absolute; right: calc(100% + 14px); top: 50%; transform: translateY(-50%);
  height: 36px; display: flex; align-items: center; padding: 0 14px; white-space: nowrap;
  background: var(--cw-black); color: var(--cw-paper);
  font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 11px; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase;
  clip-path: inset(0 0 0 100%); transition: clip-path .32s var(--cw-ease); pointer-events: none;
}
.cw-min:hover::before, .cw-min:focus-visible::before { transform: translate(-6px, -6px); }
.cw-min:hover .cw-min__label, .cw-min:focus-visible .cw-min__label { clip-path: inset(0 0 0 0); }
.cw-min:hover svg { transform: translateY(-1px); }
.cw-min:focus-visible { outline: none; }

/* ==========================================================================
   Mobil (≤ 640 px)
   ========================================================================== */
@media (max-width: 640px) {
  .cw-root {
    left: 12px; right: 12px;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }
  /* kompakt = schlichte Leiste */
  .cw-compact-wrap { display: none; }
  .cw-bar {
    display: grid; grid-template-columns: 64px minmax(0, 1fr) 44px; align-items: center;
    width: 100%; height: 64px;
  }
  .cw-bar__media { position: relative; width: 64px; height: 64px; overflow: hidden; background: #161615; }
  .cw-bar__media .cw-video { width: 64px; height: 64px; }
  .cw-bar__media::after { content: ""; position: absolute; inset: 0; background: radial-gradient(110% 90% at 50% 35%, rgba(0,0,0,0) 55%, rgba(0,0,0,.5) 100%); }
  .cw-bar__open {
    height: 64px; padding: 0 12px; margin: 0; border: 0; background: transparent; color: var(--cw-paper);
    display: flex; flex-direction: column; justify-content: center; gap: 3px; text-align: left; cursor: pointer;
  }
  .cw-bar__title { font-size: 14px; font-weight: 600; line-height: 1.2; }
  .cw-bar__cta { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 10.5px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--cw-grey-lighter); }
  .cw-bar__close {
    width: 44px; height: 64px; padding: 0; border: 0; border-left: 1px solid rgba(255,255,255,.1);
    background: transparent; color: var(--cw-grey-light); display: flex; align-items: center; justify-content: center; cursor: pointer;
  }
  .cw-bar__open:focus-visible, .cw-bar__close:focus-visible { outline: 2px solid var(--cw-paper); outline-offset: -2px; }

  /* geöffnet = kompakte Karte über volle Breite */
  .cw-card { width: 100%; }
  .cw-card__media .cw-video { object-position: 50% 85%; }
  .cw-card__q { font-size: 15px; white-space: normal; }
  .cw-btn-pri { height: 48px; padding: 0 16px; font-size: 12.5px; }
  .cw-btn-sec { height: 44px; font-size: 12px; }
  .cw-iconbtn { width: 36px; height: 36px; }
  .cw-card .cw-meta--phone { display: none; }

  /* minimiert */
  .cw-min { margin-right: 4px; }
  .cw-min__label { display: none; }
}

/* ---------- Bewegung reduzieren ---------- */
@media (prefers-reduced-motion: reduce) {
  .cw-in, .cw-fade { animation: none; }
  .cw-min::before, .cw-min svg, .cw-min__label, .cw-arrowbox svg { transition: none; }
}

/* ---------- Druck ---------- */
@media print { .cw-root { display: none !important; } }
