/**
 * FeedbackPilot widget styles — scoped under .fbp- prefix.
 *
 * Layout target:
 *   ┌─── .fbp-dialog (flex column, max-height 90vh) ──┐
 *   │  header   (h2)                            fixed │
 *   │  ─────                                          │
 *   │  body     (form + canvas)         scroll-y      │
 *   │  ─────                                          │
 *   │  footer   (status + buttons)              fixed │
 *   └─────────────────────────────────────────────────┘
 * The submit button must always be visible regardless of screenshot size.
 *
 * Heavy use of !important on canvas + dialog properties because host themes
 * (e.g. Divi) tend to ship aggressive global selectors that override our
 * widget styles. Without these, the canvas escapes the modal entirely.
 */

.fbp-trigger {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 99999;
    padding: 10px 16px;
    border: 0;
    border-radius: 999px;
    background: #1f2937;
    color: #fff;
    font: 500 14px/1.2 system-ui, -apple-system, "Segoe UI", sans-serif;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.fbp-trigger:hover,
.fbp-trigger:focus-visible {
    background: #111827;
    outline: 3px solid rgba(31, 41, 55, 0.35);
    outline-offset: 2px;
}

.fbp-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.fbp-dialog {
    background: #fff !important;
    border-radius: 12px;
    width: 100% !important;
    max-width: 720px !important;
    max-height: 90vh !important;
    padding: 0 !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    font: 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif !important;
    color: #111827 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important; /* never overflow as a whole; inner body scrolls */
    box-sizing: border-box !important;
}

.fbp-header {
    flex: 0 0 auto;
    padding: 20px 24px 8px;
    border-bottom: 1px solid #f3f4f6;
}

.fbp-header h2 {
    margin: 0 !important;
    font-size: 18px !important;
    color: #111827 !important;
    font-weight: 600 !important;
}

.fbp-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px 24px;
    min-height: 0; /* allow flex item to actually shrink/scroll */
}

.fbp-footer {
    flex: 0 0 auto;
    border-top: 1px solid #f3f4f6;
    padding: 12px 24px 16px;
    background: #fff;
}

.fbp-type {
    border: 0;
    padding: 0;
    margin: 0 0 12px;
    display: flex;
    gap: 16px;
}

.fbp-type label {
    cursor: pointer;
    color: #111827;
}

.fbp-message {
    width: 100% !important;
    min-height: 80px;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font: inherit;
    resize: vertical;
    box-sizing: border-box;
    background: #fff;
    color: #111827;
}

.fbp-canvas-hint {
    margin: 12px 0 6px;
    font-size: 12px;
    color: #6b7280;
}

/* Honeypot field — hidden from humans via off-screen positioning.
   Don't use display:none/visibility:hidden, bots check those. */
.fbp-hp {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

.fbp-canvas-wrap {
    margin: 4px 0 0;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: auto;
    max-height: 50vh;
    background: #f9fafb;
}

.fbp-canvas {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    cursor: crosshair !important;
    touch-action: none !important;
    user-select: none;
}

.fbp-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.fbp-actions button {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #111827;
    cursor: pointer;
    font: inherit;
    line-height: 1.2;
}

.fbp-actions button:hover {
    background: #f9fafb;
}

.fbp-actions .fbp-submit {
    background: #1f2937 !important;
    color: #fff !important;
    border-color: #1f2937 !important;
    font-weight: 500;
}

.fbp-actions .fbp-submit:hover {
    background: #111827 !important;
}

.fbp-actions .fbp-submit[disabled] {
    background: #6b7280 !important;
    border-color: #6b7280 !important;
    cursor: not-allowed;
}

.fbp-status {
    margin: 0 0 8px;
    color: #4b5563;
    min-height: 1.2em;
    font-size: 13px;
}

.fbp-status.is-error { color: #b91c1c; }
.fbp-status.is-success { color: #166534; }

@media (prefers-reduced-motion: reduce) {
    .fbp-trigger { transition: none; }
}
