/* Angebots-Agent eventwc.de – Eingabe auf der Startseite (2026-12-03) */
.ewc-agent {
  --ewc-hell: #d6d6d6;
  --ewc-text: #ececec;
  --ewc-leise: #9a9a9a;
  --ewc-linie: rgba(214, 214, 214, 0.45);
  --ewc-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  max-width: 720px;
  margin: 8px auto 40px;
  padding: 0 16px;
  color: var(--ewc-text);
  font-family: inherit;
  text-align: left;
}
.ewc-agent * { box-sizing: border-box; }

.ewc-agent__intro {
  margin: 0 0 14px;
  font-size: 17px;
  line-height: 1.5;
  text-align: center;
  color: var(--ewc-text);
  text-wrap: balance;
}

/* Verlauf */
.ewc-agent__log {
  display: none;
  max-height: min(460px, 60vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 4px 12px;
  margin-bottom: 12px;
  scrollbar-width: thin;
  scrollbar-color: #555 transparent;
}
.ewc-agent.is-aktiv .ewc-agent__log { display: block; }
.ewc-agent.is-aktiv .ewc-agent__intro { display: none; }

.ewc-msg { margin: 0 0 14px; font-size: 16px; line-height: 1.55; overflow-wrap: anywhere; }
.ewc-msg p { margin: 0 0 8px; }
.ewc-msg p:last-child { margin-bottom: 0; }
.ewc-msg ul, .ewc-msg ol { margin: 4px 0 8px; padding-left: 20px; }
.ewc-msg li { margin: 2px 0; }
.ewc-msg strong { color: #fff; font-weight: 700; }

.ewc-msg--kunde {
  margin-left: auto;
  max-width: 85%;
  width: fit-content;
  padding: 9px 14px;
  background: var(--ewc-hell);
  color: #111;
  border-radius: 2px;
  white-space: pre-wrap;
}
.ewc-msg--agent { max-width: 92%; }

/* Nur Antworten des Agenten blenden ein; eigene Nachrichten erscheinen sofort */
.ewc-msg--neu {
  animation: ewc-ein 240ms var(--ewc-ease-out) both;
}
@keyframes ewc-ein {
  from { opacity: 0; transform: translateY(6px); }
}

/* Auswahlknoepfe */
.ewc-optionen { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 16px; }
.ewc-option, .ewc-download {
  font: inherit;
  font-size: 15px;
  line-height: 1.2;
  padding: 10px 16px;
  min-height: 44px;
  border: 1px solid var(--ewc-hell);
  border-radius: 0;
  background: transparent;
  color: var(--ewc-text);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 140ms var(--ewc-ease-out), background-color 160ms ease, color 160ms ease;
}
.ewc-option:active, .ewc-download:active, .ewc-agent__senden:active { transform: scale(0.97); }
.ewc-option:disabled { opacity: 0.35; cursor: default; transform: none; }
@media (hover: hover) and (pointer: fine) {
  .ewc-option:not(:disabled):hover, .ewc-download:hover { background: var(--ewc-hell); color: #111; }
}

.ewc-downloads { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 16px; }
.ewc-download {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ewc-hell); color: #111; text-decoration: none; font-weight: 600;
}
.ewc-download svg { width: 16px; height: 16px; flex: none; }

.ewc-bilder { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: -4px 0 16px; }
.ewc-bild { margin: 0; }
.ewc-bild img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #1a1a1a; }
.ewc-bild figcaption { margin-top: 6px; font-size: 14px; color: var(--ewc-leise); }

/* Schreibt gerade */
.ewc-tippt { display: none; gap: 5px; padding: 6px 0 14px; }
.ewc-agent.is-wartet .ewc-tippt { display: flex; }
.ewc-tippt span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--ewc-leise);
  animation: ewc-puls 1s ease-in-out infinite;
}
.ewc-tippt span:nth-child(2) { animation-delay: 0.15s; }
.ewc-tippt span:nth-child(3) { animation-delay: 0.3s; }
@keyframes ewc-puls { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

/* Eingabe */
.ewc-agent__form {
  display: flex;
  align-items: flex-end;
  border: 1px solid var(--ewc-hell);
  background: #0b0b0b;
  transition: border-color 160ms ease;
}
.ewc-agent__form:focus-within { border-color: #fff; }
.ewc-agent__feld {
  flex: 1;
  min-width: 0;
  min-height: 56px;
  max-height: 160px;
  padding: 16px 16px;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 16px; /* verhindert Zoom auf iOS */
  line-height: 24px;
}
.ewc-agent__feld::placeholder { color: #8c8c8c; opacity: 1; }
.ewc-agent__senden {
  flex: none;
  align-self: stretch;
  width: 56px;
  min-height: 56px;
  display: grid;
  place-items: center;
  border: 0;
  border-left: 1px solid var(--ewc-hell);
  border-radius: 0;
  background: var(--ewc-hell);
  color: #111;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 140ms var(--ewc-ease-out), opacity 160ms ease;
}
.ewc-agent__senden svg { width: 20px; height: 20px; }
.ewc-agent__senden:disabled { opacity: 0.45; cursor: default; transform: none; }
.ewc-agent__feld:focus-visible { outline: none; }
.ewc-agent__senden:focus-visible, .ewc-option:focus-visible, .ewc-download:focus-visible, .ewc-agent__meta a:focus-visible {
  outline: 2px solid #fff; outline-offset: 2px;
}

.ewc-agent__meta {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ewc-leise);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
}
.ewc-agent__meta a { color: var(--ewc-text); text-decoration: underline; text-underline-offset: 3px; }
.ewc-agent__meta .ewc-formular { font-size: 14px; }
.ewc-agent__links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; }
/* Neu beginnen: erst sichtbar, wenn ein Gespräch läuft */
#ewc-agent .ewc-neu {
  display: none; align-items: center; gap: 6px;
  margin: 0; padding: 4px 0; border: 0; border-radius: 0; background: none; box-shadow: none;
  font: inherit; font-size: 14px; line-height: 1.5; letter-spacing: 0; text-transform: none;
  color: var(--ewc-text); cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
  transition: transform 140ms var(--ewc-ease-out), opacity 160ms ease;
}
#ewc-agent.is-aktiv .ewc-neu { display: inline-flex; }
#ewc-agent .ewc-neu svg { width: 14px; height: 14px; flex: none; }
#ewc-agent .ewc-neu:active { transform: scale(0.97); }
#ewc-agent .ewc-neu:disabled { opacity: 0.4; cursor: default; transform: none; }
#ewc-agent .ewc-neu:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { #ewc-agent .ewc-neu:not(:disabled):hover { opacity: 0.75; } }

