/* SkillWave — Feedback widget. Everything is scoped under .swfb so it cannot affect (or be broken by)
   Bootstrap / theme.css. Accent colours are variables: change --swfb-accent to match a different brand. */
.swfb, .swfb *, .swfb *::before, .swfb *::after { box-sizing: border-box; }
.swfb {
  --swfb-accent: #4F46E5;        /* indigo */
  --swfb-accent-2: #7C3AED;      /* violet */
  --swfb-accent-dark: #3730A3;
  --swfb-soft: #EEF2FF;
  --swfb-ink: #1F2937;
  --swfb-muted: #6B7280;
  --swfb-line: #E5E7EB;
  --swfb-danger: #B91C1C;
  --swfb-danger-soft: #FEF2F2;
  --swfb-ok: #047857;
  font-family: inherit; font-size: 15px; line-height: 1.5; color: var(--swfb-ink);
}

/* The HTML [hidden] attribute must win over any display value set below. */
.swfb [hidden] { display: none !important; }
.swfb .swfb-form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; margin: 0; }

/* ── launcher ─────────────────────────────────────────────── */
.swfb .swfb-launch {
  position: fixed; right: 18px; bottom: 18px; z-index: 99990;
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 14px; margin: 0;
  background: #fff; color: var(--swfb-accent); border: 1px solid var(--swfb-line); border-radius: 999px;
  font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1; cursor: pointer;
  box-shadow: 0 1px 2px rgba(17,24,39,.06), 0 6px 18px rgba(17,24,39,.10);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.swfb .swfb-launch:hover { border-color: var(--swfb-accent); box-shadow: 0 1px 2px rgba(17,24,39,.06), 0 8px 22px rgba(79,70,229,.18); }
.swfb .swfb-launch:active { transform: translateY(1px); }
.swfb .swfb-launch svg { width: 18px; height: 18px; flex: none; }

/* ── overlay + dialog ─────────────────────────────────────── */
.swfb .swfb-overlay {
  position: fixed; inset: 0; z-index: 99995; display: none; align-items: center; justify-content: center; padding: 16px;
  background: rgba(17,24,39,.45); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.swfb .swfb-overlay.is-open { display: flex; animation: swfb-fade .16s ease-out; }
.swfb .swfb-dialog {
  position: relative; display: flex; flex-direction: column; width: 100%; max-width: 520px; max-height: min(92vh, 760px); max-height: min(92dvh, 760px);
  background: #fff; border-radius: 20px; overflow: hidden; outline: none;
  box-shadow: 0 24px 64px rgba(17,24,39,.28);
  animation: swfb-rise .2s cubic-bezier(.2,.8,.2,1);
}
.swfb .swfb-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 20px 4px 24px; }
.swfb .swfb-title { margin: 0; font-size: 20px; line-height: 1.3; font-weight: 700; letter-spacing: -.01em; color: var(--swfb-ink); }
.swfb .swfb-sub { margin: 4px 0 0; color: var(--swfb-muted); font-size: 14px; }
.swfb .swfb-x {
  flex: none; margin: -4px -6px 0 auto; width: 44px; height: 44px; display: grid; place-items: center; padding: 0;
  background: transparent; border: 0; border-radius: 12px; color: var(--swfb-muted); cursor: pointer;
}
.swfb .swfb-x:hover { background: #F3F4F6; color: var(--swfb-ink); }
.swfb .swfb-x svg { width: 20px; height: 20px; }

.swfb .swfb-body { padding: 12px 24px 8px; overflow-y: auto; overscroll-behavior: contain; }
.swfb .swfb-field { margin: 0 0 20px; padding: 0; border: 0; min-width: 0; }
.swfb .swfb-label, .swfb .swfb-legend {
  display: block; padding: 0; margin: 0 0 8px; width: auto; float: none; font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--swfb-ink);
}
.swfb .swfb-opt { font-weight: 400; color: var(--swfb-muted); }
.swfb .swfb-input, .swfb .swfb-text {
  display: block; width: 100%; margin: 0; padding: 11px 14px; font: inherit; font-size: 16px; color: var(--swfb-ink);
  background: #fff; border: 1px solid #D1D5DB; border-radius: 12px; transition: border-color .15s, box-shadow .15s;
}
.swfb .swfb-text { min-height: 84px; resize: vertical; }
.swfb .swfb-input::placeholder, .swfb .swfb-text::placeholder { color: #9CA3AF; }
.swfb .swfb-input:hover, .swfb .swfb-text:hover { border-color: #9CA3AF; }
.swfb .swfb-input:focus, .swfb .swfb-text:focus { outline: none; border-color: var(--swfb-accent); box-shadow: 0 0 0 3px rgba(79,70,229,.18); }
.swfb [aria-invalid="true"] { border-color: var(--swfb-danger) !important; }
.swfb .swfb-err { margin: 6px 0 0; color: var(--swfb-danger); font-size: 13px; }

/* ── star rating (the one bold element) ───────────────────── */
.swfb .swfb-stars { display: flex; align-items: center; gap: 2px; margin: 0 -4px; }
.swfb .swfb-star { position: relative; display: block; flex: none; width: 48px; height: 48px; margin: 0; cursor: pointer; }
.swfb .swfb-star input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.swfb .swfb-star svg { position: absolute; inset: 5px; width: 38px; height: 38px; pointer-events: none; transition: transform .12s; }
.swfb .swfb-star path { fill: #fff; stroke: #C4C7D0; stroke-width: 1.4; stroke-linejoin: round; transition: fill .12s, stroke .12s; }
.swfb .swfb-star.is-on path { fill: url(#swfb-grad); stroke: var(--swfb-accent); }
.swfb .swfb-star:hover svg { transform: scale(1.08); }
.swfb .swfb-star:has(input:focus-visible) { outline: 3px solid rgba(79,70,229,.45); outline-offset: -2px; border-radius: 12px; }
.swfb .swfb-star.is-focus { outline: 3px solid rgba(79,70,229,.45); outline-offset: -2px; border-radius: 12px; }
.swfb .swfb-rate-word { min-width: 0; margin: 0 0 0 10px; font-size: 14px; font-weight: 600; color: var(--swfb-accent); }
.swfb .swfb-clear { margin: 0 0 0 6px; min-height: 44px; padding: 6px 4px; background: none; border: 0; font: inherit; font-size: 13px; color: var(--swfb-muted); text-decoration: underline; cursor: pointer; }
.swfb .swfb-clear[hidden] { display: none; }
.swfb .swfb-ratingrow { display: flex; align-items: center; flex-wrap: wrap; margin: 0 0 8px; }

/* ── category chips ───────────────────────────────────────── */
.swfb .swfb-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.swfb .swfb-chip { position: relative; margin: 0; }
.swfb .swfb-chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.swfb .swfb-chip span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid #D1D5DB; border-radius: 999px;
  font-size: 14px; color: var(--swfb-ink); background: #fff; transition: background .12s, border-color .12s, color .12s;
}
.swfb .swfb-chip input:hover + span { border-color: #9CA3AF; }
.swfb .swfb-chip input:checked + span { background: var(--swfb-soft); border-color: var(--swfb-accent); color: var(--swfb-accent-dark); font-weight: 600; }
.swfb .swfb-chip input:focus-visible + span { outline: 3px solid rgba(79,70,229,.45); outline-offset: 1px; }

/* ── privacy note, honeypot ───────────────────────────────── */
.swfb .swfb-privacy { margin: 4px 0 12px; padding: 12px 14px; background: #F9FAFB; border-radius: 12px; font-size: 13px; color: var(--swfb-muted); }
.swfb .swfb-privacy label { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 6px; color: var(--swfb-ink); font-size: 14px; cursor: pointer; }
.swfb .swfb-privacy input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--swfb-accent); }
.swfb .swfb-privacy p { margin: 0; }
.swfb .swfb-hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

/* ── footer, buttons, alert ───────────────────────────────── */
.swfb .swfb-foot { padding: 12px 24px 20px; border-top: 1px solid var(--swfb-line); background: #fff; }
.swfb .swfb-alert { margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; background: var(--swfb-danger-soft); color: var(--swfb-danger); font-size: 14px; }
.swfb .swfb-alert[hidden] { display: none; }
.swfb .swfb-actions { display: flex; gap: 10px; justify-content: flex-end; }
.swfb .swfb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; margin: 0; padding: 0 22px;
  font-family: inherit; font-size: 15px; font-weight: 600; line-height: 1; white-space: nowrap; border-radius: 12px; border: 1px solid transparent; cursor: pointer; transition: background .15s, border-color .15s, opacity .15s;
}
.swfb .swfb-btn:focus-visible { outline: 3px solid rgba(124,58,237,.5); outline-offset: 2px; }
.swfb .swfb-btn-primary { background: var(--swfb-accent); color: #fff; }
.swfb .swfb-btn-primary:hover { background: var(--swfb-accent-dark); }
.swfb .swfb-btn-ghost { background: #fff; color: var(--swfb-ink); border-color: #D1D5DB; }
.swfb .swfb-btn-ghost:hover { background: #F9FAFB; }
.swfb .swfb-btn[disabled] { opacity: .65; cursor: not-allowed; }
.swfb .swfb-spin { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: swfb-spin .7s linear infinite; }
.swfb .swfb-spin[hidden] { display: none; }

/* ── success ──────────────────────────────────────────────── */
.swfb .swfb-done { padding: 36px 28px 28px; text-align: center; }
.swfb .swfb-done[hidden] { display: none; }
.swfb .swfb-check { width: 56px; height: 56px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg, var(--swfb-accent), var(--swfb-accent-2)); }
.swfb .swfb-check svg { width: 28px; height: 28px; }
.swfb .swfb-done h2 { margin: 0 0 6px; font-size: 20px; font-weight: 700; color: var(--swfb-ink); outline: none; }
.swfb .swfb-done p { margin: 0 0 22px; color: var(--swfb-muted); }

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

/* ── phones: bottom sheet ─────────────────────────────────── */
@media (max-width: 600px) {
  .swfb .swfb-launch { right: 14px; bottom: 14px; }
  .swfb .swfb-overlay { padding: 0; align-items: flex-end; }
  .swfb .swfb-dialog { max-width: none; max-height: 94vh; max-height: 94dvh; border-radius: 20px 20px 0 0; animation-name: swfb-sheet; }
  .swfb .swfb-head { padding: 18px 12px 2px 18px; }
  .swfb .swfb-body { padding: 10px 18px 6px; }
  .swfb .swfb-foot { padding: 12px 18px calc(16px + env(safe-area-inset-bottom, 0px)); }
  .swfb .swfb-actions .swfb-btn { flex: 1; padding: 0 14px; }
  .swfb .swfb-actions .swfb-btn-ghost { flex: 0 0 auto; }
}

@keyframes swfb-fade  { from { opacity: 0; } to { opacity: 1; } }
@keyframes swfb-rise  { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes swfb-sheet { from { transform: translateY(32px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes swfb-spin  { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .swfb *, .swfb *::before, .swfb *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
