/* ==========================================================================
   DEBILEX — widżet zgłoszeń (błąd / pomysł / kontakt)
   Wysuwana szuflada przy prawej krawędzi ekranu.

   Zmienne są SCOPE'OWANE na .dbx-fb, nie brane z :root. Widżet wisi zarówno na
   landingu (home.css), jak i w panelu (panel.css), a te dwa arkusze definiują
   inne zestawy tokenów — poleganie na --gold dałoby widżet bez koloru na jednej
   z tych stron. Własne zmienne = jeden wygląd wszędzie.
   ========================================================================== */

.dbx-fb {
    --fb-gold: #FFC107;
    --fb-gold-2: #F5A623;
    --fb-bg: #0e0f13;
    --fb-bg-2: #16171d;
    --fb-line: #262933;
    --fb-text: #f3f4f6;
    --fb-muted: #9aa0ad;
    --fb-green: #22c55e;
    --fb-red: #ef4444;

    position: fixed;
    inset: 0 0 auto auto;
    z-index: 9000;
    pointer-events: none;
    font-family: 'Figtree', system-ui, -apple-system, sans-serif;
}

.dbx-fb *,
.dbx-fb *::before,
.dbx-fb *::after {
    box-sizing: border-box;
}

/* ===== ZAKŁADKA (pull-tab) ===== */
.dbx-fb__tab {
    pointer-events: auto;
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 9px;
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-right: none;
    border-radius: 10px 0 0 10px;
    background: linear-gradient(180deg, #16171d 0%, #0e0f13 100%);
    color: var(--fb-gold);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
    cursor: pointer;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    box-shadow: -4px 0 22px rgba(0, 0, 0, .5);
    transition: background .18s ease, color .18s ease, padding .18s ease;
}

.dbx-fb__tab:hover {
    background: linear-gradient(180deg, var(--fb-gold) 0%, var(--fb-gold-2) 100%);
    color: #0a0a0a;
    padding-right: 13px;
}

.dbx-fb__tab i {
    writing-mode: horizontal-tb;
    font-size: .9rem;
}

.dbx-fb.is-open .dbx-fb__tab {
    opacity: 0;
    pointer-events: none;
}

/* ===== TŁO POD SZUFLADĄ ===== */
.dbx-fb__scrim {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    opacity: 0;
    visibility: hidden;
    transition: opacity .22s ease, visibility .22s ease;
}

.dbx-fb.is-open .dbx-fb__scrim {
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
}

/* ===== SZUFLADA ===== */
.dbx-fb__panel {
    pointer-events: auto;
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 400px;
    max-width: 100vw;
    display: flex;
    flex-direction: column;
    background: var(--fb-bg);
    border-left: 1px solid var(--fb-line);
    box-shadow: -18px 0 46px rgba(0, 0, 0, .6);
    transform: translateX(102%);
    visibility: hidden;
    transition: transform .26s cubic-bezier(.22, .61, .36, 1), visibility .26s;
}

.dbx-fb.is-open .dbx-fb__panel {
    transform: translateX(0);
    visibility: visible;
}

.dbx-fb__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 14px;
    border-bottom: 1px solid var(--fb-line);
}

.dbx-fb__title {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 900;
    color: var(--fb-text);
    letter-spacing: .02em;
}

.dbx-fb__sub {
    margin: 4px 0 0;
    font-size: .78rem;
    line-height: 1.45;
    color: var(--fb-muted);
}

.dbx-fb__close {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 1px solid var(--fb-line);
    border-radius: 8px;
    background: var(--fb-bg-2);
    color: var(--fb-muted);
    font-size: 1rem;
    cursor: pointer;
    transition: color .16s ease, border-color .16s ease;
}

.dbx-fb__close:hover {
    color: var(--fb-gold);
    border-color: rgba(255, 193, 7, .35);
}

.dbx-fb__body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px 18px 20px;
}

/* ===== SELEKTOR TYPU ===== */
.dbx-fb__types {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.dbx-fb__type {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 11px 6px;
    border: 1px solid var(--fb-line);
    border-radius: 10px;
    background: var(--fb-bg-2);
    color: var(--fb-muted);
    font-size: .68rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    transition: border-color .16s ease, color .16s ease, background .16s ease;
}

.dbx-fb__type i {
    font-size: 1.05rem;
}

.dbx-fb__type:hover {
    color: var(--fb-text);
    border-color: var(--fb-line);
}

.dbx-fb__type.is-active {
    border-color: rgba(255, 193, 7, .5);
    background: rgba(255, 193, 7, .1);
    color: var(--fb-gold);
}

/* ===== POLA ===== */
.dbx-fb__field {
    margin-bottom: 13px;
}

.dbx-fb__label {
    display: block;
    margin-bottom: 6px;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--fb-muted);
}