@media (max-width: 600px) {
  .ewc-agent { margin: 0 auto 28px; padding: 0 12px; }
  .ewc-agent__intro { font-size: 16px; }
  .ewc-msg--kunde, .ewc-msg--agent { max-width: 100%; }
  .ewc-agent__log { max-height: 62vh; }
  .ewc-agent__feld { min-height: 80px; }
}

@media (prefers-reduced-motion: reduce) {
  .ewc-msg--neu { animation: ewc-blende 200ms ease both; }
  .ewc-option, .ewc-download, .ewc-agent__senden { transition: background-color 160ms ease, color 160ms ease; }
  .ewc-option:active, .ewc-download:active, .ewc-agent__senden:active { transform: none; }
}
@keyframes ewc-blende { from { opacity: 0; } }

.ewc-agent .screen-reader-text {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Handy: Eingabe ganz oben im Startbereich, damit sie ohne Scrollen sichtbar ist */
@media (max-width: 768px) {
  .fl-node-5a23d1356b205 > .fl-col-content { display: flex; flex-direction: column; }
  .fl-node-5a23d1356b205 > .fl-col-content > .ewc-agent { order: -1; width: 100%; margin: 20px auto 36px; }
}

/* Gegen Farbvorgaben des Seiten-Themes absichern */
#ewc-agent .ewc-msg--kunde { color: #111; }
#ewc-agent .ewc-download, #ewc-agent .ewc-download span { color: #111; }
#ewc-agent .ewc-agent__form { background: #0b0b0b; }
#ewc-agent .ewc-agent__feld, #ewc-agent .ewc-agent__feld:focus { background: transparent; color: #fff; box-shadow: none; }
#ewc-agent .ewc-agent__senden { background: var(--ewc-hell); color: #111; }
@media (hover: hover) and (pointer: fine) {
  #ewc-agent .ewc-option:not(:disabled):hover { color: #111; }
}

/* ---------- /buchen: Auswahl Chat oder Formular ---------- */
.ewc-buchen { max-width: 752px; margin: 8px auto 0; padding: 0 16px; font-family: inherit; }
.ewc-buchen * { box-sizing: border-box; }
.ewc-wahl__frage { margin: 0 0 12px; text-align: center; font-size: 17px; line-height: 1.4; color: #222; }
.ewc-wahl__knoepfe { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #111; }
.ewc-wahl__knopf {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 10px 12px;
  font: inherit; font-size: 16px; line-height: 1.2;
  background: transparent; color: #111;
  border: 0; border-radius: 0; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: background-color 160ms ease, color 160ms ease;
}
.ewc-wahl__knopf + .ewc-wahl__knopf { border-left: 1px solid #111; }
.ewc-wahl__knopf svg { width: 18px; height: 18px; flex: none; transition: transform 140ms cubic-bezier(0.23, 1, 0.32, 1); }
.ewc-wahl__knopf:active svg { transform: scale(0.9); }
.ewc-wahl__knopf[aria-pressed="true"] { background: #111; color: #fff; }
@media (hover: hover) and (pointer: fine) {
  .ewc-wahl__knopf[aria-pressed="false"]:hover { background: #f0f0f0; }
}
.ewc-wahl__knopf:focus-visible { outline: 2px solid #111; outline-offset: 2px; }

html.ewc-zeige-chat .fl-node-5a8e8bcb904cc { display: none; }
html.ewc-zeige-formular .ewc-buchen .ewc-agent { display: none; }
.ewc-buchen .ewc-agent { padding: 0; margin: 28px auto 48px; }
.ewc-einblenden { animation: ewc-blende 180ms cubic-bezier(0.23, 1, 0.32, 1) both; }

/* ---------- helle Variante (weiße Seiten) ---------- */
#ewc-agent.ewc-agent--hell { --ewc-hell: #111; --ewc-text: #222; --ewc-leise: #6b6b6b; color: #222; scrollbar-color: #bbb transparent; }
#ewc-agent.ewc-agent--hell .ewc-agent__intro { color: #222; }
#ewc-agent.ewc-agent--hell .ewc-msg strong { color: #000; }
#ewc-agent.ewc-agent--hell .ewc-msg--kunde { background: #efefef; color: #111; }
#ewc-agent.ewc-agent--hell .ewc-agent__form { background: #fff; border-color: #111; }
#ewc-agent.ewc-agent--hell .ewc-agent__form:focus-within { border-color: #000; box-shadow: 0 0 0 1px #000; }
#ewc-agent.ewc-agent--hell .ewc-agent__feld, #ewc-agent.ewc-agent--hell .ewc-agent__feld:focus { color: #111; }
#ewc-agent.ewc-agent--hell .ewc-agent__feld::placeholder { color: #8a8a8a; }
#ewc-agent.ewc-agent--hell .ewc-agent__senden { background: #111; color: #fff; border-left-color: #111; }
#ewc-agent.ewc-agent--hell .ewc-option { color: #111; border-color: #111; }
#ewc-agent.ewc-agent--hell .ewc-download, #ewc-agent.ewc-agent--hell .ewc-download span { background: #111; color: #fff; }
#ewc-agent.ewc-agent--hell .ewc-agent__meta, #ewc-agent.ewc-agent--hell .ewc-agent__meta span { color: #6b6b6b; }
#ewc-agent.ewc-agent--hell .ewc-agent__meta a { color: #222; }
#ewc-agent.ewc-agent--hell .ewc-tippt span { background: #999; }
#ewc-agent.ewc-agent--hell .ewc-bild img { background: #eee; }
#ewc-agent.ewc-agent--hell .ewc-bild figcaption { color: #6b6b6b; }
#ewc-agent.ewc-agent--hell .ewc-option:focus-visible, #ewc-agent.ewc-agent--hell .ewc-download:focus-visible,
#ewc-agent.ewc-agent--hell .ewc-agent__senden:focus-visible, #ewc-agent.ewc-agent--hell .ewc-agent__meta a:focus-visible { outline-color: #000; }
@media (hover: hover) and (pointer: fine) {
  #ewc-agent.ewc-agent--hell .ewc-option:not(:disabled):hover { background: #111; color: #fff; }
}
@media (max-width: 600px) {
  .ewc-buchen { padding: 0 12px; }
  .ewc-wahl__frage { font-size: 16px; }
}

/* Theme setzt Textfelder auf 90px – eigene Höhe erzwingen (wächst per Skript mit) */
#ewc-agent .ewc-agent__feld { height: 56px; }
@media (max-width: 600px) { #ewc-agent .ewc-agent__feld { height: 80px; } }
/* Formular direkt unter der Auswahl beginnen lassen */
html.ewc-zeige-formular .fl-node-5a8e8bcb904cc .top-content { padding-top: 0; }
html.ewc-zeige-formular .fl-node-5a8e8bcb904cc .fl-module-html > .fl-module-content { margin-top: 8px; }

/* Verlauf steht in der Seite, kein eigener Scrollbereich (Seite scrollt mit) */
.ewc-agent__log, .ewc-agent.is-aktiv .ewc-agent__log { max-height: none; overflow: visible; }
@media (max-width: 600px) { .ewc-agent__log { max-height: none; } }

/* ---------- Überarbeitung 03.12.2026: runder, wie für das Handy gemacht ---------- */
#ewc-agent .ewc-agent__form {
  align-items: flex-end;
  gap: 8px;
  padding: 6px 6px 6px 4px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 28px;
  background: #161616;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
#ewc-agent .ewc-agent__form:focus-within { border-color: rgba(255, 255, 255, 0.7); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08); }
#ewc-agent .ewc-agent__feld { height: 44px; min-height: 44px; padding: 10px 6px 10px 16px; }
#ewc-agent .ewc-agent__senden {
  align-self: flex-end;
  width: 44px; height: 44px; min-height: 44px;
  border: 0; border-radius: 50%;
}
#ewc-agent .ewc-agent__senden svg { width: 18px; height: 18px; }
#ewc-agent .ewc-agent__senden:focus-visible { outline-offset: 3px; }

#ewc-agent .ewc-msg--kunde { border-radius: 20px 20px 6px 20px; padding: 10px 16px; }
#ewc-agent .ewc-option { border-radius: 999px; padding: 10px 18px; user-select: none; -webkit-user-select: none; }
#ewc-agent .ewc-download { border-radius: 14px; }
#ewc-agent .ewc-bild img { border-radius: 14px; }
#ewc-agent .ewc-agent__senden, #ewc-agent .ewc-neu { user-select: none; -webkit-user-select: none; }

/* Links unter dem Feld etwas eingerückt (folgen der Rundung), KI-Hinweis klein und leise */
#ewc-agent .ewc-agent__meta { margin-top: 12px; padding: 0 14px; align-items: baseline; }
#ewc-agent .ewc-agent__meta > span:not(.ewc-agent__links) { font-size: 11.5px; opacity: 0.75; }
#ewc-agent .ewc-agent__meta > span:not(.ewc-agent__links) a { color: inherit; text-underline-offset: 2px; }

/* helle Variante */
#ewc-agent.ewc-agent--hell .ewc-agent__form { background: #f4f4f4; border-color: transparent; }
#ewc-agent.ewc-agent--hell .ewc-agent__form:focus-within { background: #fff; border-color: #111; box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06); }
#ewc-agent.ewc-agent--hell .ewc-agent__meta > span:not(.ewc-agent__links) a { color: inherit; }

/* /buchen: Auswahl als runde Umschaltleiste */
.ewc-wahl__knoepfe { border: 0; border-radius: 16px; padding: 4px; gap: 4px; background: #f0f0f0; }
.ewc-wahl__knopf { border-radius: 12px; min-height: 48px; user-select: none; -webkit-user-select: none; }
.ewc-wahl__knopf + .ewc-wahl__knopf { border-left: 0; }
@media (hover: hover) and (pointer: fine) {
  .ewc-wahl__knopf[aria-pressed="false"]:hover { background: #e4e4e4; }
}

@media (max-width: 600px) {
  #ewc-agent .ewc-agent__feld { height: 68px; min-height: 68px; }
  #ewc-agent .ewc-agent__meta { padding: 0 10px; }
  #ewc-agent .ewc-agent__meta > span:not(.ewc-agent__links) { flex-basis: 100%; }
}
@media (max-width: 768px) {
  .fl-node-5a23d1356b205 > .fl-col-content > .ewc-agent { margin-top: 4px; }
}
