/* BEZPIECZNE AI — page-specific styles
 * Reużywa tokenów v2 (tokens.css). Tu tylko to, czego nie ma w design system:
 * tabele porównawcze + macierz "co wrzucać" (traffic light) + werdykty per dostawca.
 */

:root {
    --warn: #D97706; /* WHY: brak tokenu ostrzegawczego w v2; potrzebny do macierzy zielony/zolty/czerwony */
    --danger: #DC2626; /* WHY: jw. kolor "nigdy" w macierzy i komorkach tabeli */
    --warn-soft: rgba(217, 119, 6, 0.10);
    --danger-soft: rgba(220, 38, 38, 0.10);
    --ok-soft: rgba(22, 163, 74, 0.10);
}

/* ===== TABELA PORÓWNAWCZA ===== */
.cmp-wrap {
    overflow-x: auto; /* WHY: tabela 6 kolumn nie miesci sie na mobile bez przewijania poziomego */
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-elev-1);
    margin-top: 2rem;
}
.cmp {
    width: 100%;
    min-width: 720px; /* WHY: ponizej tej szerokosci kolumny sie zlewaja, wlacza sie scroll */
    border-collapse: collapse;
    font-size: 0.92rem;
    text-align: left;
}
.cmp th,
.cmp td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.cmp thead th {
    background: var(--bg-elev-2);
    font-weight: 600;
    color: var(--text);
    position: sticky;
    top: 0;
}
.cmp tbody tr:last-child td { border-bottom: none; }
.cmp tbody td:first-child,
.cmp tbody th:first-child {
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}
.cmp .c-yes { color: var(--ok); font-weight: 600; }
.cmp .c-no { color: var(--danger); font-weight: 600; }
.cmp .c-warn { color: var(--warn); font-weight: 600; }
.cmp tbody tr:hover { background: var(--bg-elev-2); }

/* wariant kompaktowy: konsument vs biznes */
.cmp--mini { min-width: 520px; }

/* przypis pod tabela: API u dostawcy vs chmura (wycentrowany, jak reszta pod tabelami) */
.table-note {
    margin: 1.5rem auto 0;
    max-width: 820px; /* WHY: globalny CSS strony tnie <p> do ~592px; tu szerszy, ale wycentrowany */
    text-align: center;
    font-size: 0.92rem;
    color: var(--text-dim);
    line-height: 1.65;
}

/* legenda pojec: wyrazna karta, wycentrowana zawartosc (spojnie z reszta pod tabelami) */
.legend {
    margin-top: 2.5rem;
    background: var(--bg-elev-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem 2rem;
    text-align: center;
}
.legend h4 {
    margin: 0 0 1.5rem; font-size: 0.78rem; font-weight: 600;
    letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint);
    text-align: center;
}
.legend-item { text-align: center; }
.legend-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* WHY: 4 pojecia = rowno 2+2, bez sieroty w 3 kolumnie */
    gap: 1.25rem 2.5rem;
}
@media (max-width: 600px) { .legend-grid { grid-template-columns: 1fr; } }
.legend-item { margin: 0; }
.legend-item dt { font-weight: 600; color: var(--accent); font-size: 0.92rem; margin-bottom: 0.25rem; }
.legend-item dd { margin: 0; color: var(--text-dim); font-size: 0.9rem; line-height: 1.5; }

/* ===== WERDYKTY PER DOSTAWCA ===== */
.verdict-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    margin-top: 2rem;
}
.verdict-card {
    background: var(--bg-elev-1);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.verdict-card.is-ok { border-left-color: var(--ok); }
.verdict-card.is-warn { border-left-color: var(--warn); }
.verdict-card.is-no { border-left-color: var(--danger); }
.verdict-card h3 {
    margin: 0 0 0.25rem;
    font-size: 1.15rem;
}
.verdict-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    margin-bottom: 0.75rem;
}
.verdict-tag.is-ok { background: var(--ok-soft); color: var(--ok); }
.verdict-tag.is-warn { background: var(--warn-soft); color: var(--warn); }
.verdict-tag.is-no { background: var(--danger-soft); color: var(--danger); }
.verdict-card p { margin: 0; color: var(--text-dim); font-size: 0.95rem; line-height: 1.6; }

