/* =====================================================
   Bezpieczny Gaz Śląsk — Design System
   "Bright High-End Corporate" — czystość, precyzja, zaufanie.
   Whitespace jest tu materiałem, nie odstępem.
   ===================================================== */

:root {
    /* ── Surfaces ───────────────────────────────────────
       Ciepłe biele. Chłodna biel (#F8FAFC) czytałaby się
       klinicznie/technologicznie; ciepły off-white czyta się
       jako papier dokumentu — bliżej "kancelarii" niż "SaaS". */
    --surface:        #FFFFFF;
    --surface-subtle: #FBFAF8;
    --surface-muted:  #F4F2EE;
    --hairline:       #E7E3DD;
    --hairline-strong:#D8D3CB;

    /* ── Text ───────────────────────────────────────────
       Głęboki grafit zamiast czystej czerni — pełny kontrast
       (15.2:1) bez ostrości, która na dużej białej płaszczyźnie
       męczy wzrok. */
    --text:        #22262B;
    --text-soft:   #5A6169;

    /* ── Accent (bursztyn/pomarańcz — kolor gazu) ────────
       UWAGA — policzone wg formuły WCAG, nie "na oko":
         #FF7B29 na bieli ............ 2.59:1  ✗ (nawet dla dużego tekstu)
         biały na #FF7B29 ............ 2.59:1  ✗
         grafit na #FF7B29 ........... 5.88:1  ✓
         #B34700 na bieli ............ 5.50:1  ✓
       Stąd podział: --accent to WYŁĄCZNIE wypełnienie (i zawsze
       z ciemnym tekstem na wierzchu), --accent-text to jedyny
       wariant dopuszczony jako tekst/ikona na jasnym tle.
       Nigdy nie zamieniaj ich miejscami. */
    --accent:       #FF7B29;
    --accent-hover: #F26A15;
    --accent-text:  #B34700;
    --accent-wash:  #FFF4EC;

    /* ── Secondary accent (slate) ────────────────────────
       Chłodna przeciwwaga dla ciepłego akcentu: elementy
       techniczne, ramy dokumentów, podziały. Stabilność. */
    --slate:       #37576F;
    --slate-soft:  #7A93A8;
    --slate-line:  #CBD8E2;
    --slate-wash:  #F2F6F9;

    /* ── Semantics ──────────────────────────────────────── */
    --good: #166A41;
    --bad:  #A13224;

    /* ── Type ───────────────────────────────────────────── */
    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Code', monospace;

    /* ── Space ───────────────────────────────────────────
       Skala rośnie wykładniczo — górne wartości istnieją po to,
       żeby sekcje mogły oddychać. To jest ten "drogi" whitespace. */
    --space-1:  0.25rem;
    --space-2:  0.5rem;
    --space-3:  0.75rem;
    --space-4:  1rem;
    --space-5:  1.25rem;
    --space-6:  1.5rem;
    --space-8:  2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-28: 7rem;

    --section-y: clamp(5rem, 9vw, 8.5rem);

    /* Geometria: małe promienie. Zaokrąglone "pigułki" czytają się
       przyjaźnie/konsumencko — tu chcemy precyzji instrumentu. */
    --radius-xs: 2px;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Cienie: wielowarstwowe i bardzo rozrzedzone. Na jasnym tle
       cień ma sugerować unoszenie, nie rysować krawędź. */
    --shadow-xs: 0 1px 2px rgba(34, 38, 43, 0.04);
    --shadow-sm: 0 1px 2px rgba(34, 38, 43, 0.04), 0 4px 12px rgba(34, 38, 43, 0.04);
    --shadow-md: 0 1px 3px rgba(34, 38, 43, 0.05), 0 10px 28px rgba(34, 38, 43, 0.07);
    --shadow-lg: 0 2px 6px rgba(34, 38, 43, 0.06), 0 24px 56px rgba(34, 38, 43, 0.10);

    /* Ruch: krótszy i bardziej "sprężysty" niż w wersji ciemnej —
       na jasnym tle powolne przejścia czytają się jak ociąganie. */
    --ease:        cubic-bezier(0.22, 1, 0.36, 1);
    --motion-fast: 0.18s;
    --motion-base: 0.28s;
    --motion-slow: 0.55s;

    --content: 72rem;
    --measure: 46rem;
    --header-h: 72px;
}

/* ── Base ──────────────────────────────────────────── */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + var(--space-8));
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 1.0625rem;
    line-height: 1.7;
    letter-spacing: 0.005em;
    color: var(--text);
    background: var(--surface);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Nagłówki: ujemny tracking rośnie wraz z rozmiarem — duży tekst
   z domyślnym trackingiem wygląda na rozstrzelony. */
h1, h2, h3, h4 {
    font-family: var(--font-sans);
    color: var(--text);
    margin: 0 0 var(--space-5);
    font-weight: 700;
}

h1 {
    font-size: clamp(2.25rem, 1.3rem + 3.8vw, 4rem);
    line-height: 1.06;
    letter-spacing: -0.032em;
    font-weight: 800;
}

h2 {
    font-size: clamp(1.75rem, 1.2rem + 1.9vw, 2.5rem);
    line-height: 1.15;
    letter-spacing: -0.025em;
}

h3 {
    font-size: 1.1875rem;
    line-height: 1.35;
    letter-spacing: -0.012em;
    font-weight: 700;
}

h1:focus { outline: none; }

p { margin: 0 0 var(--space-5); }
p:last-child { margin-bottom: 0; }

a {
    color: var(--accent-text);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color var(--motion-fast) var(--ease);
}

a:hover { color: var(--accent-hover); }

