/* ============================================================================
 * components/feedback.css — fx-feedback widget styles
 * ============================================================================
 * Depends on: core/tokens.css
 *
 * Floating launcher + slide-out panel for beta feedback intake.
 * Only rendered for tester/admin roles — fx-feedback.js handles visibility.
 * ========================================================================== */

/* ── Launcher button ──────────────────────────────────────────────────── */
.fx-fb-launcher {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--motion-base);
  box-shadow: var(--shadow-md);
}
.fx-fb-launcher:hover {
  border-color: var(--accent-lt);
  color: var(--accent-lt);
}
.fx-fb-launcher-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-lt);
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.6);
}

/* ── Backdrop ─────────────────────────────────────────────────────────── */
.fx-fb-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  /* theme-neutral (N, per fx-web-pln-dual-theme.md §8.7 / fx-web-req-light-theme.md §8.7):
     Modal scrim is intentionally dark in both themes — standard modal-backdrop pattern.
     Dims the underlying page so the modal surface reads as focused. */
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  animation: fbFadeIn 200ms ease forwards;
}
@keyframes fbFadeIn { to { opacity: 1; } }

/* ── Panel ────────────────────────────────────────────────────────────── */
.fx-fb-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: calc(var(--z-modal) + 1);
  width: min(440px, 100vw);
  background: var(--bg);
  border-left: 1px solid var(--border2);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  animation: fbSlideIn 280ms var(--easing-base) forwards;
  overflow: hidden;
}
@keyframes fbSlideIn { to { transform: translateX(0); } }

.fx-fb-panel.closing {
  animation: fbSlideOut 220ms var(--easing-base) forwards;
}
@keyframes fbSlideOut { to { transform: translateX(100%); } }

/* ── Panel header ─────────────────────────────────────────────────────── */
.fx-fb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.fx-fb-header-title {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--text);
}
.fx-fb-close {
  background: none;
  border: none;
  color: var(--muted2);
  font-size: var(--text-lg);
  cursor: pointer;
  padding: var(--space-1);
  line-height: 1;
}
.fx-fb-close:hover { color: var(--text); }

/* ── Panel body (scrollable form area) ────────────────────────────────── */
.fx-fb-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5);
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}

/* ── Form fields ──────────────────────────────────────────────────────── */
.fx-fb-field {
  margin-bottom: var(--space-4);
}
.fx-fb-label {
  display: block;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--space-2);
}
.fx-fb-input,
.fx-fb-select,
.fx-fb-textarea {
  width: 100%;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--text);
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  transition: border-color var(--motion-fast);
}
.fx-fb-input:focus,
.fx-fb-select:focus,
.fx-fb-textarea:focus {
  outline: none;
  border-color: var(--accent-lt);
}
.fx-fb-textarea {
  min-height: 80px;
  resize: vertical;
  line-height: var(--leading-normal);
}
.fx-fb-select {
  appearance: auto;
}

/* ── Expandable optional fields ───────────────────────────────────────── */
.fx-fb-optional-toggle {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--accent-lt);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-bottom: var(--space-4);
}
.fx-fb-optional-toggle:hover { color: var(--text); }

/* ── Screenshot section ───────────────────────────────────────────────── */
.fx-fb-screenshot-area {
  margin-bottom: var(--space-4);
}
.fx-fb-screenshot-btn {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--muted2);
  background: none;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-4);
  cursor: pointer;
  transition: all var(--motion-base);
}
.fx-fb-screenshot-btn:hover {
  color: var(--accent-lt);
  border-color: var(--accent-lt);
}
.fx-fb-screenshot-preview {
  margin-top: var(--space-3);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}
.fx-fb-screenshot-preview img {
  width: 100%;
  display: block;
}
.fx-fb-screenshot-remove {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: var(--weight-semibold);
  color: var(--red);
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  cursor: pointer;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}
.fx-fb-screenshot-remove:hover { background: var(--red-bg); }

/* ── Footer (submit/cancel) ───────────────────────────────────────────── */
.fx-fb-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
  display: flex;
  gap: var(--space-3);
  flex-shrink: 0;
}

/* ── Confirmation ─────────────────────────────────────────────────────── */
.fx-fb-confirmation {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-10);
  gap: var(--space-4);
}
.fx-fb-confirmation-ref {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--accent-lt);
}
.fx-fb-confirmation-msg {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--muted2);
}

/* ── Error state ──────────────────────────────────────────────────────── */
.fx-fb-error {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  color: var(--red);
  margin-top: var(--space-2);
}
