/* ============================================================
 * Bona Vita® Portal — Welle 7.7
 * Vita / Anton Hinweis-Service · Bubble + Toast + Inline
 * ────────────────────────────────────────────────────────────
 * Themes:
 *   .bv-vita-bubble--vita   → Vita  (Charlotte) · weich, navy/champagner
 *   .bv-vita-bubble--anton  → Anton (Charon)    · würdig, anthrazit/gold
 *
 * Roger-Moore-Ton, Schweizer Hochdeutsch.
 * ============================================================ */

/* ─── Variablen (Bona Vita Markenfarben) ───────────────────── */
:root {
  --bv-vita-navy:       #1c2545;
  --bv-vita-champagner: #d4b88a;
  --bv-vita-creme:      #f8f4ec;
  --bv-vita-anthrazit:  #1a1d24;
  --bv-vita-gold:       #c9a25b;
  --bv-vita-bubble-shadow: 0 18px 48px rgba(28, 37, 69, 0.18),
                           0 4px 14px rgba(28, 37, 69, 0.10);
  --bv-vita-border-soft:   1px solid rgba(28, 37, 69, 0.08);
  --bv-vita-radius:        18px;
  --bv-vita-font:          'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bv-vita-serif:         'Cormorant Garamond', Georgia, 'Times New Roman', serif;
}

/* ============================================================
 * 1)  BUBBLE  — unten rechts, persistent bis User schliesst
 * ============================================================ */
.bv-vita-bubble {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9500;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: min(380px, calc(100vw - 48px));
  padding: 16px 18px 16px 16px;
  background: #ffffff;
  border: var(--bv-vita-border-soft);
  border-radius: var(--bv-vita-radius);
  box-shadow: var(--bv-vita-bubble-shadow);
  font-family: var(--bv-vita-font);
  color: #1f2433;
  animation: bvVitaBubbleIn 320ms cubic-bezier(.21, 1.02, .73, 1) both;
  transition: transform 220ms ease, opacity 220ms ease;
}
.bv-vita-bubble.is-closing {
  transform: translateY(8px);
  opacity: 0;
}

@keyframes bvVitaBubbleIn {
  0%   { opacity: 0; transform: translateY(18px) scale(.96); }
  100% { opacity: 1; transform: translateY(0)    scale(1); }
}

/* ─── Avatar ─────────────────────────────────────────────── */
.bv-vita-bubble__avatar {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--bv-vita-serif);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: 0.02em;
  color: #fff;
  user-select: none;
}
.bv-vita-bubble__avatar--vita {
  background: linear-gradient(135deg, #1c2545 0%, #2c3a6e 100%);
  box-shadow: 0 0 0 2px var(--bv-vita-creme),
              0 0 0 3px rgba(212, 184, 138, 0.55);
}
.bv-vita-bubble__avatar--anton {
  background: linear-gradient(135deg, #1a1d24 0%, #2c3038 100%);
  box-shadow: 0 0 0 2px #f6f1e6,
              0 0 0 3px rgba(201, 162, 91, 0.65);
}
.bv-vita-bubble__monogram { position: relative; z-index: 2; }

/* Subtiler Pulse-Ring (Live-Indikator) */
.bv-vita-bubble__pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  pointer-events: none;
  animation: bvVitaPulse 2.4s ease-out infinite;
}
.bv-vita-bubble--vita  .bv-vita-bubble__pulse { box-shadow: 0 0 0 0 rgba(212, 184, 138, .55); }
.bv-vita-bubble--anton .bv-vita-bubble__pulse { box-shadow: 0 0 0 0 rgba(201, 162, 91,  .60); }

@keyframes bvVitaPulse {
  0%   { box-shadow: 0 0 0 0 currentColor; }
  70%  { box-shadow: 0 0 0 14px rgba(0,0,0,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); }
}

/* ─── Body ───────────────────────────────────────────────── */
.bv-vita-bubble__body {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  padding-right: 18px; /* Platz für Close-Button */
}
.bv-vita-bubble__name {
  font-family: var(--bv-vita-serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bv-vita-navy);
  margin-bottom: 4px;
}
.bv-vita-bubble--anton .bv-vita-bubble__name { color: var(--bv-vita-anthrazit); }

.bv-vita-bubble__text {
  font-size: 14px;
  line-height: 1.5;
  color: #2a2f3d;
  word-wrap: break-word;
}

/* ─── Close ──────────────────────────────────────────────── */
.bv-vita-bubble__close {
  position: absolute;
  top: -4px;
  right: -2px;
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: #8a8e98;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 160ms, color 160ms;
}
.bv-vita-bubble__close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #1f2433;
}

