/* ============================================================
   FindBird Portal-Design, kundenneutral.
   Alle Farben kommen aus Variablen. Die Kundenwerte erzeugt das Portal
   beim Start aus BRAND_* in /findbird-static/theme.css (wird NACH dieser
   Datei geladen und überschreibt die Standardwerte unten).
   Aufbau: helle Kopfzeile, Pillen-Navigation, große Suche, runde Buttons.
   Schrift Inter wird selbst ausgeliefert (kein Google Fonts).
   ============================================================ */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("/findbird-static/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("/findbird-static/fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600 800; font-display: swap; src: url("/findbird-static/fonts/inter-latin-600-normal.woff2") format("woff2"); }

/* Standardwerte (neutral), werden von theme.css überschrieben */
:root,
[data-bs-theme] {
  --fb-primary: #3f7a0e;
  --fb-primary-dark: #33640b;
  --fb-accent: #78b928;
  --fb-accent-soft: #eef6e4;
  --fb-text: #1e2328;
  --fb-muted: #454d57;
  --fb-bg: #eceeea;
  --fb-surface: #ffffff;
  --fb-line: #c9cfc6;
  /* Ränder von Eingabefeldern: mindestens 3:1 auf Weiß (WCAG 1.4.11) */
  --fb-field: #7a8478;
  --fb-on-primary: #ffffff;
  --fb-radius: 12px;
  --fb-shadow: 0 1px 2px rgba(30, 35, 40, 0.06), 0 4px 14px rgba(30, 35, 40, 0.06);
  --pngx-primary: 93, 79%;
  --pngx-primary-lightness: 27%;
}

[data-bs-theme="light"] body,
body:not([data-bs-theme]) {
  --bs-body-color: var(--fb-text);
  --bs-body-bg: var(--fb-bg);
  --bs-border-radius: var(--fb-radius);
  --bs-link-color: var(--fb-primary);
  --bs-link-hover-color: var(--fb-primary-dark);
  --bs-secondary-color: var(--fb-muted);
}
/* Eingabefelder in Paperless: deutlicher Rand, Fokus in Primärfarbe */
.form-control,
.form-select,
.ng-select .ng-select-container {
  border-color: var(--fb-field) !important;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--fb-primary) !important;
  box-shadow: 0 0 0 3px var(--fb-accent-soft) !important;
}
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif !important;
}
.card {
  border-color: var(--fb-line);
  border-radius: var(--fb-radius);
}
.btn {
  border-radius: 999px;
}
.btn-primary {
  --bs-btn-bg: var(--fb-primary);
  --bs-btn-border-color: var(--fb-primary);
  --bs-btn-color: var(--fb-on-primary);
  --bs-btn-hover-bg: var(--fb-primary-dark);
  --bs-btn-hover-border-color: var(--fb-primary-dark);
  --bs-btn-hover-color: var(--fb-on-primary);
  --bs-btn-active-bg: var(--fb-primary-dark);
  --bs-btn-active-border-color: var(--fb-primary-dark);
  font-weight: 600;
}
:focus-visible {
  outline: 3px solid var(--fb-primary) !important;
  outline-offset: 2px;
}

/* ---------- Helle Kopfzeile ---------- */
.navbar.bg-primary {
  min-height: 4.2rem;
  background: var(--fb-surface) !important;
  border-bottom: 1px solid var(--fb-line);
  box-shadow: none;
}
.navbar.bg-primary,
.navbar.bg-primary .nav-link,
.navbar.bg-primary .navbar-action,
.navbar.bg-primary .btn,
.navbar.bg-primary .navbar-toggler {
  color: var(--fb-text) !important;
  --pngx-primary-text-contrast: var(--fb-text);
}
.navbar.bg-primary .navbar-toggler-icon {
  filter: invert(1);
}

/* Logo und Name oben links */
.navbar-brand > *:not(#fb-brand) {
  display: none !important;
}
#fb-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px;
  margin: 6px 0;
}
#fb-brand img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  flex-shrink: 0;
}
.fb-word {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.1;
}
.fb-word .fb-name {
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.3px;
  color: var(--fb-text);
}
.fb-word .fb-product {
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fb-primary);
}

