/* feedback.css — reusable in-app feedback widget
   Drop into any project alongside feedback.js.
   All classes namespaced with fb- to avoid collisions.
   Override .fb-header { background } to match your app's primary colour. */

/* ── Overlay / backdrop ────────────────────────────────────────────────────── */

.fb-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.fb-overlay.hidden { display: none; }

.fb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

/* ── Dialog ─────────────────────────────────────────────────────────────────── */

.fb-dialog {
  position: relative;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.22);
  width: min(460px, 96vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(14px) scale(0.98);
  opacity: 0;
  transition: transform 0.18s ease, opacity 0.18s ease;
}
.fb-dialog.fb-dialog-in {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* ── Header ─────────────────────────────────────────────────────────────────── */

.fb-header {
  background: #1E3A5F;   /* override this to match your app */
  color: #ffffff;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.fb-header-title {
  font-size: 14px;
  font-weight: 700;
  flex: 1;
  letter-spacing: 0.01em;
}

.fb-close-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #ffffff;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}
.fb-close-btn:hover { background: rgba(255, 255, 255, 0.28); }

/* ── Body ────────────────────────────────────────────────────────────────────── */

.fb-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

/* ── Form ────────────────────────────────────────────────────────────────────── */

.fb-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fb-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fb-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.fb-required { color: #ef4444; }

/* ── Type pills ─────────────────────────────────────────────────────────────── */

.fb-type-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.fb-type-pill {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  background: #f8fafc;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  user-select: none;
}
.fb-type-pill input[type="radio"] { display: none; }

/* :has() — supported in all modern browsers (Chrome 105+, Safari 15.4+, FF 121+) */
.fb-type-pill:has(input:checked) {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}
.fb-type-pill:hover { border-color: #93c5fd; }

/* ── Text inputs ─────────────────────────────────────────────────────────────── */

.fb-input,
.fb-textarea {
  font-size: 13px;
  padding: 8px 10px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-family: inherit;
  color: #1e293b;
  background: #f8fafc;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s, background 0.15s;
}
.fb-input:focus,
.fb-textarea:focus {
  outline: none;
  border-color: #2563eb;
  background: #ffffff;
}
.fb-input.fb-input-error { border-color: #ef4444; }
.fb-textarea { resize: vertical; min-height: 88px; }

.fb-field-error {
  font-size: 12px;
  color: #ef4444;
}
.fb-field-error.hidden { display: none; }

/* ── Actions ─────────────────────────────────────────────────────────────────── */

.fb-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-top: 2px;
}

.fb-btn-primary {
  background: #1d4ed8;
  color: #ffffff;
  border: none;
  border-radius: 7px;
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.fb-btn-primary:hover   { background: #1e40af; }
.fb-btn-primary:active  { background: #1e3a8a; }
.fb-btn-primary:disabled { opacity: 0.55; cursor: default; }

.fb-btn-text {
  background: none;
  border: none;
  color: #64748b;
  font-size: 13px;
  cursor: pointer;
  padding: 8px 4px;
  transition: color 0.15s;
}
.fb-btn-text:hover { color: #1e293b; }

.fb-error-msg {
  font-size: 12px;
  color: #ef4444;
  margin: 0;
}
.fb-error-msg.hidden { display: none; }

/* ── Success state ───────────────────────────────────────────────────────────── */

.fb-success {
  text-align: center;
  padding: 16px 10px 8px;
}

.fb-success-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #dcfce7;
  color: #16a34a;
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.fb-success-title {
  font-size: 17px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 8px;
}

.fb-success-msg {
  font-size: 14px;
  color: #64748b;
  margin: 0 0 24px;
}
