/* =============================================================================
   Floating feedback widget — pill button + popover panel
   -----------------------------------------------------------------------------
   Anchored bottom-right via fixed positioning. z-index sits above sticky
   tab bars (--wf-z-sticky region) but below auth modals.
============================================================================= */

.wf-feedback {
    position: fixed;
    right:    var(--space-4);
    bottom:   var(--space-4);
    z-index:  9999;
    font-family: var(--font-body);
}

/* ── Pill button ─────────────────────────────────────────────────────── */

.wf-feedback__pill {
    display:         inline-flex;
    align-items:     center;
    gap:             6px;
    padding:         10px 16px;
    background:      var(--color-primary);
    color:           #0D1117;
    border:          0;
    border-radius:   999px;
    font-family:     var(--font-body);
    font-size:       14px;
    font-weight:     600;
    line-height:     1;
    cursor:          pointer;
    box-shadow:      0 6px 18px rgba(0, 0, 0, 0.35);
    transition:      transform 0.15s ease, box-shadow 0.15s ease;
}

.wf-feedback__pill:hover,
.wf-feedback__pill:focus-visible {
    transform:  translateY(-1px);
    box-shadow: 0 8px 24px rgba(0, 212, 212, 0.45);
    outline:    none;
}

.wf-feedback__pill svg {
    flex-shrink: 0;
}

/* ── Panel ───────────────────────────────────────────────────────────── */

.wf-feedback__panel {
    position:      absolute;
    bottom:        calc(100% + 10px);
    right:         0;
    width:         320px;
    max-width:     calc(100vw - var(--space-6));
    padding:       16px;
    background:    var(--color-surface);
    border:        1px solid var(--color-border);
    border-radius: var(--radius-lg, 12px);
    box-shadow:    0 16px 40px rgba(0, 0, 0, 0.45);
    color:         var(--color-text);
}

.wf-feedback__panel[hidden] {
    display: none;
}

.wf-feedback__header {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    margin-bottom:   12px;
}

.wf-feedback__title {
    font-family: var(--font-heading);
    font-size:   16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color:       var(--color-text);
}

.wf-feedback__close {
    border:      0;
    background:  transparent;
    color:       var(--color-text-muted);
    font-size:   22px;
    line-height: 1;
    cursor:      pointer;
    padding:     0 4px;
}

.wf-feedback__close:hover,
.wf-feedback__close:focus-visible {
    color:   var(--color-text);
    outline: none;
}

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

.wf-feedback__label {
    display:        block;
    font-size:      12px;
    font-weight:    600;
    color:          var(--color-text-muted);
    margin:         8px 0 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.wf-feedback__label:first-child {
    margin-top: 0;
}

.wf-feedback__select,
.wf-feedback__textarea {
    width:         100%;
    padding:       8px 10px;
    background:    var(--color-surface-2);
    border:        1px solid var(--color-border);
    border-radius: var(--radius-md, 8px);
    color:         var(--color-text);
    font-family:   var(--font-body);
    font-size:     14px;
    box-sizing:    border-box;
}

.wf-feedback__textarea {
    resize:      vertical;
    min-height:  92px;
    line-height: 1.4;
}

.wf-feedback__select:focus,
.wf-feedback__textarea:focus {
    outline:      none;
    border-color: var(--color-primary);
    box-shadow:   0 0 0 2px rgba(0, 212, 212, 0.25);
}

.wf-feedback__error {
    margin:    8px 0 0;
    color:     #ef4444;
    font-size: 13px;
}

.wf-feedback__success {
    margin:    8px 0 0;
    color:     var(--color-primary);
    font-size: 13px;
    font-weight: 500;
}

.wf-feedback__actions {
    margin-top: 12px;
    text-align: right;
}

.wf-feedback__submit {
    padding:       8px 16px;
    background:    var(--color-primary);
    color:         #0D1117;
    border:        0;
    border-radius: var(--radius-md, 8px);
    font-family:   var(--font-body);
    font-size:     14px;
    font-weight:   600;
    cursor:        pointer;
    transition:    opacity 0.15s ease;
}

.wf-feedback__submit:hover:not(:disabled) {
    opacity: 0.9;
}

.wf-feedback__submit:disabled {
    opacity: 0.6;
    cursor:  not-allowed;
}

@media (max-width: 480px) {
    .wf-feedback__panel {
        right:     0;
        width:     min(320px, calc(100vw - var(--space-4) * 2));
    }
}
