/* ==========================================================================
   transformis Chat · Widget
   --------------------------------------------------------------------------
   Look an das transformis-CD angelehnt: Navy #05132C, Lime #ABFF00,
   Open Sans, scharfe Ecken. Tokens hier redeklariert -> selbstständig,
   auch ohne Theme-CSS.
   ========================================================================== */

.tmc {
  --tmc-blue:      #05132C;
  --tmc-blue-600:  #1E2B41;
  --tmc-green:     #ABFF00;
  --tmc-white:     #ffffff;
  --tmc-white-soft:#FAFCFC;
  --tmc-gray:      #F5F5F5;
  --tmc-border:    #E5E5E5;
  --tmc-muted:     #697180;
  --tmc-line:      #95A4BD;

  --tmc-font: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --tmc-radius: 4px;
  --tmc-shadow: 0 18px 48px rgba(5, 19, 44, 0.28);
  --tmc-ease: 0.2s ease;

  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 99998;
  font-family: var(--tmc-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.tmc[hidden] { display: none; }

.tmc *,
.tmc *::before,
.tmc *::after { box-sizing: border-box; }

/* ── Floating Action Button (minimierter Zustand) ── */
.tmc-fab {
  position: relative;
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 50%;
  background: var(--tmc-blue);
  color: var(--tmc-green);
  cursor: pointer;
  box-shadow: var(--tmc-shadow);
  transition: transform var(--tmc-ease);
}
.tmc-fab:hover { transform: translateY(-2px); }
.tmc-fab[hidden] { display: none; }
.tmc-fab__initials {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.02em;
}
.tmc-fab__img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.tmc-fab__pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--tmc-green);
  opacity: 0;
  animation: tmcPulse 2.6s ease-out infinite;
}
@keyframes tmcPulse {
  0%   { transform: scale(1);   opacity: 0.55; }
  70%  { transform: scale(1.45); opacity: 0; }
  100% { opacity: 0; }
}

/* ── Panel ── */
.tmc-panel {
  width: min(384px, calc(100vw - 32px));
  max-height: min(640px, calc(100vh - 48px));
  background: var(--tmc-white-soft);
  border: 1px solid var(--tmc-border);
  border-radius: var(--tmc-radius);
  box-shadow: var(--tmc-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
  animation: tmcPanelIn 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.tmc-panel[hidden] { display: none; }
@keyframes tmcPanelIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Header (Navy) ── */
.tmc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 16px;
  background: var(--tmc-blue);
  color: var(--tmc-white-soft);
  flex: none;
}
.tmc-avatar {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--tmc-green);
  flex: none;
}
.tmc-avatar__initials {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--tmc-blue);
  font-weight: 800;
  font-size: 14px;
}
.tmc-avatar__img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tmc-head__meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-right: auto;
}
.tmc-head__name {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
}
.tmc-head__org {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  line-height: 1.3;
  color: rgba(250, 252, 252, 0.72);
  margin-top: 2px;
}
.tmc-head__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tmc-green);
  flex: none;
}
.tmc-iconbtn {
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  color: rgba(250, 252, 252, 0.8);
  cursor: pointer;
  display: grid;
  place-items: center;
  border-radius: 2px;
  transition: color var(--tmc-ease), background var(--tmc-ease);
  flex: none;
}
.tmc-iconbtn:hover { color: var(--tmc-green); background: rgba(255, 255, 255, 0.06); }
.tmc-iconbtn:focus-visible { outline: 2px solid var(--tmc-green); outline-offset: 2px; }

/* ── Nachrichtenbereich ── */
.tmc-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 18px 16px 8px;
  background: var(--tmc-gray);
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

.tmc-msg {
  max-width: 86%;
  padding: 10px 13px;
  font-size: 14.5px;
  line-height: 1.5;
  animation: tmcMsgIn 0.22s ease both;
}
@keyframes tmcMsgIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tmc-msg--bot {
  align-self: flex-start;
  background: var(--tmc-white);
  color: var(--tmc-blue);
  border: 1px solid var(--tmc-border);
  border-radius: 2px 12px 12px 12px;
}
.tmc-msg--user {
  align-self: flex-end;
  background: var(--tmc-green);
  color: var(--tmc-blue);
  font-weight: 600;
  border-radius: 12px 2px 12px 12px;
}

/* Angebots-Nachricht mit 3D-Whitepaper-Mockup */
.tmc-msg--offer { max-width: 92%; }
.tmc-mockup {
  margin: 14px auto 2px;
  width: 148px;
  perspective: 720px;
}
.tmc-mockup img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
  transform: rotateY(-16deg) rotateX(3deg);
  transform-origin: left center;
  box-shadow: -14px 14px 28px rgba(5, 19, 44, 0.30);
  border: 1px solid rgba(5, 19, 44, 0.08);
  transition: transform var(--tmc-ease);
}
.tmc-mockup img:hover { transform: rotateY(-6deg) rotateX(1deg); }

/* Typing-Indikator */
.tmc-typing {
  align-self: flex-start;
  background: var(--tmc-white);
  border: 1px solid var(--tmc-border);
  border-radius: 2px 12px 12px 12px;
  padding: 12px 14px;
  display: inline-flex;
  gap: 5px;
}
.tmc-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tmc-line);
  animation: tmcBlink 1.2s infinite ease-in-out;
}
.tmc-typing span:nth-child(2) { animation-delay: 0.15s; }
.tmc-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes tmcBlink {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40%           { opacity: 1;   transform: translateY(-3px); }
}

/* ── Quick-Replies (Chips) ── */
.tmc-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px 14px;
  background: var(--tmc-gray);
  flex: none;
}
.tmc-quick:empty { display: none; }

