/**
 * Shared styles for B1 italian fiscal calculators (CF generator, IVA
 * professionisti, TFR, F24, regime forfettario, IBAN lookup).
 *
 * Generic patterns (input/select/tabs/panel/result/actions/grid/field/
 * table/hero-card/breakdown) live in the design system (public.css).
 * This file only carries cluster-specific helpers: vertical section
 * wrapper, monospace numeric table cell, autocomplete dropdown,
 * `fc-msg` flat alert (single-line callout without icon, used in
 * inline result feedback - to be migrated to tools-alert in a later
 * refactor pass).
 */

/* Vertical section wrapper. */
.fc-section { display: flex; flex-direction: column; gap: 1rem; }

/* Monospace numeric cell helper for tables (TFR yearly grid, F24
 * rate plan, CF homocode list). */
.fc-num {
    font-family: var(--font-mono, ui-monospace, monospace);
    text-align: right;
    white-space: nowrap;
}

/* ===== Flat single-line alert (no icon) =====
 * Lightweight inline feedback inside results panels. Variants follow
 * the .is-* convention (kept stable for now; richer .tools-alert--*
 * with icon will replace these in the per-tool refactor of section 4). */

.fc-msg {
    padding: 0.7rem 0.9rem;
    border-radius: var(--r-md, 10px);
    margin-top: 0.6rem;
    font-size: 0.88rem;
}

.fc-msg.is-error {
    background: var(--c-danger-bg);
    border-left: 3px solid var(--c-danger-accent);
    color: var(--c-danger-fg);
}

.fc-msg.is-warn {
    background: var(--c-warning-bg);
    border-left: 3px solid var(--c-warning-accent);
    color: var(--c-warning-fg);
}

.fc-msg.is-ok {
    background: var(--c-success-bg);
    border-left: 3px solid var(--c-success-accent);
    color: var(--c-success-fg);
}

.fc-msg.is-info {
    background: var(--c-info-bg);
    border-left: 3px solid var(--c-info-accent);
    color: var(--c-info-fg);
}

/* ===== Autocomplete dropdown (CF generator: comune lookup) ===== */

.fc-autocomplete {
    position: relative;
}

.fc-autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--c-bg-card, #fff);
    border: 1px solid var(--c-line, #e2e8f0);
    border-radius: var(--r-md, 10px);
    margin-top: 4px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: var(--shadow-md, 0 4px 8px rgba(0,0,0,0.08));
}

/* Phone: the list takes its own room and pushes the form down, instead of
   floating over the button below the field, which the tap then never reached. */
@media (max-width: 767px) {
    .fc-autocomplete-list { position: static; }
}

.fc-autocomplete-item {
    padding: 0.5rem 0.8rem;
    cursor: pointer;
    font-size: 0.92rem;
    border-bottom: 1px solid var(--c-line, #e2e8f0);
}

.fc-autocomplete-item:last-child { border-bottom: none; }
.fc-autocomplete-item:hover,
.fc-autocomplete-item.is-active {
    background: var(--c-bg, #f8fafc);
    color: var(--c-blue, #0065c0);
}

.fc-autocomplete-item code {
    font-family: var(--font-mono, ui-monospace, monospace);
    color: var(--c-ink-mute, #64748b);
    font-size: 0.85em;
    margin-left: 0.5rem;
}

/* ===== Print stylesheet (cluster-specific overrides) =====
 * Generic print rules in public.css section 32. */
@media print {
    .fc-actions { display: none !important; }
    .fc-msg { page-break-inside: avoid; }
}

/* Dataset freshness note: no competitor states when their comuni list was last
 * refreshed, and an undated list is worthless for anyone born before the last
 * round of municipal mergers. Rendered above the tabs so it is read before use.
 */
.tools-dataset-note {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    margin: 0 0 var(--s-4);
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--c-ink-mute);
}

.tools-dataset-note svg {
    flex: 0 0 auto;
    color: var(--c-blue);
}

/* Batch results: a list long enough to be worth pasting is long enough to need
 * its own scroll, otherwise the page jumps to several screens on 200 rows.
 */
.fc-batch-summary {
    margin: 0 0 var(--s-3);
    font-weight: 600;
}

.fc-batch-scroll {
    max-height: 420px;
    overflow: auto;
}

.fc-batch-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.fc-batch-table th,
.fc-batch-table td {
    padding: var(--s-2);
    text-align: left;
    border-bottom: 1px solid var(--c-line);
    vertical-align: top;
}

.fc-batch-table th {
    position: sticky;
    top: 0;
    background: var(--c-bg);
    z-index: 1;
}

.fc-batch-table tr.is-ko td {
    color: var(--c-ink-mute);
}

.fc-batch-table tr.is-ko code {
    text-decoration: line-through;
}

/* [hidden] must beat the display set by the component class: .tools-btn-* is
 * inline-flex, which overrides the user-agent rule for the attribute, so a
 * button marked hidden shows up anyway. The natural home for this is
 * public.css, but that bundle sits 14 bytes under the 16 KB gzip budget that
 * gate check 7 enforces, and the rule costs ~40. Repeated here, in the three
 * stylesheets whose tools actually use hidden buttons, until the budget moves.
 */
[hidden] {
    display: none !important;
}
