/* ── Taunus Fehlermeldung – Frontend ──────────────────────────────────── */

#tf-widget {
    --tf-blue:    #0071e3;
    --tf-blue-dk: #005bb5;
    --tf-red:     #ff3b30;
    --tf-green:   #34c759;
    --tf-bg:      #ffffff;
    --tf-text:    #1a1a1a;
    --tf-muted:   #6e6e73;
    --tf-border:  rgba(0,0,0,.1);
    --tf-radius:  14px;
    --tf-shadow:  0 12px 40px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.08);

    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
    font-size: 14px;
}

/* ── Trigger button ──────────────────────────────────────────────────── */

#tf-trigger {
    display: flex;
    align-items: center;
    gap: 7px;
    background: var(--tf-blue);
    color: #fff;
    border: none;
    border-radius: 24px;
    padding: 11px 18px 11px 14px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,113,227,.4);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .01em;
    transition: background .15s, transform .15s, box-shadow .15s;
    white-space: nowrap;
}

#tf-trigger:hover {
    background: var(--tf-blue-dk);
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(0,113,227,.5);
}

#tf-trigger:active {
    transform: translateY(0);
}

#tf-trigger svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Hide label on very small screens */
@media (max-width: 400px) {
    .tf-trigger-label { display: none; }
    #tf-trigger { border-radius: 50%; padding: 13px; }
}

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

#tf-panel {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 0;
    width: 340px;
    background: var(--tf-bg);
    border-radius: var(--tf-radius);
    box-shadow: var(--tf-shadow);
    border: 1px solid var(--tf-border);
    overflow: hidden;

    transform-origin: bottom right;
    transform: scale(.94) translateY(6px);
    opacity: 0;
    transition: transform .22s cubic-bezier(.34,1.3,.64,1), opacity .18s ease;
    pointer-events: none;
}

#tf-panel:not([hidden]) {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all;
}

/* Panel hidden via attribute */
#tf-panel[hidden] {
    display: block !important; /* override UA hidden; animation handles visibility */
    pointer-events: none;
}

@media (max-width: 400px) {
    #tf-panel {
        width: calc(100vw - 32px);
        left: 0;
        bottom: calc(100% + 10px);
    }
}

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

.tf-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 0;
}

.tf-panel-header h2 {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 15px;
    font-weight: 700;
    color: var(--tf-text);
    margin: 0;
    padding: 0;
    border: none;
}

.tf-icon-flag {
    width: 18px;
    height: 18px;
    color: var(--tf-blue);
    flex-shrink: 0;
}

.tf-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    color: var(--tf-muted);
    display: flex;
    transition: background .12s, color .12s;
}

.tf-close:hover {
    background: rgba(0,0,0,.06);
    color: var(--tf-text);
}

.tf-close svg { width: 14px; height: 14px; }

/* ── Intro text ──────────────────────────────────────────────────────── */

.tf-intro {
    margin: 8px 16px 12px;
    font-size: 12px;
    color: var(--tf-muted);
    line-height: 1.5;
}

/* ── Type selector ───────────────────────────────────────────────────── */

.tf-type-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 16px 12px;
}

.tf-type-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border: 1.5px solid var(--tf-border);
    border-radius: 20px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    color: var(--tf-muted);
    background: transparent;
    transition: border-color .12s, color .12s, background .12s;
    user-select: none;
    white-space: nowrap;
}

.tf-type-btn input[type="radio"] {
    display: none;
}

.tf-type-btn:hover {
    border-color: var(--tf-blue);
    color: var(--tf-blue);
}

.tf-type-btn:has(input:checked) {
    border-color: var(--tf-blue);
    background: rgba(0,113,227,.08);
    color: var(--tf-blue);
    font-weight: 600;
}

.tf-type-icon { font-size: 14px; }

/* ── Textarea ────────────────────────────────────────────────────────── */

#tf-message {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 16px;
    border: none;
    border-top: 1px solid var(--tf-border);
    border-bottom: 1px solid var(--tf-border);
    font-size: 13px;
    font-family: inherit;
    color: var(--tf-text);
    resize: none;
    outline: none;
    line-height: 1.5;
    background: #f9f9f9;
    transition: background .12s;
}

#tf-message:focus {
    background: #fff;
}

#tf-message::placeholder { color: #aaa; }

.tf-char-count {
    text-align: right;
    font-size: 11px;
    color: var(--tf-muted);
    padding: 3px 16px 0;
}

/* ── Feedback ────────────────────────────────────────────────────────── */

.tf-feedback {
    margin: 8px 16px 0;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
}

.tf-feedback.tf-ok  { background: rgba(52,199,89,.12); color: #1a6630; }
.tf-feedback.tf-err { background: rgba(255,59,48,.1);  color: #991a14; }

/* ── Submit ──────────────────────────────────────────────────────────── */

.tf-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: calc(100% - 32px);
    margin: 12px 16px 4px;
    padding: 11px;
    background: var(--tf-blue);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, opacity .15s;
}

.tf-submit-btn:hover    { background: var(--tf-blue-dk); }
.tf-submit-btn:disabled { opacity: .5; cursor: not-allowed; }

.tf-spinner-icon {
    width: 18px;
    height: 18px;
    animation: tf-spin .7s linear infinite;
}

@keyframes tf-spin { to { transform: rotate(360deg); } }

/* ── Footer note ─────────────────────────────────────────────────────── */

.tf-footer-note {
    text-align: center;
    font-size: 10px;
    color: var(--tf-muted);
    margin: 4px 16px 14px;
}