/* ---------- Kleine Suche oben ---------- */
pngx-global-search {
  flex-grow: 1;
}
pngx-global-search form .form-control {
  min-height: 2.9rem !important;
  border-radius: 999px !important;
  background-color: var(--fb-surface) !important;
  border: 2px solid var(--fb-field) !important;
  padding-left: 2.6rem !important;
  font-size: 1.05rem !important;
  box-shadow: none;
}
pngx-global-search form .form-control:focus-within {
  border-color: var(--fb-primary) !important;
  background-color: var(--fb-surface) !important;
  padding-left: 1.1rem !important;
}
pngx-global-search form .form-control > input {
  color: var(--fb-text) !important;
}
pngx-global-search form .form-control > input::placeholder {
  color: var(--fb-muted) !important;
}
pngx-global-search form > i-bs[name="search"] {
  color: var(--fb-muted) !important;
  left: 1rem !important;
  top: 0.95rem !important;
  z-index: 5;
}
pngx-global-search .input-group .btn {
  border-radius: 999px !important;
  margin-left: 0.5rem !important;
  background-color: var(--fb-primary) !important;
  border-color: var(--fb-primary) !important;
  color: var(--fb-on-primary) !important;
  font-weight: 600;
  padding-left: 1.2rem !important;
  padding-right: 1.2rem !important;
}
body.fb-dash pngx-global-search {
  visibility: hidden;
  pointer-events: none;
}

/* ---------- Große Suche auf der Startseite ---------- */
#fb-hero {
  margin: 0.5rem 0 2rem 0;
  padding: 2.4rem 2.2rem 2rem;
  border-radius: calc(var(--fb-radius) + 6px);
  background: var(--fb-accent-soft);
  border: 1px solid var(--fb-line);
  color: var(--fb-text);
}
#fb-hero h2 {
  font-family: Inter, system-ui, sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 0 0 1.3rem 0;
  color: var(--fb-text);
}
#fb-hero form {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
#fb-hero .fb-input {
  flex: 1 1 22rem;
  min-height: 3.6rem;
  font-size: 1.2rem;
  padding: 0 1.4rem;
  border-radius: 999px;
  border: 2px solid var(--fb-field);
  outline: none;
  color: var(--fb-text);
  background: var(--fb-surface);
  transition: border-color 0.15s ease;
}
#fb-hero .fb-input:focus {
  border-color: var(--fb-primary);
}
#fb-hero .fb-cat {
  flex: 0 1 15rem;
  min-height: 3.6rem;
  font-size: 1rem;
  padding: 0 1rem;
  border-radius: 999px;
  border: 2px solid var(--fb-field);
  outline: none;
  color: var(--fb-text);
  background: var(--fb-surface);
  cursor: pointer;
}
#fb-hero .fb-btn {
  flex: 0 0 auto;
  min-height: 3.6rem;
  padding: 0 2rem;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 999px;
  border: none;
  color: var(--fb-on-primary);
  background: var(--fb-primary);
  cursor: pointer;
}
#fb-hero .fb-btn:hover {
  background: var(--fb-primary-dark);
}
#fb-hero .fb-hint {
  margin-top: 0.9rem;
  font-size: 0.9rem;
  color: var(--fb-muted);
}
@media (max-width: 576px) {
  #fb-hero { padding: 1.4rem 1rem; }
  #fb-hero .fb-cat, #fb-hero .fb-btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  #fb-hero .fb-input { transition: none; }
}

/* ---------- Menü: Verwaltung nur über das Zahnrad ---------- */
#sidebarMenu .nav-group.fb-admin {
  display: none !important;
}
body.fb-admin-open #sidebarMenu .nav-group.fb-admin {
  display: block !important;
}
#sidebarMenu .nav-link.active {
  color: var(--fb-primary) !important;
  background: var(--fb-accent-soft) !important;
  border-radius: 999px;
  font-weight: 600;
}
#fb-gear {
  color: var(--fb-text);
  opacity: 0.85;
  border-radius: 999px !important;
}
#fb-gear:hover,
#fb-gear.active {
  opacity: 1;
  background: var(--fb-accent-soft);
  color: var(--fb-primary);
}

/* ============================================================
   Anmeldeseite: links Markenfläche in Primärfarbe, rechts Formular
   ============================================================ */
html:not(.fb-auth-ready) body.text-center > .position-absolute {
  opacity: 0;
  animation: fb-show 0s 1.5s forwards;
}
@keyframes fb-show { to { opacity: 1; } }

body:has(#fb-auth) {
  margin: 0;
  text-align: left;
  background: var(--fb-bg);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--fb-text);
}
#fb-auth {
  text-align: left !important;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}
