/* =====================================================================
 * tb-feedback - Floating Button + Modal
 * ===================================================================== */

/* tb-feedback-fab: viewport-fixed, sitzt links neben dem Concierge-FAB.
   Historie: am 2026-05-05 auf position:absolute (am Footer-Boden) umgestellt;
   am 2026-05-07 zurueck auf fixed, das war ein Bug, der FAB war auf langen
   Seiten nicht erreichbar.

   Auf Seiten die bereits einen inline-Feedback-CTA enthalten (Kontakt-Page
   markiert via .tb-pg--kontakt im Body) wird der FAB komplett versteckt.
   Auf Mobile ebenfalls komplett versteckt, Footer-Spalte "Kontakt" hat
   bereits den "Kurzes Feedback senden"-Link, das genuegt fuer Mobile. */
body:has(.tb-pg--kontakt) #tb-feedback-fab { display: none; }
@media (max-width: 720px) {
  #tb-feedback-fab { display: none !important; }
}
#tb-feedback-fab {
  position: fixed;
  bottom: 1rem;
  right: 4rem;  /* links neben dem Concierge-FAB (der ist bei right:1rem, 44px breit) */
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 44px;            /* identische Hoehe wie Concierge-FAB */
  padding: 0 1rem;
  border: 0;
  border-radius: 999px;
  background: var(--tb-primary-700, #1919C8);
  color: #fff;
  font-family: Geist, Inter, sans-serif;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(25, 25, 200, 0.25);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
#tb-feedback-fab:hover {
  transform: translateY(-2px);
  background: var(--tb-primary-800, #1313A8);
  box-shadow: 0 8px 20px rgba(25, 25, 200, 0.35);
}
#tb-feedback-fab:focus-visible {
  outline: 2px solid var(--tb-accent-cyan, #22D3EE);
  outline-offset: 3px;
}
#tb-feedback-fab svg { display: block; }

@media (max-width: 720px) {
  #tb-feedback-fab {
    right: 5rem;
    padding: 0 0.75rem;
    font-size: 0.875rem;
  }
  #tb-feedback-fab span { display: none; }  /* nur Icon auf Mobile */
}

/* ── Modal ─────────────────────────────────────────────────────────── */
#tb-feedback-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
#tb-feedback-modal[hidden] { display: none; }

.tb-fb__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 14, 42, 0.55);
  backdrop-filter: blur(2px);
  animation: tb-fb-fade-in 180ms ease-out;
}
@keyframes tb-fb-fade-in { from { opacity: 0; } to { opacity: 1; } }

