/* Lbayk Feedback Floating Button & Modal */
.lbf-fab {
  position: fixed;
  inset-inline-end: 0;
  top: 62%;
  transform: translateY(-50%);
  z-index: 1010;
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  width: 3rem;
  min-width: 3rem;
  height: 3rem;
  padding: 0 0.7rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-inline-end: 0;
  border-start-start-radius: 999px;
  border-end-start-radius: 999px;
  background: var(--so-primary, #087F72);
  color: #ffffff;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(8, 127, 114, 0.28);
  transition: width 0.2s ease, gap 0.2s ease, transform 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.lbf-fab:hover,
.lbf-fab:focus-visible {
  background: #06665b;
  transform: translateY(-50%) scale(1.03);
  box-shadow: 0 10px 28px rgba(8, 127, 114, 0.38);
}

@media (hover: hover) and (min-width: 721px) {
  .lbf-fab:hover,
  .lbf-fab:focus-visible {
    width: max-content;
    gap: 0.45rem;
  }
}

.lbf-fab:focus-visible {
  outline: 3px solid #ffd56a;
  outline-offset: 2px;
}

.lbf-fab__icon {
  flex-shrink: 0;
}

.lbf-fab__label {
  white-space: nowrap;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-width 0.2s ease, opacity 0.15s ease;
}

@media (hover: hover) and (min-width: 721px) {
  .lbf-fab:hover .lbf-fab__label,
  .lbf-fab:focus-visible .lbf-fab__label {
    max-width: 18rem;
    opacity: 1;
  }
}

@media (max-width: 720px) {
  .lbf-fab {
    top: auto;
    bottom: calc(9.5rem + env(safe-area-inset-bottom));
    transform: none;
    padding: 0.55rem 0.65rem;
  }

  .lbf-fab:hover,
  .lbf-fab:focus-visible {
    transform: scale(1.04);
  }

  .lbf-fab__label {
    display: none;
  }
}

/* Gin's frontend secondary toolbar duplicates the admin toolbar on site pages. */
.gin-secondary-toolbar.gin-secondary-toolbar--frontend {
  display: none !important;
}

/* Brand the Lbayk admin entry without changing its translated text label. */
a.lbf-admin-brand-link::before {
  content: "";
  display: inline-block;
  width: 1.2rem;
  height: 1.2rem;
  margin-inline-end: 0.5rem;
  vertical-align: middle;
  background: url("/themes/custom/saudione_theme/logo.svg") center / contain no-repeat;
}

.lbf-modal[hidden],
[data-lbf-bug-fields][hidden],
[data-lbf-preview][hidden],
[data-lbf-error][hidden],
[data-lbf-success][hidden] {
  display: none !important;
}

.lbf-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.lbf-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(2px);
}

.lbf-modal__dialog {
  position: relative;
  width: min(640px, 100%);
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: #ffffff;
  color: #162b3a;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.3);
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.lbf-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.lbf-modal__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
}

.lbf-modal__subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: #475569;
}