:focus-visible {
    outline: 2px solid var(--slate);
    outline-offset: 3px;
    border-radius: var(--radius-xs);
}

ul, ol { padding-left: 1.15rem; margin: 0; }
li + li { margin-top: var(--space-3); }

strong { font-weight: 700; }

code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--surface-muted);
    border: 1px solid var(--hairline);
    padding: 0.1em 0.4em;
    border-radius: var(--radius-xs);
}

/* ── Layout ────────────────────────────────────────── */

.container {
    max-width: var(--content);
    margin: 0 auto;
    padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

.section { padding: var(--section-y) 0; }
.section--subtle { background: var(--surface-subtle); }
.section--muted  { background: var(--surface-muted); }

/* Hairline nad sekcją zamiast zmiany tła — najcichszy możliwy
   podział, gdy dwie sąsiednie sekcje mają ten sam kolor. */
.section--divided { border-top: 1px solid var(--hairline); }

.section__head {
    max-width: var(--measure);
    margin-bottom: var(--space-12);
}

.section__head p {
    color: var(--text-soft);
    font-size: 1.0625rem;
}

.measure { max-width: var(--measure); }

/* ── Eyebrow ───────────────────────────────────────────
   Mono + szeroki tracking = rejestr "techniczny/urzędowy".
   Cienka kreska przed etykietą to ten sam geometryczny motyw
   co szyna kroków — precyzja instrumentu pomiarowego. */

.eyebrow {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--slate);
    margin-bottom: var(--space-5);
}

.eyebrow::before {
    content: "";
    width: 1.75rem;
    height: 1px;
    background: currentColor;
    opacity: 0.45;
    flex-shrink: 0;
}

/* ── Buttons ───────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1;
    padding: 0.9rem 1.6rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background var(--motion-fast) var(--ease),
                border-color var(--motion-fast) var(--ease),
                box-shadow var(--motion-base) var(--ease),
                transform var(--motion-base) var(--ease);
}

/* Grafit na bursztynie, nie biel — biel na tym pomarańczu daje
   2.59:1 i jest nieczytelna. Ciemny tekst na nasyconym akcencie
   to świadomy wybór, nie kompromis. */
.btn-primary {
    background: var(--accent);
    color: var(--text);
    box-shadow: var(--shadow-xs);
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: var(--text);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(255, 123, 41, 0.28), 0 12px 28px rgba(34, 38, 43, 0.10);
}

.btn-primary:active { transform: translateY(0); }

.btn-ghost {
    background: var(--surface);
    color: var(--text);
    border-color: var(--hairline-strong);
}

.btn-ghost:hover {
    color: var(--text);
    border-color: var(--slate);
    background: var(--surface);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.btn-ghost:active { transform: translateY(0); }

/* ── Card ──────────────────────────────────────────── */

.card {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    padding: var(--space-8);
    transition: box-shadow var(--motion-base) var(--ease),
                transform var(--motion-base) var(--ease),
                border-color var(--motion-base) var(--ease);
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--hairline-strong);
    transform: translateY(-3px);
}

.card__title {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}

/* ── Marker lists ──────────────────────────────────── */

.list-marked {
    list-style: none;
    padding-left: 0;
}

.list-marked li {
    position: relative;
    padding-left: var(--space-8);
    color: var(--text-soft);
}

.list-marked li::before {
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 0.875rem;
    height: 0.875rem;
    display: block;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

/* Ikony jako inline SVG w data: URI — zero zewnętrznych zależności
   (font-awesome w projekcie siostrzanym to dodatkowy request i CDN),
   a kształt zostaje geometryczny i ostry w każdej skali. */
.list-marked--bad li::before {
    content: "";
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3.5 3.5l7 7M10.5 3.5l-7 7' stroke='%23A13224' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
}

.list-marked--good li::before {
    content: "";
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2.5 7.5l3 3 6-6.5' fill='none' stroke='%23166A41' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.list-marked--dot li::before {
    content: "";
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Crect x='5' y='5' width='4' height='4' fill='%2337576F'/%3E%3C/svg%3E");
}

/* ── Badge ─────────────────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.4rem 0.7rem;
    border-radius: var(--radius-xs);
    white-space: nowrap;
}

.badge--slate {
    background: var(--slate-wash);
    color: var(--slate);
    border: 1px solid var(--slate-line);
}

.badge--pending {
    background: var(--accent-wash);
    color: var(--accent-text);
    border: 1px dashed var(--accent-text);
}

/* ── Scroll reveal ─────────────────────────────────────
   Gated na html.js (ustawiane synchronicznie w <head> zanim
   przeglądarka pomaluje pierwszą klatkę) — bez JS treść jest
   po prostu widoczna, nigdy pusta strona.
   Dystans celowo mały (14px): na jasnym tle duży przelot czyta
   się jak "ciężki" slajd, a chcemy wrażenia precyzyjnego
   ustawienia elementu na miejscu. */

.js .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity var(--motion-slow) var(--ease),
                transform var(--motion-slow) var(--ease);
}

.js .reveal.revealed {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    .js .reveal { opacity: 1; transform: none; transition: none; }

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ── Blazor framework hooks ────────────────────────── */

.valid.modified:not([type=checkbox]) { outline: 1px solid var(--good); }
.invalid { outline: 1px solid var(--bad); }
.validation-message { color: var(--bad); }

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* Tu, a nie w scoped .razor.css, bo element renderuje App.razor —
   dokument-host, który nie bierze udziału w izolacji CSS tak jak
   zwykłe komponenty (reguła w MainLayout.razor.css nigdy nie działała). */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}