.dbx-fb__input,
.dbx-fb__textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--fb-line);
    border-radius: 9px;
    background: var(--fb-bg-2);
    color: var(--fb-text);
    font-family: inherit;
    font-size: .87rem;
    line-height: 1.5;
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease;
}

.dbx-fb__input:focus,
.dbx-fb__textarea:focus {
    border-color: rgba(255, 193, 7, .5);
    box-shadow: 0 0 0 3px rgba(255, 193, 7, .1);
}

.dbx-fb__textarea {
    min-height: 132px;
    resize: vertical;
}

.dbx-fb__hint {
    margin: 6px 0 0;
    font-size: .72rem;
    line-height: 1.45;
    color: #6b7280;
}

.dbx-fb__counter {
    float: right;
    font-variant-numeric: tabular-nums;
}

.dbx-fb__counter.is-low {
    color: var(--fb-red);
}

/* Honeypot — poza ekranem, niewidoczny dla człowieka, kuszący dla bota.
   display:none odpada: część botów pomija ukryte pola. */
.dbx-fb__hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ===== KONTEKST ===== */
.dbx-fb__context {
    margin: 4px 0 14px;
    padding: 10px 12px;
    border: 1px dashed var(--fb-line);
    border-radius: 9px;
    background: rgba(255, 255, 255, .015);
}

.dbx-fb__context summary {
    cursor: pointer;
    font-size: .73rem;
    font-weight: 700;
    color: var(--fb-muted);
    list-style: none;
}

.dbx-fb__context summary::-webkit-details-marker {
    display: none;
}

.dbx-fb__context summary::before {
    content: '\25B8';
    display: inline-block;
    margin-right: 6px;
    transition: transform .16s ease;
}

.dbx-fb__context[open] summary::before {
    transform: rotate(90deg);
}

.dbx-fb__context ul {
    margin: 9px 0 0;
    padding: 0;
    list-style: none;
    font-size: .71rem;
    line-height: 1.7;
    color: #6b7280;
    word-break: break-all;
}

.dbx-fb__context b {
    color: var(--fb-muted);
    font-weight: 700;
}

/* ===== AKCJE ===== */
.dbx-fb__submit {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--fb-gold) 0%, var(--fb-gold-2) 100%);
    color: #0a0a0a;
    font-family: inherit;
    font-size: .88rem;
    font-weight: 900;
    letter-spacing: .05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: opacity .16s ease, transform .12s ease;
}

.dbx-fb__submit:hover:not(:disabled) {
    transform: translateY(-1px);
}

.dbx-fb__submit:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.dbx-fb__alert {
    margin-bottom: 13px;
    padding: 10px 12px;
    border-radius: 9px;
    font-size: .8rem;
    line-height: 1.5;
}

.dbx-fb__alert--error {
    border: 1px solid rgba(239, 68, 68, .35);
    background: rgba(239, 68, 68, .1);
    color: #fca5a5;
}

/* ===== EKRAN PODZIĘKOWANIA ===== */
.dbx-fb__done {
    display: none;
    padding: 34px 8px;
    text-align: center;
}

.dbx-fb.is-done .dbx-fb__done {
    display: block;
}

.dbx-fb.is-done .dbx-fb__form {
    display: none;
}

.dbx-fb__done-ico {
    width: 54px;
    height: 54px;
    margin: 0 auto 14px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(34, 197, 94, .14);
    color: var(--fb-green);
    font-size: 1.5rem;
}

.dbx-fb__done-title {
    margin: 0 0 8px;
    font-size: 1.05rem;
    font-weight: 900;
    color: var(--fb-text);
}

.dbx-fb__done-text {
    margin: 0 0 18px;
    font-size: .84rem;
    line-height: 1.6;
    color: var(--fb-muted);
}

.dbx-fb__again {
    padding: 9px 18px;
    border: 1px solid var(--fb-line);
    border-radius: 9px;
    background: var(--fb-bg-2);
    color: var(--fb-muted);
    font-family: inherit;
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
}

.dbx-fb__again:hover {
    color: var(--fb-gold);
    border-color: rgba(255, 193, 7, .35);
}

/* ===== MOBILE =====
   Zakładka przy prawej krawędzi na telefonie koliduje z kciukiem i z dolną
   nawigacją, więc domyślnie jej tam nie ma (config `tab_on_mobile`). Sama
   szuflada działa dalej — otwiera ją link z menu / stopki. */
@media (max-width: 820px) {
    .dbx-fb__panel {
        width: 100%;
        border-left: none;
    }

    .dbx-fb:not(.dbx-fb--tab-mobile) .dbx-fb__tab {
        display: none;
    }

    .dbx-fb--tab-mobile .dbx-fb__tab {
        top: auto;
        bottom: 96px;
        transform: none;
        padding: 12px 8px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .dbx-fb__panel,
    .dbx-fb__scrim,
    .dbx-fb__tab {
        transition: none;
    }
}
