/*
 * Shared form/result widgets for Free-Tools calculators
 */

.tf-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tf-block {
    margin: 0;
    padding: 1rem 1.1rem 1.15rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tf-block legend {
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0 0.25rem;
}

.tf-grid {
    display: grid;
    gap: 0.75rem;
}

@media (min-width: 520px) {
    .tf-grid--2 { grid-template-columns: 1fr 1fr; }
    .tf-grid--3 { grid-template-columns: 1fr 1fr 1fr; }
}

.tf-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.88rem;
}

.tf-field input,
.tf-field select,
.tf-field textarea {
    width: 100%;
    min-height: 44px;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-app, var(--surface));
    color: var(--text-primary);
    font: inherit;
}

.tf-field textarea {
    min-height: 88px;
    resize: vertical;
}

.tf-hint,
.tf-privacy {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.tf-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tf-chip {
    appearance: none;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-primary);
    border-radius: 999px;
    padding: 0.45rem 0.85rem;
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    min-height: 40px;
}

.tf-chip.is-active {
    border-color: var(--text-primary);
    background: var(--text-primary);
    color: var(--bg-app, #fff);
}

.tf-check {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.tf-check input { margin-top: 0.2rem; flex-shrink: 0; }

.tf-result__inner {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    padding: 1.1rem 1.15rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.tf-result__label {
    margin: 0;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}

.tf-result__price {
    margin: 0;
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.tf-result__sub {
    margin: -0.35rem 0 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.tf-ampel {
    padding: 0.7rem 0.75rem;
    border-radius: 10px;
    background: var(--bg-muted, rgba(0, 0, 0, 0.04));
}

.tf-ampel[data-level="green"] { border-left: 4px solid #16a34a; }
.tf-ampel[data-level="yellow"] { border-left: 4px solid #ca8a04; }
.tf-ampel[data-level="red"] { border-left: 4px solid #dc2626; }
.tf-ampel[data-level="na"] { border-left: 4px solid #94a3b8; }

.tf-ampel__msg { margin: 0; font-size: 0.9rem; line-height: 1.45; }

.tf-dl {
    margin: 0;
    display: grid;
    gap: 0.35rem;
}

.tf-dl > div {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.88rem;
}

.tf-dl dt { color: var(--text-secondary); }
.tf-dl dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }

.tf-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tf-actions .btn { min-height: 44px; justify-content: center; text-align: center; }

.tf-share {
    appearance: none;
    border: 0;
    background: none;
    color: var(--text-secondary);
    text-decoration: underline;
    text-underline-offset: 2px;
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.25rem;
    min-height: 40px;
}

.tf-toast {
    margin: 0;
    font-size: 0.82rem;
    background: var(--bg-muted, rgba(0, 0, 0, 0.06));
    border-radius: 8px;
    padding: 0.55rem 0.7rem;
}

.tf-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.tf-table th,
.tf-table td {
    text-align: left;
    padding: 0.45rem 0.35rem;
    border-bottom: 1px solid var(--border);
}

.tf-table th { color: var(--text-secondary); font-weight: 560; }

.tf-drop {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.45;
    cursor: pointer;
    background: var(--bg-muted, rgba(0, 0, 0, 0.03));
}

.tf-drop.is-drag {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.tf-range {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.tf-range input[type="range"] {
    width: 100%;
    min-height: 36px;
}

.tf-honest {
    margin: 0;
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 0.85rem;
    line-height: 1.45;
}

[data-theme="dark"] .tf-honest {
    background: rgba(154, 52, 18, 0.2);
    color: #fdba74;
}

.tf-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tf-timeline li {
    display: grid;
    grid-template-columns: 5.5rem 1fr;
    gap: 0.5rem;
    padding: 0.55rem 0.65rem;
    border-radius: 8px;
    background: var(--bg-muted, rgba(0, 0, 0, 0.04));
    font-size: 0.88rem;
}

.tf-timeline__time { font-weight: 650; font-variant-numeric: tabular-nums; }

.tf-warn {
    margin: 0;
    font-size: 0.85rem;
    color: #b45309;
    line-height: 1.45;
}

@media (max-width: 899px) {
    .tool-result {
        position: sticky;
        bottom: 0;
        z-index: 20;
    }

    .tf-result__inner {
        border-radius: 14px 14px 0 0;
        box-shadow: 0 -8px 28px rgba(15, 23, 42, 0.12);
        max-height: min(65vh, 480px);
        overflow: auto;
    }
}