/* ===== MACIERZ "CO WRZUCAĆ" (traffic light) ===== */
.matrix {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-top: 2rem;
}
@media (max-width: 760px) { .matrix { grid-template-columns: 1fr; } }
.matrix-col {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-elev-1);
    overflow: hidden;
}
.matrix-head {
    padding: 1rem 1.25rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.matrix-col.col-ok .matrix-head { background: var(--ok); }
.matrix-col.col-warn .matrix-head { background: var(--warn); }
.matrix-col.col-no .matrix-head { background: var(--danger); }
.matrix-body { padding: 1.25rem; }
.matrix-body ul { margin: 0; padding-left: 1.1rem; }
.matrix-body li { margin-bottom: 0.6rem; color: var(--text-dim); line-height: 1.5; }
.matrix-body li:last-child { margin-bottom: 0; }

/* ===== HERO: karta werdyktu (prawa kolumna) ===== */
.verdict-hero {
    background: var(--bg-elev-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.25rem;
    position: relative;
    box-shadow: 0 18px 40px rgba(10,10,10,0.06);
}
.verdict-hero::before { /* WHY: akcentowy pasek brand u gory karty, sygnatura v2 */
    content: "";
    position: absolute; top: 0; left: 2.25rem; right: 2.25rem; height: 3px;
    background: var(--accent);
    border-radius: 0 0 3px 3px;
}
.verdict-hero-label {
    display: inline-block; font-size: 0.72rem; font-weight: 600;
    letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent);
    margin-bottom: 1rem;
}
.verdict-hero-text {
    font-family: var(--font-serif); font-size: 1.85rem; line-height: 1.22;
    color: var(--text); margin: 0 0 0.85rem; text-wrap: balance;
}
.verdict-hero-sub { font-size: 1rem; color: var(--text-dim); line-height: 1.55; margin: 0; }

/* ===== KARTY OSTRZEGAWCZE / INFO (Samsung, retencja, chmura tak-nie) ===== */
.note-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.25rem;
    margin-top: 2.5rem; /* WHY: odklejenie od tabelki powyzej */
}
.note-card {
    background: var(--bg-elev-1); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.75rem;
}
.note-card-tag {
    display: inline-flex; align-items: center; gap: 0.4rem;
    font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em;
    text-transform: uppercase; padding: 0.28rem 0.75rem; border-radius: 999px;
    margin-bottom: 0.9rem;
}
.note-card-tag.t-warn { background: var(--warn-soft); color: var(--warn); }
.note-card-tag.t-no { background: var(--danger-soft); color: var(--danger); }
.note-card-tag.t-ok { background: var(--ok-soft); color: var(--ok); }
.note-card h3 { margin: 0 0 0.6rem; font-size: 1.18rem; }
.note-card p { margin: 0 0 0.6rem; color: var(--text-dim); line-height: 1.6; font-size: 0.96rem; }
.note-card p:last-child { margin-bottom: 0; }

/* ===== WERDYKTY PER DOSTAWCA: siatka zwartych kart (tekst wypelnia karte) ===== */
.verdict-list {
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* WHY: wycentrowanie ostatniego (niepelnego) rzedu, bez pustego slotu */
    gap: 1rem;
}
.verdict-row {
    flex: 0 1 360px; /* WHY: rowna szerokosc kart, tekst wypelnia karte, brak losowej pustki */
    background: var(--bg-elev-1); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.6rem 1.75rem;
}
.verdict-row-head {
    display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem;
    margin-bottom: 0.85rem; /* WHY: tag ZAWSZE pod nazwa = spojnie, niezaleznie od dlugosci nazwy */
}
.verdict-row-head h3 { margin: 0; font-size: 1.15rem; }
.verdict-row-head .verdict-tag { margin: 0; }
.verdict-row p { margin: 0; color: var(--text-dim); line-height: 1.55; font-size: 0.95rem; }

/* ===== GRUPOWANIE WIERSZY TABELI per dostawca ===== */
.cmp tbody tr.grp td { border-top: 2px solid var(--border-strong); }