/* ─── CTA-Button ─────────────────────────────────────────── */
.bv-vita-bubble__cta {
  margin-top: 12px;
  padding: 8px 14px;
  border: none;
  border-radius: 999px;
  background: var(--bv-vita-navy);
  color: var(--bv-vita-creme);
  font-family: var(--bv-vita-font);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 160ms, box-shadow 160ms, background 160ms;
}
.bv-vita-bubble__cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(28, 37, 69, 0.22);
}
.bv-vita-bubble--anton .bv-vita-bubble__cta {
  background: var(--bv-vita-anthrazit);
  color: var(--bv-vita-gold);
}
.bv-vita-bubble--anton .bv-vita-bubble__cta:hover {
  box-shadow: 0 6px 18px rgba(26, 29, 36, 0.30);
}

/* ─── Themed Akzent-Linie links ──────────────────────────── */
.bv-vita-bubble::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
}
.bv-vita-bubble--vita::before  { background: linear-gradient(180deg, var(--bv-vita-champagner), transparent); }
.bv-vita-bubble--anton::before { background: linear-gradient(180deg, var(--bv-vita-gold), transparent); }

/* ============================================================
 * 2)  TOAST  — oben rechts, auto-dismiss nach 3.5s
 * ============================================================ */
.bv-vita-toast-host {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9600;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.bv-vita-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 12px;
  background: #ffffff;
  border: var(--bv-vita-border-soft);
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(28, 37, 69, 0.16);
  font-family: var(--bv-vita-font);
  font-size: 13px;
  color: #1f2433;
  max-width: 360px;
  animation: bvVitaToastIn 280ms cubic-bezier(.21, 1.02, .73, 1) both;
}
.bv-vita-toast.is-closing {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 220ms, transform 220ms;
}
@keyframes bvVitaToastIn {
  0%   { opacity: 0; transform: translateY(-12px); }
  100% { opacity: 1; transform: translateY(0); }
}

.bv-vita-toast__monogram {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--bv-vita-serif);
  font-weight: 600;
  font-size: 13px;
  color: #fff;
}
.bv-vita-toast .bv-vita-bubble__avatar--vita,
.bv-vita-toast__monogram.bv-vita-bubble__avatar--vita {
  background: linear-gradient(135deg, #1c2545 0%, #2c3a6e 100%);
}
.bv-vita-toast .bv-vita-bubble__avatar--anton,
.bv-vita-toast__monogram.bv-vita-bubble__avatar--anton {
  background: linear-gradient(135deg, #1a1d24 0%, #2c3038 100%);
}
.bv-vita-toast__text {
  line-height: 1.4;
  word-wrap: break-word;
}

/* ============================================================
 * 3)  INLINE  — eingebettet im Tab/Banner (kein Audio)
 * ============================================================ */
.bv-vita-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin: 0 0 12px 0;
  background: #fbf9f4;
  border: 1px solid rgba(212, 184, 138, 0.40);
  border-left: 3px solid var(--bv-vita-champagner);
  border-radius: 10px;
  font-family: var(--bv-vita-font);
  font-size: 13.5px;
  color: #2a2f3d;
  animation: bvVitaInlineIn 240ms ease-out both;
}
.bv-vita-inline.is-closing {
  opacity: 0;
  transition: opacity 220ms;
}
@keyframes bvVitaInlineIn {
  0%   { opacity: 0; transform: translateY(-4px); }
  100% { opacity: 1; transform: translateY(0); }
}

.bv-vita-inline.bv-vita-bubble--anton {
  background: #fbf6ec;
  border-color: rgba(201, 162, 91, 0.45);
  border-left-color: var(--bv-vita-gold);
}

.bv-vita-inline__monogram {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--bv-vita-serif);
  font-weight: 600;
  font-size: 12px;
  color: #fff;
}
.bv-vita-inline__text {
  flex: 1 1 auto;
  line-height: 1.4;
}
.bv-vita-inline__close {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: #8a8e98;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 50%;
}
.bv-vita-inline__close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #1f2433;
}

