/* Quick feedback toast after a document download */
.dfb-toast {
    --dfb-ink: #1F2A37;
    --dfb-muted: #6B7280;
    --dfb-line: rgba(15, 23, 42, .08);
    position: fixed;
    left: 50%;
    bottom: 16px;
    z-index: 1060;
    width: 380px;
    max-width: calc(100vw - 24px);
    padding: 18px 18px 16px;
    border-radius: 20px;
    background: #fff;
    color: var(--dfb-ink);
    box-shadow: 0 18px 48px rgba(15, 23, 42, .18), 0 2px 6px rgba(15, 23, 42, .06);
    border: 1px solid var(--dfb-line);
    opacity: 0;
    transform: translate(-50%, 24px);
    transition: opacity .24s ease, transform .24s ease;
    font-size: 14px;
    line-height: 1.4;
}

.dfb-toast.is-open {
    opacity: 1;
    transform: translate(-50%, 0);
}

.dfb-toast.is-closing {
    opacity: 0;
    transform: translate(-50%, 16px);
}

.dfb-toast [hidden] {
    display: none !important;
}

.dfb-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--dfb-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease, color .15s ease;
}

.dfb-close:hover,
.dfb-close:focus-visible {
    background: rgba(113, 120, 126, .12);
    color: var(--dfb-ink);
    outline: none;
}

.dfb-close svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
}

.dfb-title {
    margin: 0 34px 14px 2px;
    font-weight: 600;
    font-size: 15px;
}

.dfb-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.dfb-option {
    --dfb-accent: #0054D1;
    --dfb-accent-2: #2F7BFF;
    --dfb-tint: rgba(0, 84, 209, .09);
    --dfb-shadow: rgba(0, 84, 209, .3);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 6px 10px;
    border: 1.5px solid transparent;
    border-radius: 16px;
    background: var(--dfb-tint);
    color: var(--dfb-accent);
    cursor: pointer;
    font: inherit;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
    -webkit-tap-highlight-color: transparent;
}

.dfb-option--bad { --dfb-accent: #E5484D; --dfb-accent-2: #FF7A7E; --dfb-tint: rgba(229, 72, 77, .1); --dfb-shadow: rgba(229, 72, 77, .3); }
.dfb-option--ok { --dfb-accent: #DB8B00; --dfb-accent-2: #FFC555; --dfb-tint: rgba(245, 165, 36, .14); --dfb-shadow: rgba(245, 165, 36, .35); }
.dfb-option--good { --dfb-accent: #16A34A; --dfb-accent-2: #3CC46E; --dfb-tint: rgba(22, 163, 74, .1); --dfb-shadow: rgba(22, 163, 74, .3); }

.dfb-option:hover,
.dfb-option:focus-visible {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 8px 18px -6px var(--dfb-shadow);
    outline: none;
}

.dfb-option:hover .dfb-face,
.dfb-option:focus-visible .dfb-face {
    transform: scale(1.12);
}

.dfb-option.is-selected {
    border-color: var(--dfb-accent);
    background: #fff;
    box-shadow: 0 0 0 3px var(--dfb-tint), 0 8px 18px -8px var(--dfb-shadow);
}

.dfb-toast.has-score .dfb-option:not(.is-selected) {
    opacity: .55;
}

.dfb-toast.has-score .dfb-option:not(.is-selected):hover {
    opacity: 1;
}

.dfb-toast.is-busy .dfb-option,
.dfb-toast.is-busy .dfb-send {
    pointer-events: none;
}

.dfb-face {
    width: 40px;
    height: 40px;
    transition: transform .18s ease;
}

.dfb-face-bg {
    fill: #fff;
    stroke: var(--dfb-accent);
    stroke-width: 2;
}

.dfb-option.is-selected .dfb-face-bg {
    fill: var(--dfb-tint);
}

.dfb-face-eye {
    fill: var(--dfb-accent);
}

.dfb-face-mouth path {
    fill: none;
    stroke: var(--dfb-accent);
    stroke-width: 2.2;
    stroke-linecap: round;
}

.dfb-option-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--dfb-accent);
}

.dfb-status {
    min-height: 0;
    margin-top: 8px;
    font-size: 12.5px;
    color: #16A34A;
    text-align: center;
}

.dfb-status:empty {
    display: none;
}

.dfb-status.is-error,
.dfb-error {
    color: #E5484D;
}

.dfb-comment {
    margin-top: 12px;
}

.dfb-comment-label {
    display: block;
    margin: 0 0 6px 2px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--dfb-muted);
}

.dfb-textarea {
    display: block;
    width: 100%;
    min-height: 64px;
    max-height: 160px;
    padding: 9px 12px;
    border: 1px solid rgba(15, 23, 42, .14);
    border-radius: 12px;
    background: #F8FAFC;
    color: var(--dfb-ink);
    font: inherit;
    font-size: 14px;
    resize: vertical;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.dfb-textarea:focus {
    outline: none;
    border-color: #2F7BFF;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 84, 209, .12);
}

.dfb-comment-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
}

.dfb-error {
    font-size: 12.5px;
}

.dfb-send {
    flex-shrink: 0;
    padding: 8px 18px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #0054D1, #2F7BFF);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}

.dfb-send:hover,
.dfb-send:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px -8px rgba(0, 84, 209, .55);
    outline: none;
}

.dfb-step--thanks {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 34px 2px 2px;
}

.dfb-thanks-icon {
    --dfb-accent: #16A34A;
    --dfb-tint: rgba(22, 163, 74, .1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 14px;
    background: var(--dfb-tint);
}

.dfb-thanks-icon .dfb-face {
    width: 32px;
    height: 32px;
}

.dfb-thanks-text {
    font-weight: 600;
    font-size: 15px;
}

@media (max-width: 575.98px) {
    .dfb-toast {
        width: auto;
        left: 12px;
        right: 12px;
        max-width: none;
        padding: 16px 14px 14px;
        transform: translateY(24px);
    }

    .dfb-toast.is-open {
        transform: translateY(0);
    }

    .dfb-toast.is-closing {
        transform: translateY(16px);
    }

    .dfb-options {
        gap: 8px;
    }

    .dfb-face {
        width: 38px;
        height: 38px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dfb-toast,
    .dfb-option,
    .dfb-face {
        transition: none;
    }
}
