/* ============================================================
   AdmissionPrep · Feedback widget · v1
   ============================================================
   Floating feedback affordance loaded on every authenticated page
   (injected by App.boot, see app.js). Self-contained on purpose:
   no dependency on prep.v2.css tokens so it renders identically on
   every page, with graceful var() fallbacks where tokens exist.
   ============================================================ */

.fbw-launcher {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9990;
  border: 1px solid #6f5732;
  border-radius: 999px;
  padding: 10px 18px;
  font: 700 14px/1 var(--sans, system-ui, -apple-system, sans-serif);
  letter-spacing: 0.04em;
  color: #fdfbf7;
  background: #7a5a2c;
  box-shadow: 0 4px 14px rgba(45, 42, 38, 0.24);
  cursor: pointer;
  min-height: 44px;
  transition: box-shadow 120ms ease, transform 120ms ease;
}
.fbw-launcher:hover,
.fbw-launcher:focus,
.fbw-launcher.fbw-expanded { box-shadow: 0 6px 18px rgba(45, 42, 38, 0.3); transform: translateY(-1px); }

.fbw-launcher.fbw-dismissed {
  right: 0;
  bottom: 50%;
  border-radius: 8px 0 0 8px;
  padding: 10px 12px;
}
.fbw-launcher.fbw-dismissed .fbw-launcher-label { display: none; }
.fbw-launcher.fbw-dismissed::after {
  content: 'Hover or click to leave feedback anytime';
  position: absolute;
  right: 100%;
  top: 50%;
  width: max-content;
  max-width: 220px;
  padding: 8px 10px;
  border-radius: 6px;
  color: #fdfbf7;
  background: #2d2a26;
  font: 600 12px/1.3 var(--sans, system-ui, sans-serif);
  letter-spacing: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(6px);
  transition: opacity 120ms ease, transform 120ms ease;
}
.fbw-launcher.fbw-dismissed:hover::after,
.fbw-launcher.fbw-dismissed:focus::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}
.fbw-launcher.fbw-teasing { animation: fbw-slide-up 400ms ease-out; }

@keyframes fbw-slide-up {
  from { bottom: 18px; }
  to { bottom: 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .fbw-launcher,
  .fbw-launcher.fbw-dismissed::after { transition: none; }
  .fbw-launcher.fbw-teasing { animation: none; }
}

@media (max-width: 560px) {
  .fbw-launcher,
  .fbw-launcher.fbw-dismissed {
    position: static;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: calc(100% - 32px);
    margin: 16px 16px calc(16px + env(safe-area-inset-bottom));
    right: auto;
    bottom: auto;
    padding: 10px 18px;
    border-radius: 999px;
    transform: none;
  }

  .fbw-launcher.fbw-dismissed .fbw-launcher-label { display: inline; }
  .fbw-launcher.fbw-dismissed::after { display: none; }
}

.fbw-panel {
  position: fixed;
  right: 18px;
  bottom: 62px;
  z-index: 9991;
  width: 320px;
  max-width: calc(100vw - 36px);
  background: #faf8f4;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  padding: 14px;
  display: none;
}
.fbw-panel.fbw-open { display: block; }

.fbw-dismiss {
  position: absolute;
  top: 6px;
  right: 8px;
  border: 0;
  padding: 2px 6px;
  color: rgba(45, 42, 38, 0.65);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  font: 700 20px/1 var(--sans, system-ui, sans-serif);
  cursor: pointer;
}
.fbw-dismiss:hover,
.fbw-dismiss:focus { color: #2d2a26; }

.fbw-title {
  font: 700 13px/1.2 var(--serif, Georgia, serif);
  margin: 0 0 8px;
  color: #2d2a26;
}

.fbw-note {
  width: 100%;
  box-sizing: border-box;
  min-height: 84px;
  resize: vertical;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  padding: 8px;
  font: 400 13px/1.45 var(--sans, system-ui, sans-serif);
  color: #2d2a26;
  background: #fff;
}
.fbw-note:focus { outline: 2px solid rgba(122, 90, 44, 0.35); }

.fbw-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}

.fbw-point,
.fbw-submit {
  border-radius: 6px;
  min-height: 44px;
  padding: 7px 12px;
  font: 600 12px/1 var(--sans, system-ui, sans-serif);
  cursor: pointer;
}
.fbw-point {
  border: 1px solid rgba(0, 0, 0, 0.22);
  background: #fff;
  color: #2d2a26;
}
.fbw-point.fbw-armed { background: #f4e9d8; border-color: #b08d57; }
.fbw-submit {
  border: 1px solid #6f5732;
  background: #7a5a2c;
  color: #fdfbf7;
}
.fbw-submit:disabled { opacity: 0.5; cursor: default; }

.fbw-meta {
  margin-top: 8px;
  font: 400 11px/1.4 var(--sans, system-ui, sans-serif);
  color: rgba(45, 42, 38, 0.65);
}
.fbw-meta code {
  font-size: 10.5px;
  background: rgba(0, 0, 0, 0.05);
  padding: 1px 4px;
  border-radius: 3px;
  word-break: break-all;
}

.fbw-check {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  min-height: 44px;
  font: 400 12px/1 var(--sans, system-ui, sans-serif);
  color: #2d2a26;
  user-select: none;
}

.fbw-status {
  margin-top: 8px;
  font: 600 12px/1.4 var(--sans, system-ui, sans-serif);
}
.fbw-status.fbw-ok   { color: #2e6b3a; }
.fbw-status.fbw-err  { color: #a03123; }

/* Element-pointing mode: full-screen crosshair + hover highlight box. */
.fbw-pick-overlay {
  position: fixed;
  inset: 0;
  z-index: 9994;
  cursor: crosshair;
  background: rgba(30, 25, 18, 0.08);
}
.fbw-pick-box {
  position: fixed;
  z-index: 9995;
  pointer-events: none;
  border: 2px solid #c0392b;
  border-radius: 3px;
  background: rgba(192, 57, 43, 0.08);
  transition: all 40ms linear;
}
.fbw-pick-hint {
  position: fixed;
  z-index: 9996;
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
  pointer-events: none;
  background: #2d2a26;
  color: #fdfbf7;
  font: 600 12px/1 var(--sans, system-ui, sans-serif);
  padding: 8px 14px;
  border-radius: 999px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}
