/* FinanzHub — Bon-Scanner Styles
   Floating Camera-FAB + Bottom-Sheet-Modal + Toast.
   Sichtbarkeit: nur Mobile (≤768px) für den FAB. Modal ist auf jeder
   Bildschirmgröße responsive (max-width 520px, zentriert auf Desktop,
   Bottom-Sheet auf Mobile). */

#bon-scanner-root { position: fixed; z-index: 95; pointer-events: none; inset: 0; }
#bon-scanner-root > * { pointer-events: auto; }

/* ───── FAB (Camera) ─────
   Standard: hidden. Auf Mobile (≤768px) sichtbar.
   Stapelt sich über dem existierenden + FAB (lime-fab sitzt bei bottom:24px,
   58px Größe). Wir setzen bottom:96px damit 14px Abstand zwischen den beiden. */
.bon-scan-fab {
  display: none;
  position: fixed;
  /* Zentriert horizontal über dem 64×64 lime-fab (right:32px), 14px Abstand vertikal. */
  right: 38px;
  bottom: 110px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #1a1a1a;
  border: 2px solid var(--lime, #b6f84c);
  color: var(--lime, #b6f84c);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 28px rgba(0,0,0,.5),
              0 0 18px rgba(182, 248, 76, 0.32),
              0 2px 6px rgba(255,255,255,.05) inset;
  transition: transform .18s cubic-bezier(.34,1.56,.64,1), box-shadow .18s, border-color .18s;
  font-family: inherit;
}
.bon-scan-fab svg { width: 24px; height: 24px; }
.bon-scan-fab:hover { transform: translateY(-2px) scale(1.04); }
.bon-scan-fab:active { transform: translateY(0) scale(0.98); }

/* Kamera-FAB nur auf Transaktionen-Page sichtbar (vorher: überall auf Mobile).
   Default ist display:none — siehe oben. Hier explizit nur für .view-transactions. */
@media (max-width: 768px) {
  body.view-transactions .bon-scan-fab { display: flex; }
}
/* Auf Desktop weiterhin generell hidden — der Bon-Scanner ist eine Mobile-only
   Feature. Falls Desktop-User ihn brauchen, könnte man hier eine Upload-Variante
   einbauen. */

/* Lime-Theme-spezifisches Tuning — passt Akzentfarbe an Theme an */
body.theme-lime .bon-scan-fab {
  border-color: var(--lime, #b6f84c);
  color: var(--lime, #b6f84c);
  box-shadow: 0 8px 28px rgba(0,0,0,.55), 0 0 22px rgba(182, 248, 76, 0.42);
}

/* ───── Modal ───── */
.bon-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.bon-modal[hidden] { display: none; }
.bon-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: bon-fade-in .2s ease-out;
}
@keyframes bon-fade-in { from { opacity: 0; } to { opacity: 1; } }

.bon-modal-sheet {
  position: relative;
  z-index: 1;
  background: #111;
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 22px 22px 30px;
  animation: bon-slide-up .28s cubic-bezier(.22,.61,.36,1);
  box-shadow: 0 -8px 40px rgba(0,0,0,.55);
}
@keyframes bon-slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* Desktop: Modal zentrieren statt Bottom-Sheet */
@media (min-width: 769px) {
  .bon-modal { align-items: center; }
  .bon-modal-sheet {
    border-radius: 20px;
    max-height: 88vh;
    margin: 0 16px;
  }
}

body.bon-modal-open { overflow: hidden; }

/* ───── Loading-State ───── */
.bon-loading {
  text-align: center;
  padding: 60px 20px 30px;
  color: rgba(250,250,247,.78);
}
.bon-spinner {
  width: 42px;
  height: 42px;
  border: 3px solid rgba(255,255,255,.10);
  border-top-color: var(--lime, #b6f84c);
  border-radius: 50%;
  animation: bon-spin .85s linear infinite;
  margin: 0 auto 18px;
}
@keyframes bon-spin { to { transform: rotate(360deg); } }
.bon-loading-text {
  font: 600 15px/1.3 Manrope, Inter, sans-serif;
  color: rgba(250,250,247,.92);
  margin: 0 0 6px;
}
.bon-loading-sub {
  font: 500 12.5px/1.3 Manrope, Inter, sans-serif;
  color: rgba(250,250,247,.5);
  margin: 0;
}

/* ───── Error-State ───── */
.bon-error {
  padding: 24px 6px 6px;
  text-align: center;
}
.bon-error-icon {
  font-size: 32px;
  margin-bottom: 12px;
  color: var(--accent);
}
.bon-error h3 {
  font: 700 17px/1.2 Manrope, Inter, sans-serif;
  color: rgba(250,250,247,.95);
  margin: 0 0 8px;
}
.bon-error p {
  font: 500 13.5px/1.45 Manrope, Inter, sans-serif;
  color: rgba(250,250,247,.7);
  margin: 0 0 22px;
  white-space: pre-wrap;
}

/* ───── Result-State ───── */
.bon-result-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.bon-result-tag {
  font: 700 11px/1 Manrope, Inter, sans-serif;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #0a0a0a;
  background: var(--lime, #b6f84c);
  padding: 6px 10px;
  border-radius: 999px;
}
.bon-result-close {
  background: transparent;
  border: none;
  color: rgba(250,250,247,.55);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  font-family: inherit;
}
.bon-result-close:hover { color: rgba(250,250,247,.95); }

.bon-preview {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 16px;
  background: #050505;
}

.bon-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bon-lbl {
  display: block;
  font: 500 11.5px/1 Manrope, Inter, sans-serif;
  color: rgba(250,250,247,.55);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 14px 0 6px;
}
.bon-lbl-opt {
  text-transform: none;
  letter-spacing: 0;
  color: rgba(250,250,247,.35);
  font-weight: 500;
}
.bon-inp {
  width: 100%;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  color: rgba(250,250,247,.95);
  padding: 12px 14px;
  /* 16px verhindert iOS-Auto-Zoom auf Input-Focus */
  font: 500 16px/1.2 Manrope, Inter, sans-serif;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color .15s, background .15s;
}
.bon-inp:focus {
  outline: none;
  border-color: var(--lime, #b6f84c);
  background: #1f1f1f;
}
.bon-select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23b6f84c' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.bon-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}
.bon-btn {
  flex: 1;
  padding: 14px;
  border-radius: 11px;
  font: 600 15px/1 Manrope, Inter, sans-serif;
  cursor: pointer;
  transition: background .15s, color .15s, transform .12s;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.bon-btn-ghost {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  color: rgba(250,250,247,.65);
}
.bon-btn-ghost:hover { background: #222; color: rgba(250,250,247,.95); }

.bon-btn-primary {
  flex: 2;
  background: var(--lime, #b6f84c);
  border: 0;
  color: #0a0a0a;
  font-weight: 700;
}
.bon-btn-primary:hover { transform: translateY(-1px); }
.bon-btn-primary:active { transform: translateY(0); }

/* ───── Toast ───── */
.bon-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: #1a1a1a;
  color: rgba(250,250,247,.95);
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid var(--lime, #b6f84c);
  box-shadow: 0 10px 32px rgba(0,0,0,.6), 0 0 16px rgba(182,248,76,.22);
  font: 600 13.5px/1.2 Manrope, Inter, sans-serif;
  z-index: 250;
  opacity: 0;
  transition: opacity .25s ease-out, transform .25s ease-out;
  pointer-events: none;
}
.bon-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
@media (max-width: 768px) {
  .bon-toast {
    bottom: 88px; /* über der Bottom-Nav */
    font-size: 13px;
    padding: 11px 18px;
  }
}