.fb-auth-side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 56px 40px 110px;
  background: linear-gradient(160deg, var(--fb-primary) 0%, var(--fb-primary-dark) 100%);
  color: var(--fb-on-primary);
}
/* Anzeige im linken Bereich: voll sichtbar, zentriert, Logo-Box darüber */
#fb-auth.fb-has-ad .fb-auth-side {
  position: relative;
  overflow: hidden;
  background: var(--fb-login-bg, var(--fb-primary));
}
.fb-auth-ad {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  z-index: 0;
}
#fb-auth.fb-has-ad .fb-auth-brand,
#fb-auth.fb-has-ad .fb-auth-pitch {
  position: relative;
  z-index: 1;
}
#fb-auth.fb-ad-only .fb-auth-pitch {
  display: none;
}
.fb-auth-brand {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 14px;
  background: var(--fb-surface);
  border-radius: calc(var(--fb-radius) + 8px);
  padding: 10px 22px 10px 10px;
  box-shadow: var(--fb-shadow);
}
.fb-auth-brand img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
}
.fb-auth-brand .fb-name { font-size: 1.6rem; }
.fb-auth-pitch h2 {
  font-weight: 800;
  font-size: 2.6rem;
  letter-spacing: -1px;
  line-height: 1.1;
  color: var(--fb-on-primary);
  margin: 0 0 18px;
}
.fb-auth-pitch p {
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--fb-on-primary);
  opacity: 0.92;
  max-width: 34rem;
  margin: 0 0 28px;
}
.fb-auth-pitch ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.fb-auth-pitch li {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 1.15rem;
  color: var(--fb-on-primary);
  margin: 0 0 14px;
}
.fb-check {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--fb-accent);
  color: var(--fb-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.fb-auth-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.fb-auth-mobile { display: none; }
.fb-auth-card {
  width: 100%;
  max-width: 500px;
  background: var(--fb-surface);
  border: 1px solid var(--fb-line);
  border-radius: calc(var(--fb-radius) + 8px);
  padding: 44px;
  box-shadow: var(--fb-shadow);
}
#fb-auth .form-accounts {
  max-width: none;
  width: 100%;
  padding: 0;
  margin: 0;
}
#fb-auth h1 {
  font-weight: 800;
  font-size: 2rem;
  color: var(--fb-text);
  margin: 0 0 26px;
}
#fb-auth .fb-auth-lead {
  font-size: 1.05rem;
  color: var(--fb-muted);
  margin: 0 0 22px;
}
#fb-auth .fb-field {
  margin: 0 0 20px;
}
#fb-auth .fb-field label {
  display: block;
  font-weight: 600;
  font-size: 1rem;
  color: var(--fb-text);
  margin: 0 0 8px;
}
#fb-auth .form-control {
  height: 56px;
  border-radius: var(--fb-radius) !important;
  border: 2px solid var(--fb-field);
  background: var(--fb-surface);
  font-size: 1rem;
  padding: 0 16px;
  color: var(--fb-text);
  box-shadow: none;
}
#fb-auth .form-control:focus {
  background: var(--fb-surface);
  border-color: var(--fb-primary);
  box-shadow: none;
}
#fb-auth .fb-pw {
  position: relative;
  display: block;
}
#fb-auth .fb-pw .form-control {
  padding-right: 52px;
}
#fb-auth .fb-eye {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--fb-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
#fb-auth .fb-eye:hover,
#fb-auth .fb-eye.on {
  color: var(--fb-primary);
}
#fb-auth .d-grid {
  margin-top: 28px !important;
}
#fb-auth .btn-primary {
  height: 56px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1.15rem;
  background-color: var(--fb-primary) !important;
  border-color: var(--fb-primary) !important;
  color: var(--fb-on-primary) !important;
}
#fb-auth .btn-primary:hover {
  background-color: var(--fb-primary-dark) !important;
  border-color: var(--fb-primary-dark) !important;
}
#fb-auth .alert {
  border-radius: var(--fb-radius);
  text-align: left;
}
#fb-auth a {
  color: var(--fb-primary);
  font-weight: 600;
  text-decoration: none;
}
@media (max-width: 900px) {
  #fb-auth { grid-template-columns: 1fr; }
  .fb-auth-side { display: none; }
  .fb-auth-main {
    justify-content: flex-start;
    padding: 40px 16px;
    background: linear-gradient(180deg, var(--fb-accent-soft) 0%, var(--fb-bg) 45%);
  }
  .fb-auth-mobile { display: flex; margin: 0 0 28px; }
  .fb-auth-card { padding: 28px 22px; }
}
