/*
 * Accasio — feedback pill and panel.
 *
 * Uses the Accasio palette and the one radius scale the theme establishes, so
 * the pill belongs to the product rather than looking bolted on. Falls back to
 * literal values where the tokens are absent, because this stylesheet also
 * loads on the admin page, which does not pull the theme overlay.
 */

:root {
  --acc-fb-blue: var(--ac-blue-600, #2563eb);
  --acc-fb-blue-dark: var(--ac-blue-700, #1d4ed8);
  --acc-fb-green: var(--ac-green-500, #22c55e);
  --acc-fb-sky: var(--ac-sky-50, #f0f9ff);
  --acc-fb-navy: var(--ac-navy-900, #1e3a8a);
  --acc-fb-radius: var(--ac-radius-md, 0.5rem);
  --acc-fb-radius-lg: var(--ac-radius-lg, 0.75rem);
  --acc-fb-radius-pill: var(--ac-radius-full, 9999px);
}

.acc-fb-pill {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 9000;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  border: 0;
  border-radius: var(--acc-fb-radius-pill);
  background: var(--acc-fb-blue);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(30, 58, 138, 0.28);
}

.acc-fb-pill:hover,
.acc-fb-pill:focus-visible {
  background: var(--acc-fb-blue-dark);
}

.acc-fb-pill svg {
  width: 1rem;
  height: 1rem;
}

.acc-fb-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9001;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 1.25rem;
  background: rgba(15, 23, 42, 0.35);
}

.acc-fb-panel {
  width: min(26rem, 100%);
  max-height: calc(100vh - 2.5rem);
  overflow-y: auto;
  padding: 1.25rem;
  border-radius: var(--acc-fb-radius-lg);
  background: #fff;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.28);
}

.acc-fb-panel h2 {
  margin: 0 0 0.25rem;
  font-size: 1.0625rem;
  color: var(--acc-fb-navy);
}

.acc-fb-panel p.acc-fb-intro {
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  color: #475569;
}

.acc-fb-kinds {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.875rem;
}

.acc-fb-kinds button {
  flex: 1 1 auto;
  padding: 0.5rem 0.625rem;
  border: 1px solid #cbd5e1;
  border-radius: var(--acc-fb-radius);
  background: #fff;
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
}

.acc-fb-kinds button[aria-pressed='true'] {
  border-color: var(--acc-fb-blue);
  background: var(--acc-fb-sky);
  color: var(--acc-fb-navy);
  font-weight: 600;
}

.acc-fb-panel label {
  display: block;
  margin-bottom: 0.3125rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
}

.acc-fb-panel textarea,
.acc-fb-panel input[type='email'] {
  box-sizing: border-box;
  width: 100%;
  padding: 0.5rem 0.625rem;
  border: 1px solid #cbd5e1;
  border-radius: var(--acc-fb-radius);
  font: inherit;
  font-size: 0.875rem;
}

.acc-fb-panel textarea {
  min-height: 7rem;
  resize: vertical;
}

.acc-fb-counter {
  margin: 0.25rem 0 0.875rem;
  font-size: 0.75rem;
  color: #64748b;
  text-align: right;
}

.acc-fb-counter.acc-fb-over {
  color: #b91c1c;
}

/*
 * The honeypot. Off-screen rather than display:none, because some bots skip
 * hidden fields and fill everything else.
 */
.acc-fb-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.acc-fb-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.875rem;
}

.acc-fb-actions button {
  padding: 0.5rem 0.875rem;
  border: 1px solid transparent;
  border-radius: var(--acc-fb-radius);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.acc-fb-send {
  background: var(--acc-fb-blue);
  color: #fff;
}

.acc-fb-send[disabled] {
  opacity: 0.55;
  cursor: default;
}

.acc-fb-cancel {
  border-color: #cbd5e1;
  background: #fff;
  color: #334155;
}

.acc-fb-error {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  color: #b91c1c;
}

.acc-fb-reply-note {
  margin: 0 0 0.875rem;
  font-size: 0.8125rem;
  color: #475569;
}

/* A thank-you state in the panel, not a toast that vanishes unread. */
.acc-fb-done {
  padding: 0.5rem 0;
  text-align: center;
}

.acc-fb-done svg {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--acc-fb-green);
}

.acc-fb-done h2 {
  margin: 0.5rem 0 0.25rem;
}

@media print {
  .acc-fb-pill,
  .acc-fb-backdrop {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .acc-fb-backdrop {
    align-items: stretch;
    padding: 0;
  }

  .acc-fb-panel {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
}

/* ---------------------------------------------------------------- admin list */

.acc-fb-admin table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.acc-fb-admin th,
.acc-fb-admin td {
  padding: 0.5rem 0.625rem;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  vertical-align: top;
}

.acc-fb-admin tr.acc-fb-done td {
  opacity: 0.55;
}

.acc-fb-admin .acc-fb-message {
  max-width: 28rem;
}

.acc-fb-kind {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: var(--acc-fb-radius-pill);
  background: var(--acc-fb-sky);
  color: var(--acc-fb-navy);
  font-weight: 600;
}

.acc-fb-warn {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: var(--acc-fb-radius-pill);
  background: #fef2f2;
  color: #b91c1c;
  font-weight: 600;
}

.acc-fb-count {
  display: inline-block;
  min-width: 1.5rem;
  padding: 0.125rem 0.5rem;
  border-radius: var(--acc-fb-radius-pill);
  background: var(--acc-fb-blue);
  color: #fff;
  font-size: 0.8125rem;
  text-align: center;
  vertical-align: middle;
}

.acc-fb-muted {
  color: #94a3b8;
}