/* ============================================================
 * 4)  Mobile / Reduced Motion
 * ============================================================ */
@media (max-width: 640px) {
  .bv-vita-bubble {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
    padding: 14px 14px 14px 12px;
    border-radius: 14px;
  }
  .bv-vita-bubble__avatar { width: 38px; height: 38px; font-size: 19px; }
  .bv-vita-bubble__name   { font-size: 14px; }
  .bv-vita-bubble__text   { font-size: 13.5px; }

  .bv-vita-toast-host { top: 10px; right: 10px; left: 10px; }
  .bv-vita-toast      { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .bv-vita-bubble,
  .bv-vita-toast,
  .bv-vita-inline       { animation: none; }
  .bv-vita-bubble__pulse { animation: none; }
}

/* ============================================================
 * 5)  BACKUP-BUTTONS  (Welle 7.7 — bv-data-backup.js)
 * ============================================================ */
.bv-backup-button {
  margin: 0 0 16px 0;
  padding: 14px 16px;
  background: linear-gradient(135deg, #fbf9f4 0%, #fff 100%);
  border: 1px solid rgba(212, 184, 138, 0.45);
  border-left: 3px solid var(--bv-vita-champagner);
  border-radius: 12px;
  font-family: var(--bv-vita-font);
}
.bv-backup-button__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.bv-backup-button__head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
}
.bv-backup-button__icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bv-vita-navy);
  color: var(--bv-vita-creme);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.bv-backup-button__title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--bv-vita-navy);
  line-height: 1.3;
}
.bv-backup-button__sub {
  font-size: 12.5px;
  color: #5a6075;
  margin-top: 2px;
}
.bv-backup-button__cta {
  flex: 0 0 auto;
  padding: 8px 16px;
  background: var(--bv-vita-navy);
  color: var(--bv-vita-creme);
  border: none;
  border-radius: 999px;
  font-family: var(--bv-vita-font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 160ms, box-shadow 160ms;
}
.bv-backup-button__cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(28, 37, 69, 0.22);
}

.bv-backup-owner-row {
  margin-top: 14px;
  padding: 12px 14px;
  background: #fbf6ec;
  border: 1px solid rgba(201, 162, 91, 0.45);
  border-left: 3px solid var(--bv-vita-gold);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-family: var(--bv-vita-font);
  font-size: 13.5px;
  color: #2a2f3d;
  flex-wrap: wrap;
}
.bv-backup-owner-row strong {
  color: var(--bv-vita-anthrazit);
}
.bv-backup-owner-row__cta {
  padding: 7px 14px;
  background: var(--bv-vita-anthrazit);
  color: var(--bv-vita-gold);
  border: none;
  border-radius: 999px;
  font-family: var(--bv-vita-font);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 160ms, box-shadow 160ms;
}
.bv-backup-owner-row__cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(26, 29, 36, 0.30);
}

@media (max-width: 640px) {
  .bv-backup-button__cta,
  .bv-backup-owner-row__cta { width: 100%; }
}
