/* ═══════════════════════════════════════════════════════════════════
   Feedback Widget
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --fb-brand:      #00548f;
  --fb-brand-dark: #003c66;
  --fb-red:        #ef4444;
  --fb-gray-50:    #f9fafb;
  --fb-gray-200:   #e5e7eb;
  --fb-gray-500:   #6b7280;
  --fb-gray-700:   #374151;
  --fb-green-50:   #ecfdf5;
  --fb-green-700:  #047857;
  --fb-red-50:     #fef2f2;
  --fb-red-700:    #b91c1c;
}

/* ── Tab (right-edge trigger) ─────────────────────────────────────── */
/* !important guards against host-page button resets (e.g., the login
 * page sets `button { width: 100% }` globally, which would stretch the
 * tab across the screen). */
.fb-tab {
  position: fixed !important;
  top: 50% !important;
  right: 0 !important;
  left: auto !important;
  bottom: auto !important;
  transform: translateY(-50%) !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  background: var(--fb-brand) !important;
  color: #fff !important;
  border: 0 !important;
  border-radius: 8px 0 0 8px !important;
  padding: 12px 4px 14px 4px !important;
  cursor: pointer;
  z-index: 2147483000 !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-shadow: -2px 2px 8px rgba(0, 0, 0, 0.15);
  transition: background 0.15s ease, padding-right 0.15s ease;
  font-family: inherit;
  font-size: 13px !important;
  line-height: 1 !important;
}
.fb-tab:hover {
  background: var(--fb-brand-dark);
  padding-right: 6px;
}
.fb-tab:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -3px;
}
.fb-tab-icon {
  width: 20px;
  height: 20px;
}
.fb-tab-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* The [hidden] attribute must win over class-level display rules below. */
.fb-tab[hidden],
.fb-overlay[hidden],
.fb-shot-btn[hidden],
.fb-shot-wrap[hidden],
.fb-banner[hidden] { display: none !important; }

/* ── Modal overlay + panel ────────────────────────────────────────── */
.fb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  z-index: 2147483001;
  display: flex;
  justify-content: flex-end;
}
.fb-panel {
  width: 460px;
  max-width: 100vw;
  height: 100%;
  background: #fff;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  animation: fb-slide-in 0.2s ease-out;
}
@keyframes fb-slide-in {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

.fb-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--fb-gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  flex-shrink: 0;
}
.fb-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--fb-gray-700);
  margin: 0;
}
.fb-close {
  background: var(--fb-gray-50);
  border: 1px solid var(--fb-gray-200);
  border-radius: 999px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--fb-gray-500);
  line-height: 1;
  font-family: inherit;
}
.fb-close:hover { color: var(--fb-gray-700); background: #fff; border-color: var(--fb-gray-500); }
.fb-close:disabled { opacity: 0.4; cursor: not-allowed; }

.fb-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 14px;
  color: var(--fb-gray-700);
}
.fb-lede {
  color: var(--fb-gray-500);
  font-size: 13px;
  margin: -6px 0 0;
  line-height: 1.45;
}

.fb-field { display: flex; flex-direction: column; gap: 6px; }
.fb-label { font-weight: 600; font-size: 13px; }
.fb-textarea {
  width: 100%;
  min-height: 120px;
  padding: 10px 12px;
  border: 1px solid var(--fb-gray-200);
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  color: var(--fb-gray-700);
}
.fb-textarea:focus {
  outline: 2px solid var(--fb-brand);
  outline-offset: -1px;
  border-color: var(--fb-brand);
}

/* ── Screenshot area ──────────────────────────────────────────────── */
.fb-shot-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px dashed var(--fb-gray-200);
  background: var(--fb-gray-50);
  border-radius: 6px;
  font-size: 13px;
  color: var(--fb-gray-700);
  cursor: pointer;
  font-family: inherit;
  width: fit-content;
}
.fb-shot-btn:hover { border-color: var(--fb-brand); color: var(--fb-brand); }
.fb-shot-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.fb-shot-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fb-canvas {
  width: 100%;
  max-width: 420px;
  height: auto;
  border: 1px solid var(--fb-gray-200);
  border-radius: 6px;
  cursor: crosshair;
  display: block;
  background: #fff;
}
.fb-shot-actions {
  display: flex;
  gap: 10px;
  font-size: 12px;
}
.fb-link-btn {
  background: transparent;
  border: 0;
  color: var(--fb-brand);
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  font-size: 12px;
  text-decoration: underline;
}
.fb-link-btn:hover { color: var(--fb-brand-dark); }

/* ── Banners ──────────────────────────────────────────────────────── */
.fb-banner {
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.4;
}
.fb-banner-error {
  background: var(--fb-red-50);
  color: var(--fb-red-700);
  border: 1px solid #fecaca;
}
.fb-banner-success {
  background: var(--fb-green-50);
  color: var(--fb-green-700);
  border: 1px solid #a7f3d0;
}

/* ── Footer + submit ──────────────────────────────────────────────── */
.fb-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--fb-gray-200);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.fb-btn {
  padding: 8px 18px;
  border-radius: 6px;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
}
.fb-btn-primary {
  background: var(--fb-brand);
  color: #fff;
}
.fb-btn-primary:hover { background: var(--fb-brand-dark); }
.fb-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