.tmc-chip {
  font-family: var(--tmc-font);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  padding: 9px 14px;
  background: transparent;
  color: var(--tmc-blue);
  border: 1px solid var(--tmc-blue);
  border-radius: 0;
  cursor: pointer;
  transition: background var(--tmc-ease), color var(--tmc-ease), border-color var(--tmc-ease);
}
.tmc-chip:hover {
  background: var(--tmc-green);
  border-color: var(--tmc-green);
  color: var(--tmc-blue);
}
.tmc-chip:focus-visible { outline: 2px solid var(--tmc-blue); outline-offset: 2px; }

.tmc-chip--primary {
  background: var(--tmc-green);
  border-color: var(--tmc-green);
}
.tmc-chip--primary:hover {
  background: color-mix(in srgb, var(--tmc-green), black 10%);
  border-color: color-mix(in srgb, var(--tmc-green), black 10%);
}
.tmc-chip--ghost {
  border-color: var(--tmc-border);
  color: var(--tmc-muted);
  font-weight: 400;
}
.tmc-chip--ghost:hover {
  background: transparent;
  border-color: var(--tmc-muted);
  color: var(--tmc-blue);
}

/* ── Formularbereich ── */
.tmc-formwrap {
  padding: 4px 16px 16px;
  background: var(--tmc-gray);
  overflow-y: auto;
}
.tmc-formwrap[hidden] { display: none; }

/* ==========================================================================
   CF7 im Widget – Underline-Optik wie das transformis-Broschüren-Modal
   ========================================================================== */

.tmc-cf7 .wpcf7-form { display: flex; flex-direction: column; gap: 0; }
.tmc-cf7 .wpcf7-form p { margin: 0; }
.tmc-cf7 .wpcf7-form br { display: none; }

.tmc-cf7 input[type="text"],
.tmc-cf7 input[type="email"],
.tmc-cf7 input[type="tel"],
.tmc-cf7 input[type="url"],
.tmc-cf7 textarea,
.tmc-cf7 select {
  width: 100%;
  height: 42px;
  padding: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--tmc-line);
  border-radius: 0;
  outline: none;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
  font-family: var(--tmc-font);
  font-size: 15px;
  line-height: 42px;
  color: var(--tmc-blue);
  transition: border-color var(--tmc-ease);
  margin: 0 0 18px;
}
.tmc-cf7 textarea { height: auto; min-height: 76px; line-height: 1.5; padding-top: 8px; }
.tmc-cf7 input:focus,
.tmc-cf7 textarea:focus,
.tmc-cf7 select:focus { border-bottom-color: var(--tmc-blue); }
.tmc-cf7 ::placeholder { color: var(--tmc-blue); opacity: 0.65; }

.tmc-cf7 .wpcf7-acceptance,
.tmc-cf7 .wpcf7-checkbox { display: block; margin: 0 0 18px; }
.tmc-cf7 .wpcf7-list-item { margin: 0; display: block; }
.tmc-cf7 .wpcf7-list-item label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  margin: 0;
}
.tmc-cf7 .wpcf7-list-item-label {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--tmc-blue);
}
.tmc-cf7 input[type="checkbox"] {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin: 3px 0 0;
  border: 1px solid var(--tmc-blue);
  background: transparent;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  position: relative;
}
.tmc-cf7 input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 0;
  width: 5px;
  height: 10px;
  border-right: 2px solid var(--tmc-blue);
  border-bottom: 2px solid var(--tmc-blue);
  transform: rotate(45deg);
}
.tmc-cf7 a { color: var(--tmc-blue); text-decoration: underline; }
.tmc-cf7 a:hover { text-decoration: none; }

.tmc-cf7 input[type="submit"],
.tmc-cf7 .wpcf7-submit {
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
  padding: 11px 18px;
  background: var(--tmc-green);
  color: var(--tmc-blue);
  border: 1px solid var(--tmc-green);
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
  font-family: var(--tmc-font);
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: background var(--tmc-ease), border-color var(--tmc-ease);
}
.tmc-cf7 input[type="submit"]:hover,
.tmc-cf7 .wpcf7-submit:hover {
  background: color-mix(in srgb, var(--tmc-green), black 10%);
  border-color: color-mix(in srgb, var(--tmc-green), black 10%);
}

.tmc-cf7 .wpcf7-not-valid { border-bottom-color: #dc3232 !important; }
.tmc-cf7 .wpcf7-not-valid-tip {
  display: block;
  font-size: 12.5px;
  color: #dc3232;
  margin: -12px 0 16px;
}
.tmc-cf7 .wpcf7-response-output {
  margin: 14px 0 0;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #dc3232;
  color: #dc3232;
  background: rgba(220, 50, 50, 0.06);
  border-radius: 0;
}
.tmc-cf7 .wpcf7-response-output.wpcf7-display-none { display: none; }
.tmc-cf7 form.sent .wpcf7-response-output,
.tmc-cf7 .wpcf7-response-output.wpcf7-mail-sent-ok {
  border-color: var(--tmc-blue);
  background: var(--tmc-blue);
  color: var(--tmc-green);
}
.tmc-cf7 .wpcf7-spinner { background-color: var(--tmc-blue); }

/* ── Responsive: Vollbild auf schmalen Screens ── */
@media (max-width: 480px) {
  .tmc { right: 12px; bottom: 12px; left: 12px; }
  .tmc-panel {
    width: 100%;
    max-height: min(78vh, calc(100vh - 24px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .tmc-panel,
  .tmc-msg,
  .tmc-fab__pulse,
  .tmc-typing span { animation: none !important; }
  .tmc-scroll { scroll-behavior: auto; }
}