.lbf-modal__close {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #334155;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lbf-modal__close:hover,
.lbf-modal__close:focus-visible {
  background: #f1f5f9;
  color: #0f172a;
  outline: 2px solid var(--so-primary, #087F72);
}

.lbf-modal__body {
  padding: 1.15rem 1.35rem 1.35rem;
  overflow-y: auto;
}

.lbf-url-pill {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.75rem;
  margin-bottom: 1rem;
  border-radius: 10px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-size: 0.8rem;
}

.lbf-url-pill__label {
  font-weight: 700;
  color: #334155;
}

.lbf-url-pill__value {
  word-break: break-all;
  color: #0f766e;
  direction: ltr;
  unicode-bidi: isolate;
}

.lbf-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.lbf-hp {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.lbf-form__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

@media (max-width: 600px) {
  .lbf-form__row {
    grid-template-columns: 1fr;
  }
}

.lbf-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.lbf-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1e293b;
}

.lbf-req {
  color: #dc2626;
}

.lbf-input,
.lbf-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.6rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  font: inherit;
  font-size: 0.92rem;
}

.lbf-input:focus,
.lbf-textarea:focus {
  outline: 2px solid var(--so-primary, #087F72);
  border-color: var(--so-primary, #087F72);
}

.lbf-bug-fields {
  margin: 0;
  padding: 0.9rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.lbf-bug-fields__legend {
  padding: 0 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f766e;
}

.lbf-file-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.45rem 0.65rem;
  border: 1px dashed #94a3b8;
  border-radius: 8px;
  background: #f8fafc;
  color: #0f172a;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

.lbf-file-input:focus-visible {
  outline: 2px solid var(--so-primary, #087F72);
  border-color: var(--so-primary, #087F72);
}

.lbf-file-hint {
  margin: 0;
  font-size: 0.78rem;
  color: #64748b;
}

.lbf-file-preview {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
}

.lbf-file-preview__img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  flex-shrink: 0;
}

.lbf-file-preview__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.85rem;
  font-weight: 600;
}

.lbf-file-preview__remove {
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.lbf-error {
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 0.875rem;
  font-weight: 600;
}

.lbf-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  padding-top: 0.5rem;
  border-top: 1px solid #e2e8f0;
}

.lbf-btn {
  padding: 0.62rem 1.15rem;
  border-radius: 9px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
}

.lbf-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.lbf-btn--primary {
  background: var(--so-primary, #087F72);
  color: #ffffff;
}

.lbf-btn--primary:hover,
.lbf-btn--primary:focus-visible {
  background: #06665b;
}

.lbf-btn--secondary {
  background: #ffffff;
  color: #334155;
  border-color: #cbd5e1;
}

.lbf-btn--secondary:hover,
.lbf-btn--secondary:focus-visible {
  background: #f1f5f9;
}

.lbf-success {
  text-align: center;
  padding: 1.5rem 0.75rem;
}

.lbf-success__icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 0.75rem;
  border-radius: 50%;
  background: #dcfce7;
  color: #15803d;
  font-size: 1.5rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lbf-success__title {
  margin: 0 0 0.45rem;
  font-size: 1.15rem;
  color: #0f172a;
}

.lbf-success__copy {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  color: #475569;
}

.lbf-success__meta {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  padding: 0.65rem 1rem;
  margin-bottom: 1.25rem;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 0.9rem;
}

.lbf-status-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-weight: 700;
}

.lbf-success__actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

/* Dark mode support */
[data-theme="dark"] .lbf-modal__dialog,
:root[data-theme="dark"] .lbf-modal__dialog,
.gin--dark-mode .lbf-modal__dialog {
  background: #0f172a;
  color: #f1f5f9;
  border-color: #334155;
}

[data-theme="dark"] .lbf-modal__header,
.gin--dark-mode .lbf-modal__header {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .lbf-modal__title,
[data-theme="dark"] .lbf-label,
[data-theme="dark"] .lbf-success__title,
.gin--dark-mode .lbf-modal__title,
.gin--dark-mode .lbf-label,
.gin--dark-mode .lbf-success__title {
  color: #f8fafc;
}

[data-theme="dark"] .lbf-modal__subtitle,
[data-theme="dark"] .lbf-success__copy,
[data-theme="dark"] .lbf-url-pill__label,
.gin--dark-mode .lbf-modal__subtitle,
.gin--dark-mode .lbf-success__copy,
.gin--dark-mode .lbf-url-pill__label {
  color: #cbd5e1;
}

[data-theme="dark"] .lbf-url-pill,
[data-theme="dark"] .lbf-bug-fields,
[data-theme="dark"] .lbf-success__meta,
.gin--dark-mode .lbf-url-pill,
.gin--dark-mode .lbf-bug-fields,
.gin--dark-mode .lbf-success__meta {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .lbf-url-pill__value,
.gin--dark-mode .lbf-url-pill__value {
  color: #5eead4;
}

[data-theme="dark"] .lbf-input,
[data-theme="dark"] .lbf-textarea,
[data-theme="dark"] .lbf-file-input,
[data-theme="dark"] .lbf-file-preview,
[data-theme="dark"] .lbf-modal__close,
[data-theme="dark"] .lbf-btn--secondary,
.gin--dark-mode .lbf-input,
.gin--dark-mode .lbf-textarea,
.gin--dark-mode .lbf-file-input,
.gin--dark-mode .lbf-file-preview,
.gin--dark-mode .lbf-modal__close,
.gin--dark-mode .lbf-btn--secondary {
  background: #0f172a;
  color: #f8fafc;
  border-color: #475569;
}

[data-theme="dark"] .lbf-file-hint,
.gin--dark-mode .lbf-file-hint {
  color: #94a3b8;
}

@media (prefers-color-scheme: dark) {
  body:not([data-theme="light"]) .lbf-modal__dialog {
    background: #0f172a;
    color: #f1f5f9;
    border-color: #334155;
  }
  body:not([data-theme="light"]) .lbf-modal__header {
    background: #1e293b;
    border-color: #334155;
  }
  body:not([data-theme="light"]) .lbf-modal__title,
  body:not([data-theme="light"]) .lbf-label,
  body:not([data-theme="light"]) .lbf-success__title {
    color: #f8fafc;
  }
  body:not([data-theme="light"]) .lbf-url-pill,
  body:not([data-theme="light"]) .lbf-bug-fields,
  body:not([data-theme="light"]) .lbf-success__meta {
    background: #1e293b;
    border-color: #334155;
  }
  body:not([data-theme="light"]) .lbf-input,
  body:not([data-theme="light"]) .lbf-textarea,
  body:not([data-theme="light"]) .lbf-file-input,
  body:not([data-theme="light"]) .lbf-file-preview,
  body:not([data-theme="light"]) .lbf-modal__close,
  body:not([data-theme="light"]) .lbf-btn--secondary {
    background: #0f172a;
    color: #f8fafc;
    border-color: #475569;
  }
  body:not([data-theme="light"]) .lbf-file-hint {
    color: #94a3b8;
  }
}

@media print {
  .lbf-fab,
  .lbf-modal {
    display: none !important;
  }
}
