/* Zwiad Przetargów: clean and trustworthy. Tokens and rules follow DIRECTION.md. */

:root {
    --bg: #f7f8fa;
    --surface: #ffffff;
    --line: #e3e7ee;
    --ink: #13233f;
    --text: #3d4a5f;
    --muted: #5b6678;
    --accent: #0e7a5a;
    --accent-ink: #ffffff;
    --accent-soft: #e6f3ee;
    --shadow: 0 1px 2px rgb(19 35 63 / .05), 0 8px 24px rgb(19 35 63 / .06);
    --radius-sm: 8px;
    --radius: 12px;
    --font: "Geist Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "Geist Mono", ui-monospace, "Cascadia Mono", monospace;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0d1522;
        --surface: #131d2d;
        --line: #233046;
        --ink: #e8edf5;
        --text: #c3cbd8;
        --muted: #8d98aa;
        --accent: #3fbf91;
        --accent-ink: #0d1522;
        --accent-soft: #15302a;
        --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .25);
        color-scheme: dark;
    }
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 400 15px/1.55 var(--font);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
h1, h2, h3 { color: var(--ink); font-weight: 600; letter-spacing: -0.015em; margin: 0; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* Header */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 16px; }
.brand-mark {
    display: grid; place-items: center; width: 32px; height: 32px;
    border-radius: var(--radius-sm); background: var(--ink); color: var(--bg); font-size: 18px;
}
.nav { display: flex; gap: 24px; font-size: 14px; }
.nav a { text-decoration: none; color: var(--muted); transition: color .15s ease-out; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }

/* Page */
.page { padding: 40px 0 64px; }
.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 28px; }
.page-head .count { font-family: var(--mono); font-size: 13px; color: var(--muted); }

/* Search */
.search {
    display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 16px; box-shadow: var(--shadow); margin-bottom: 32px;
}
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink); }
.input-icon { position: relative; }
.input-icon i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 18px; pointer-events: none; }
.input {
    width: 100%; height: 44px; padding: 0 12px 0 40px;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--bg); color: var(--ink); font: inherit;
    transition: border-color .15s ease-out, box-shadow .15s ease-out;
}
.input::placeholder { color: var(--muted); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.btn {
    display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 20px;
    border: 0; border-radius: var(--radius-sm); background: var(--accent); color: var(--accent-ink);
    font: 600 15px var(--font); cursor: pointer; white-space: nowrap; text-decoration: none;
    transition: transform .15s ease-out, filter .15s ease-out;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.97); }
.btn:focus-visible, .nav a:focus-visible, .tender-title:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Tender list: hairline rows, no card per row */
.tenders { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.tender {
    display: grid; grid-template-columns: 1fr 180px; gap: 8px 32px;
    padding: 18px 20px; border-top: 1px solid var(--line);
}
.tender:first-child { border-top: 0; }
.tender-title { color: var(--ink); font-weight: 600; font-size: 16px; text-decoration: none; line-height: 1.4; }
.tender-title:hover { color: var(--accent); }
.tender-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 6px; font-size: 14px; color: var(--muted); }
.tender-meta span { display: inline-flex; align-items: center; gap: 6px; }
.tag {
    font-size: 12px; font-weight: 600; color: var(--ink);
    background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px;
}
.deadline { text-align: right; }
.deadline-date { font-family: var(--mono); font-size: 14px; color: var(--ink); }
.deadline-left { font-size: 13px; color: var(--muted); }
.deadline.soon .deadline-left { color: var(--ink); font-weight: 600; }
.deadline.closed .deadline-date, .deadline.closed .deadline-left { color: var(--muted); text-decoration: line-through; }

/* States */
.state {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 48px 24px; text-align: center;
}
.state i { font-size: 32px; color: var(--muted); }
.state h2 { font-size: 18px; margin: 12px 0 6px; }
.state p { margin: 0 auto; max-width: 46ch; color: var(--muted); }

.footnote { margin-top: 16px; font-size: 13px; color: var(--muted); }

/* Mobile */
@media (max-width: 767px) {
    .nav { display: none; }
    .page { padding-top: 24px; }
    .page-head h1 { font-size: 24px; }
    .search { grid-template-columns: 1fr; }
    .btn { justify-content: center; }
    .tender { grid-template-columns: 1fr; padding: 16px; }
    .deadline { text-align: left; display: flex; gap: 10px; align-items: baseline; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