.tb-fb__panel {
  position: relative;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 60px -12px rgba(14, 14, 42, 0.4);
  width: 100%;
  max-width: 540px;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  animation: tb-fb-slide-in 220ms cubic-bezier(0.2, 0.8, 0.3, 1.05);
}
@keyframes tb-fb-slide-in {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.tb-fb__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 0.75rem;
  border-bottom: 1px solid var(--tb-line, #E7E7F2);
}
.tb-fb__head h2 {
  margin: 0;
  font-family: Geist, Inter, sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--tb-ink-900, #0E0E2A);
}
.tb-fb__close {
  background: transparent;
  border: 0;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  color: var(--tb-ink-500, #6B7280);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}
.tb-fb__close:hover { background: var(--tb-line, #E7E7F2); color: var(--tb-ink-900, #0E0E2A); }

/* ── Form ──────────────────────────────────────────────────────────── */
.tb-fb__form {
  padding: 1.25rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tb-fb__cats {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}
.tb-fb__cats-legend {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  color: var(--tb-ink-700, #374151);
  grid-column: 1 / -1;
}
.tb-fb__cat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.625rem 0.5rem;
  border: 2px solid var(--tb-line, #E7E7F2);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  text-align: center;
  transition: all 120ms ease;
  user-select: none;
}
.tb-fb__cat:hover { border-color: var(--tb-primary-300, #A8A8E8); background: #FAFAFF; }
.tb-fb__cat input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.tb-fb__cat:has(input:checked) {
  border-color: var(--tb-primary-700, #1919C8);
  background: var(--tb-primary-50, #EEEEFD);
  box-shadow: 0 0 0 3px rgba(25, 25, 200, 0.15);
}
.tb-fb__cat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--tb-ink-700, #374151);
  transition: color .15s ease, transform .15s ease;
}
.tb-fb__cat-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}
.tb-fb__cat:hover .tb-fb__cat-icon { color: var(--tb-primary-700, #1919C8); }
.tb-fb__cat:has(input:checked) .tb-fb__cat-icon {
  color: var(--tb-primary-700, #1919C8);
  transform: scale(1.08);
}
.tb-fb__cat-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--tb-ink-900, #0E0E2A);
}

.tb-fb__field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.tb-fb__field span {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--tb-ink-700, #374151);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.tb-fb__field span small { font-weight: 400; color: var(--tb-ink-500, #6B7280); }
/* Mic-Button rechts in der Label-Zeile (margin-left:auto schiebt ihn ans Ende) */
.tb-fb__mic { margin-left: auto; }
.tb-fb__form textarea,
.tb-fb__form input[type="text"],
.tb-fb__form input[type="email"] {
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--tb-line, #E7E7F2);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9375rem;
  width: 100%;
  background: #fff;
  color: var(--tb-ink-900, #0E0E2A);
}
.tb-fb__form textarea:focus,
.tb-fb__form input:focus {
  outline: 2px solid var(--tb-primary-700, #1919C8);
  outline-offset: -1px;
  border-color: var(--tb-primary-700, #1919C8);
}
.tb-fb__form textarea { resize: vertical; min-height: 90px; }

.tb-fb__contact {
  border: 1px solid var(--tb-line, #E7E7F2);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
}
.tb-fb__contact summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--tb-ink-700, #374151);
  padding: 0.25rem 0;
  user-select: none;
}
.tb-fb__contact[open] summary { color: var(--tb-primary-700, #1919C8); }
.tb-fb__contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.tb-fb__contact-grid label { display: flex; flex-direction: column; gap: 0.25rem; }
.tb-fb__contact-grid label span { font-size: 0.8125rem; font-weight: 500; color: var(--tb-ink-700, #374151); }

.tb-fb__meta-hint {
  font-size: 0.8125rem;
  color: var(--tb-ink-500, #6B7280);
  margin: 0;
  padding: 0.5rem 0.75rem;
  background: #F8F8FB;
  border-radius: 8px;
  border-left: 3px solid var(--tb-primary-300, #A8A8E8);
}

.tb-fb__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.tb-fb__actions .tb-btn {
  padding: 0.625rem 1.125rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 0;
}
.tb-fb__actions .tb-btn--primary {
  background: var(--tb-primary-700, #1919C8);
  color: #fff;
}
.tb-fb__actions .tb-btn--primary:hover { background: var(--tb-primary-800, #1313A8); }
.tb-fb__actions .tb-btn--ghost {
  background: transparent;
  color: var(--tb-ink-700, #374151);
}
.tb-fb__actions .tb-btn--ghost:hover { background: var(--tb-line, #E7E7F2); }
.tb-fb__actions .tb-btn[disabled] { opacity: 0.6; cursor: not-allowed; }

.tb-fb__status {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9375rem;
  margin-top: 0.5rem;
}
.tb-fb__status.is-success { background: #E7F8EE; color: #166534; border: 1px solid #86EFAC; }
.tb-fb__status.is-error   { background: #FEF2F2; color: #991B1B; border: 1px solid #FCA5A5; }

@media (max-width: 540px) {
  .tb-fb__cats { grid-template-columns: repeat(2, 1fr); }
  .tb-fb__contact-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .tb-fb__backdrop, .tb-fb__panel { animation: none; }
  #tb-feedback-fab { transition: none; }
}

/* Print: kein FAB, kein Modal */
@media print {
  #tb-feedback-fab, #tb-feedback-modal { display: none !important; }
}
