/*
 * IMPACCT 2.0 — Feedback Widget
 * Floating button + expandable form, bottom-right of every page.
 * All colors via theme CSS variables.
 */

/* ── Floating Trigger Button ── */
.fb-trigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: transform 0.15s, background 0.15s;
}

.fb-trigger:hover {
    transform: scale(1.08);
    background: var(--accent-hover);
}

.fb-trigger.open {
    background: var(--color-danger);
}

/* ── Feedback Panel ── */
.fb-panel {
    position: fixed;
    bottom: 84px;
    right: 24px;
    width: min(340px, calc(100vw - 48px));
    background: var(--bg-card);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.fb-panel.open {
    display: flex;
}

.fb-panel-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-primary);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.fb-panel-body {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ── Type Selector ── */
.fb-types {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.fb-type-btn {
    padding: 8px 10px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    text-align: center;
    transition: all 0.12s;
    font-family: inherit;
}

.fb-type-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.fb-type-btn.selected {
    background: rgba(59, 130, 246, 0.12);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    font-weight: 600;
}

/* ── Field Input ── */
.fb-field-input,
.fb-message-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 0.82rem;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--input-text);
    font-family: inherit;
    outline: none;
    resize: vertical;
}

.fb-field-input:focus,
.fb-message-input:focus {
    border-color: var(--input-focus-border);
}

.fb-message-input {
    min-height: 80px;
}

.fb-field-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ── Submit ── */
.fb-submit {
    padding: 9px 16px;
    font-size: 0.82rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    background: var(--accent-primary);
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.12s;
}

.fb-submit:hover {
    background: var(--accent-hover);
}

.fb-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Success Message ── */
.fb-success {
    text-align: center;
    padding: 24px;
    color: var(--color-success);
    font-size: 0.88rem;
    font-weight: 600;
}

@media (max-width: 480px) {
    .fb-panel {
        right: 12px;
        left: 12px;
        width: auto;
        bottom: 76px;
    }

    .fb-trigger {
        bottom: 16px;
        right: 16px;
    }
}
