/* =========================
   FLOATING BUG REPORT WIDGET
   ========================= */

.bug-report-widget {
  position: fixed;
  left: clamp(1rem, 2vw, 1.75rem);
  bottom: var(--bug-report-widget-bottom, clamp(1rem, 2vw, 1.75rem));
  z-index: 85;
  font-family: inherit;

  display: flex;
  flex-direction: column-reverse;
  align-items: flex-start;
  gap: 0.85rem;
}

.bug-report-toggle {
  width: 3.15rem;
  height: 3.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 1px solid rgba(0, 229, 139, 0.22);
  border-radius: 999px;
  background:
    radial-gradient(circle at top left, rgba(0, 229, 139, 0.24), transparent 34%),
    linear-gradient(145deg, rgba(13, 20, 18, 0.98), rgba(5, 8, 7, 0.98));
  color: var(--color-primary);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(255, 255, 255, 0.035),
    0 0 28px rgba(0, 229, 139, 0.10);

  cursor: pointer;
  transition:
    transform var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    background var(--transition-base);
}

.bug-report-toggle:hover {
  transform: translateY(-3px) scale(1.03);
  border-color: rgba(0, 229, 139, 0.42);
  box-shadow:
    0 22px 52px rgba(0, 0, 0, 0.44),
    0 0 0 1px rgba(0, 229, 139, 0.10),
    0 0 34px rgba(0, 229, 139, 0.18);
}

.bug-report-toggle:active {
  transform: translateY(0) scale(0.98);
}

.bug-report-toggle:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 4px rgba(0, 229, 139, 0.12),
    0 18px 42px rgba(0, 0, 0, 0.38),
    0 0 28px rgba(0, 229, 139, 0.12);
}

.bug-report-widget.is-open .bug-report-toggle {
  border-color: rgba(0, 229, 139, 0.46);
  box-shadow:
    0 22px 52px rgba(0, 0, 0, 0.44),
    0 0 0 1px rgba(0, 229, 139, 0.12),
    0 0 36px rgba(0, 229, 139, 0.22);
}

/* =========================
   BUG REPORT TOGGLE ICON
   ========================= */

.bug-report-toggle-icon {
  width: 1.45rem;
  height: 1.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bug-report-toggle-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 8px rgba(0, 229, 139, 0.18));
}

.bug-report-toggle-icon circle {
  fill: currentColor;
  stroke: none;
}

/* =========================
   BUG REPORT PANEL
   ========================= */

.bug-report-panel {
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.9rem);

  width: min(360px, calc(100vw - 2rem));
  padding: 1.15rem;
  border-radius: 1.35rem;
  border: 1px solid rgba(0, 229, 139, 0.18);
  background:
    radial-gradient(circle at top left, rgba(0, 229, 139, 0.10), transparent 34%),
    linear-gradient(180deg, rgba(13, 20, 18, 0.98), rgba(5, 8, 7, 0.98));
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.48),
    0 0 0 1px rgba(255, 255, 255, 0.035);

  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.96);
  transform-origin: bottom left;
  pointer-events: none;

  transition:
    opacity var(--transition-base),
    visibility var(--transition-base),
    transform var(--transition-base);
}

.bug-report-widget.is-open .bug-report-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.bug-report-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.bug-report-panel-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
}

.bug-report-panel-text {
  margin: 0.25rem 0 0;
  color: var(--color-text-soft);
  font-size: var(--font-size-sm);
  line-height: 1.6;
}

.bug-report-close {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--color-text-soft);
  cursor: pointer;
  transition:
    color var(--transition-fast),
    border-color var(--transition-fast),
    background var(--transition-fast);
}

.bug-report-close:hover {
  color: var(--color-primary);
  border-color: rgba(0, 229, 139, 0.22);
  background: rgba(0, 229, 139, 0.06);
}

.bug-report-form {
  display: grid;
  gap: 0.85rem;
}

.bug-report-field {
  display: grid;
  gap: 0.4rem;
}

.bug-report-field label {
  font-size: 0.82rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}

.bug-report-field input,
.bug-report-field textarea {
  width: 100%;
  display: block;
  padding: 0.82rem 0.9rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  color: var(--color-text);
  font: inherit;
  font-size: var(--font-size-sm);
  line-height: 1.55;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast);
}

.bug-report-field textarea {
  min-height: 105px;
  resize: vertical;
}

.bug-report-field input:focus,
.bug-report-field textarea:focus {
  outline: none;
  border-color: rgba(0, 229, 139, 0.28);
  box-shadow: 0 0 0 4px rgba(0, 229, 139, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.bug-report-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.bug-report-turnstile {
  min-height: 65px;
}

.bug-report-feedback {
  display: none;
  padding: 0.75rem 0.85rem;
  border-radius: 0.85rem;
  font-size: 0.82rem;
  line-height: 1.55;
  border: 1px solid transparent;
}

.bug-report-feedback.is-visible {
  display: block;
}

.bug-report-feedback.is-success {
  color: #bff7df;
  background: rgba(0, 229, 139, 0.08);
  border-color: rgba(0, 229, 139, 0.18);
}

.bug-report-feedback.is-error {
  color: #ffd5d5;
  background: rgba(255, 80, 80, 0.08);
  border-color: rgba(255, 80, 80, 0.18);
}

.bug-report-submit {
  width: 100%;
  justify-content: center;
}