/* Status page Inoro — jeden ręcznie pisany arkusz, bez buildu.
   Paleta niebieska z frontend/src/styles/tailwind.scss, czcionka Play (SIL OFL). */

@font-face {
  font-family: "Play";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/play-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Play";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/play-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Play";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/play-700-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Play";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/play-700-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --- tokeny ------------------------------------------------------------------------------ */

:root {
  --blue-50: #f0f9ff;
  --blue-100: #e1f4fe;
  --blue-200: #bce9fd;
  --blue-300: #86d9fc;
  --blue-400: #4abbf9;
  --blue-500: #259bf7;
  --blue-600: #147be0;
  --blue-700: #1062b5;
  --blue-800: #12538f;
  --blue-900: #134671;
  --blue-950: #0e2c47;

  --font: "Play", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e3e9f0;
  --border-strong: #cfd9e4;
  --text: #0e2c47;
  --text-muted: #4d6077;
  --link: var(--blue-700);
  --link-hover: var(--blue-800);
  --focus: var(--blue-600);
  --shadow: 0 1px 2px rgb(14 44 71 / 0.05), 0 1px 3px rgb(14 44 71 / 0.04);
  --radius: 12px;
  --radius-sm: 8px;

  /* Kolory stanów: --x = słupek / akcent, --x-fg = tekst (WCAG AA na --x-bg i na tle), --x-bg = tło odznaki. */
  --ok: #16a34a;
  --ok-fg: #15803d;
  --ok-bg: #effbf3;
  --deg: #eab308;
  --deg-fg: #854d0e;
  --deg-bg: #fdf9e3;
  --part: #f97316;
  --part-fg: #b4400c;
  --part-bg: #fff4ea;
  --major: #dc2626;
  --major-fg: #b91c1c;
  --major-bg: #fdf0f0;
  --none: #d3dce6;
  --none-fg: #4d6077;
  --none-bg: #f1f4f8;

  color-scheme: light;
}

/* Mapowanie klasy stanu na zmienne lokalne (--c, --c-fg, --c-bg). */
.s-operational { --c: var(--ok); --c-fg: var(--ok-fg); --c-bg: var(--ok-bg); }
.s-degraded { --c: var(--deg); --c-fg: var(--deg-fg); --c-bg: var(--deg-bg); }
.s-partial_outage { --c: var(--part); --c-fg: var(--part-fg); --c-bg: var(--part-bg); }
.s-major_outage { --c: var(--major); --c-fg: var(--major-fg); --c-bg: var(--major-bg); }
.s-no_data { --c: var(--none); --c-fg: var(--none-fg); --c-bg: var(--none-bg); }

/* --- podstawy ---------------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--link-hover); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}
main:focus { outline: none; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 10;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}
.skip-link:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 0 16px;
}

.icon { width: 1rem; height: 1rem; flex: none; }
.icon-lg { width: 1.5rem; height: 1.5rem; }

/* --- nagłówek i stopka ------------------------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { color: var(--text); }
.brand-logo { display: block; height: 30px; width: auto; }
.brand-sep { width: 1px; height: 20px; background: var(--border-strong); }
.brand-label { font-size: 1.0625rem; font-weight: 700; letter-spacing: 0.01em; color: var(--text-muted); }

.lang-switch {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}
.lang-switch a {
  min-width: 36px;
  padding: 4px 8px;
  border-radius: 7px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  text-decoration: none;
  color: var(--text-muted);
}
.lang-switch a:hover { color: var(--text); }
.lang-switch a[aria-current="true"] {
  background: var(--blue-600);
  color: #fff;
}

main.wrap {
  flex: 1;
  padding-top: 32px;
  padding-bottom: 48px;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0 32px;
  color: var(--text-muted);
  font-size: 0.875rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
}
.footer-note { flex-basis: 100%; }
.lang-switch-sm { margin-left: auto; }

/* --- baner ------------------------------------------------------------------------------- */

.banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  border-radius: var(--radius);
  background: var(--c-bg);
  border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
  color: var(--text);
}
.banner-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
  background: var(--c);
  color: #fff;
}
.banner.s-degraded .banner-icon,
.banner.s-no_data .banner-icon { color: var(--blue-950); }
.banner-title {
  font-size: 1.375rem;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.005em;
}
.banner-sub { margin-top: 2px; color: var(--text-muted); font-size: 0.875rem; }

/* --- sekcje i karty ---------------------------------------------------------------------- */

.section { margin-top: 36px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-title {
  margin-bottom: 12px;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  background: var(--c-bg);
  color: var(--c-fg);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}

/* --- komponenty i paski 90 dni ----------------------------------------------------------- */

.components { overflow: visible; }
.component {
  position: relative;
  padding: 18px 20px 14px;
}
.component + .component { border-top: 1px solid var(--border); }
.component-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.component-name { font-size: 1rem; font-weight: 700; line-height: 1.3; }

.bars {
  display: flex;
  gap: 2px;
  height: 34px;
}
.bar {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 2px;
  background: var(--c);
  cursor: pointer;
  transition: opacity 120ms ease-out, transform 120ms ease-out;
  -webkit-tap-highlight-color: transparent;
}
.bar.s-no_data { cursor: default; }
.bars:hover .bar { opacity: 0.55; }
.bars:hover .bar:hover,
.bar.is-active { opacity: 1; transform: scaleY(1.08); }
.bar:focus-visible { outline-offset: 1px; border-radius: 2px; opacity: 1; }

.bar-axis {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.axis-uptime { font-weight: 700; color: var(--text); text-align: center; }
.axis-start .d60, .axis-start .d30 { display: none; }

/* Wąskie ekrany: mniej słupków (ostatnie 60 / 30 dni) z podpisem. */
.note-narrow { display: none; }
@media (max-width: 720px) {
  .bar:nth-child(-n + 30) { display: none; }
  .axis-start .d90 { display: none; }
  .axis-start .d60 { display: inline; }
  .note-narrow.n60 { display: inline; }
}
@media (max-width: 480px) {
  .bar:nth-child(-n + 60) { display: none; }
  .axis-start .d60 { display: none; }
  .axis-start .d30 { display: inline; }
  .note-narrow.n60 { display: none; }
  .note-narrow.n30 { display: inline; }
  .bars { gap: 3px; }
}

.notes {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; border-radius: 2px; background: var(--c); }

/* --- tooltip słupka ---------------------------------------------------------------------- */

.tip {
  position: absolute;
  z-index: 5;
  width: max-content;
  max-width: min(300px, calc(100vw - 32px));
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgb(14 44 71 / 0.14), 0 2px 6px rgb(14 44 71 / 0.08);
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text);
  pointer-events: auto;
}
.tip[hidden] { display: none; }
.tip-date { font-weight: 700; }
.tip-state { display: flex; align-items: center; gap: 6px; margin-top: 4px; color: var(--c-fg); font-weight: 700; }
.tip-state .swatch { flex: none; }
.tip-uptime { color: var(--text-muted); }

/* --- telefon ----------------------------------------------------------------------------- */

@media (max-width: 480px) {
  main.wrap { padding-top: 20px; }
  .brand-logo { height: 26px; }
  .brand { gap: 10px; }
  .banner { padding: 16px; gap: 12px; }
  .banner-icon { width: 38px; height: 38px; }
  .banner-title { font-size: 1.1875rem; }
  .banner-refresh { display: none; }
  .component { padding: 16px 14px 12px; }
  .component-head { flex-wrap: wrap; gap: 6px 12px; }
  .lang-switch-sm { margin-left: 0; }
}

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