/* ===== TIMELINE AI ACT: 3 rowno ===== */
.timeline-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-top: 2rem;
}
@media (max-width: 760px) { .timeline-grid { grid-template-columns: 1fr; } }
.timeline-card {
    background: var(--bg-elev-1); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.75rem; position: relative;
}
.timeline-when {
    display: inline-block; font-size: 0.78rem; font-weight: 700;
    letter-spacing: 0.04em; color: var(--accent); margin-bottom: 0.7rem;
}
.timeline-card h4 { margin: 0 0 0.5rem; font-size: 1.08rem; }
.timeline-card p { margin: 0; color: var(--text-dim); line-height: 1.55; font-size: 0.94rem; }

/* ===== 5 RZECZY: blok z naglowkiem + grid kart ===== */
.musthave-block { margin-top: 4rem; } /* WHY: oddziel od osi czasu, zeby naglowek nie byl przyklejony */
.musthave-head { margin-bottom: 1.75rem; text-align: center; } /* WHY: naglowek i podnaglowek wycentrowane (uwaga Mirka) */
.musthave-head h3 { margin: 0 0 0.4rem; font-size: 1.5rem; }
.musthave-head p { margin: 0 auto; max-width: 600px; color: var(--text-dim); }
.musthave-grid {
    display: flex; flex-wrap: wrap; justify-content: center; /* WHY: 5 elementow, ostatni rzad wycentrowany, brak sieroty */
    gap: 1rem; margin-top: 2rem;
}
.musthave-card {
    flex: 1 1 200px; max-width: 240px; /* WHY: rowne karty, brak rozciagania sieroty na cala szerokosc */
    background: var(--bg-elev-1); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.5rem;
}
.musthave-num {
    width: 36px; height: 36px; border-radius: 999px; background: var(--accent-soft);
    color: var(--accent); font-weight: 700; display: flex; align-items: center;
    justify-content: center; margin-bottom: 0.85rem;
}
.musthave-card h4 { margin: 0 0 0.45rem; font-size: 1.02rem; }
.musthave-card p { margin: 0; color: var(--text-dim); font-size: 0.9rem; line-height: 1.5; }

/* ===== DROBNE ===== */
.balance { text-wrap: balance; }
.lede-box {
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    border-radius: var(--radius);
    padding: 1.5rem 1.75rem;
    margin-top: 1.75rem;
}
.lede-box p { margin: 0; font-size: 1.1rem; line-height: 1.6; color: var(--text); }
.source-note {
    margin: 2.5rem auto 0;
    padding-top: 1.25rem;
    max-width: 720px;
    border-top: 1px solid var(--border); /* WHY: pasek zamiast urwanego tekstu na 30% */
    font-size: 0.8rem;
    color: var(--text-faint);
    line-height: 1.6;
    text-align: center; /* WHY: wycentrowany przypis, nie przyklejony do lewej */
}
.source-note a { color: var(--text-dim); }

/* CTA: rowne odstepy guzikow + wycentrowany, krotki disclaimer */
.cta-buttons {
    display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; margin-top: 2rem;
}
.disclaimer {
    margin: 2.5rem auto 0;
    max-width: 640px;
    padding: 0;
    background: none;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-faint);
    line-height: 1.6;
}

/* ===== MOBILE: tabele -> karty (koniec poziomego scrolla i ucinania kolumn) ===== */
@media (max-width: 760px) {
    .cmp-wrap { overflow: visible; border: none; background: none; border-radius: 0; }
    .cmp { min-width: 0; width: 100%; font-size: 0.95rem; }
    .cmp thead { display: none; } /* WHY: na mobile naglowki ida jako etykiety per komorka */
    .cmp tbody, .cmp tr, .cmp td { display: block; }
    .cmp tr,
    .cmp tbody tr.grp {
        background: var(--bg-elev-1);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 1.1rem 1.25rem;
        margin-bottom: 0.85rem;
    }
    .cmp tbody tr:hover { background: var(--bg-elev-1); }
    .cmp td {
        display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
        padding: 0.45rem 0; border: none; text-align: right;
    }
    .cmp td::before {
        content: attr(data-label);
        font-weight: 600; color: var(--text-dim);
        text-align: left; flex: 0 0 46%; white-space: normal;
    }
    /* pierwsza komorka = tytul karty (Dostawca / Platforma / Cecha) */
    .cmp td:first-child {
        display: block; text-align: left; font-weight: 700; font-size: 1.05rem;
        margin: 0 0 0.5rem; padding: 0 0 0.6rem; border-bottom: 1px solid var(--border);
        white-space: normal;
    }
    .cmp td:first-child::before { display: none; }
}
