/* Giganet — wspólny arkusz stylów (UIKIT)
   Monochrom, minimalizm, dużo światła. Tokeny identyczne jak strona główna. */

:root {
  color-scheme: light;
  --ink: #111111;
  --muted: #8a8a8a;
  --line: #e7e7e7;
  --bg: #ffffff;
  --text: #444444;
  --field-bg: #ffffff;
  --field-focus: #111111;
  --danger: #b00020;
  --surface: #fafafa;
  --radius: 12px;
  --maxw: 76rem;
}

/* ── Reset ──────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: 'Geist', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  line-height: 1.55;
}

a { color: inherit; }

/* ── Układ stron publicznych ────────────────────────────── */
.site-main {
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(1.75rem, 5vw, 3.5rem) clamp(1.25rem, 5vw, 3.5rem);
}

.site-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.4rem clamp(1.25rem, 5vw, 3.5rem);
  position: relative;
}
.site-head::after { content: ""; position: absolute; bottom: 0; left: clamp(1.25rem, 5vw, 3.5rem); right: clamp(1.25rem, 5vw, 3.5rem); border-bottom: 1px solid var(--line); }
.site-head .brand {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
}

h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
h1, h2 { font-family: 'Schibsted Grotesk', 'Geist', system-ui, sans-serif; font-weight: 800; }
h1 { font-size: clamp(1.9rem, 6vw, 2.85rem); margin-bottom: 0.4em; }
h2 { font-size: clamp(1.25rem, 4vw, 1.6rem); margin: 1.6em 0 0.5em; }
h3 { font-size: 1.05rem; margin: 1.3em 0 0.4em; }

p { color: var(--text); margin: 0 0 1em; }
.lead { font-size: clamp(1rem, 2.4vw, 1.15rem); font-weight: 300; color: var(--text); }

.prose { max-width: 34rem; }
.prose ul, .prose ol { color: var(--text); margin: 0 0 1em 1.25rem; }
.prose li { margin: 0.3em 0; }
.prose a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

/* ── Formularz ──────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 1.15rem; max-width: 34rem; }

.field { display: flex; flex-direction: column; gap: 0.4rem; }

.label {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.label .req { color: var(--muted); font-weight: 400; }

.input, .textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--field-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 0.95rem;    /* duże tap-targety */
  min-height: 3rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.textarea { min-height: 8rem; resize: vertical; line-height: 1.5; }

.input::placeholder, .textarea::placeholder { color: var(--muted); }

.input:focus, .textarea:focus {
  outline: none;
  border-color: var(--field-focus);
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.08);
}

.input[aria-invalid="true"], .textarea[aria-invalid="true"] {
  border-color: var(--danger);
}
.input[aria-invalid="true"]:focus, .textarea[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px rgba(176, 0, 32, 0.12);
}

.hint { font-size: 0.8rem; color: var(--muted); }

.error {
  font-size: 0.8rem;
  color: var(--danger);
  min-height: 0;
}
.error:empty { display: none; }

/* Zgoda RODO */
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
}
.checkbox-row input[type="checkbox"] {
  flex: none;
  width: 1.3rem;
  height: 1.3rem;
  margin-top: 0.05rem;
  accent-color: var(--ink);
  cursor: pointer;
}
.checkbox-row a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

/* Honeypot — całkowicie poza ekranem */
.hp {
  position: absolute !important;
  left: -9999px !important;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ── Przyciski (pill) ───────────────────────────────────── */
.btn, .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 2rem;
  min-height: 3rem;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.btn {
  background: var(--ink);
  color: var(--bg);
}
.btn:hover { opacity: 0.82; transform: translateY(-1px); }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-1px); }
.btn-ghost:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ── Stan sukcesu ───────────────────────────────────────── */
.form-success {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.5rem 1.5rem;
  max-width: 34rem;
}
.form-success[hidden] { display: none; }
.form-success h2 { margin-top: 0; }
.form-success p { margin-bottom: 0; }

/* ── Strona kontaktu: zapewnienia, kroki, pytania ───────── */
.contact-intro { max-width: 44rem; }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; margin-top: 2.5rem; }
.contact-grid > * > h2:first-child { margin-top: 0; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.assure { list-style: none; display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; color: var(--text); }
.assure li::before { content: "✓ "; color: var(--muted); }
.next-steps { max-width: 34rem; margin: 0 0 1em 1.25rem; color: var(--text); }
.next-steps li { margin: 0.6em 0; padding-left: 0.25rem; }
.next-steps strong { color: var(--ink); }
.faq-list { max-width: 34rem; border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); padding: 0.85rem 0; }
.faq-list summary { cursor: pointer; font-weight: 500; }
.faq-list details p { margin: 0.6rem 0 0; }

/* ── Stopka NAP ─────────────────────────────────────────── */
.site-footer {
  padding-block: 2.2rem;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
  margin-top: 2rem;
}
.site-footer .inner { max-width: var(--maxw); margin: 0 auto; padding-inline: clamp(1.25rem, 5vw, 3.5rem); }
.site-footer p { margin: 0; }
.site-footer .about { color: var(--text); }
.site-footer .about a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; margin-top: 0.9rem; }
.site-footer nav a { text-decoration: none; }
.site-footer .legal { margin-top: 0.9rem; font-size: 0.72rem; color: var(--muted); }
.site-footer .tag {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.site-footer a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.site-footer a:hover { color: var(--ink); }

/* ═══════════════════════════════════════════════════════════
   PANEL ADMINA
   ═══════════════════════════════════════════════════════════ */
.admin {
  flex: 1;
  width: 100%;
  max-width: 68rem;
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 2rem);
}
.admin-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1.5rem;
}
.admin-bar h1 { font-size: 1.4rem; margin: 0; }

.muted { color: var(--muted); }

/* Filtry + szukajka */
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.filters form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.filters .input { min-height: 2.6rem; padding: 0.55rem 0.8rem; width: auto; }
.filters select.input { min-width: 12rem; }

/* Liczniki wg statusu */
.counter {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--text);
  text-decoration: none;
  background: var(--bg);
  transition: border-color 0.15s ease;
}
.counter:hover { border-color: var(--ink); }
.counter.is-active { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.counter .n { font-weight: 600; }

/* Tabela leadów */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.table {
  width: 100%;
  min-width: 56rem;            /* poniżej tej szerokości .table-wrap przewija się poziomo zamiast zgniatać kolumny */
  border-collapse: collapse;
  font-size: 0.88rem;
}
.table th, .table td {
  text-align: left;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.table th {
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--surface); }
.table td .lead-name { font-weight: 500; }
.table td a { color: var(--ink); }
.table details { margin-top: 0.35rem; }
.table details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.82rem;
  list-style: none;
}
.table details summary::-webkit-details-marker { display: none; }
.table details summary::before { content: "▸ "; }
.table details[open] summary::before { content: "▾ "; }
.table details .msg {
  margin-top: 0.4rem;
  white-space: pre-wrap;
  color: var(--text);
  max-width: 42rem;
}

/* Badge statusów — monochrom, neutralny, akcent obwódką/kropką */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
}
.badge::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
}
.badge--new         { border-color: #111; color: #111; }
.badge--new::before { background: #111; }
.badge--in_progress         { color: #333; }
.badge--in_progress::before { background: #666; }
.badge--answered         { color: #333; }
.badge--answered::before { background: #999; box-shadow: 0 0 0 1px #666 inset; }
.badge--closed         { color: var(--muted); }
.badge--closed::before { background: #cfcfcf; }
.badge--spam         { color: var(--muted); border-style: dashed; }
.badge--spam::before { background: #fff; box-shadow: 0 0 0 1px var(--muted) inset; }

/* Formularze w wierszu (zmiana statusu, notatka) */
.status-form { display: inline-flex; gap: 0.4rem; align-items: center; }
.status-form select.input { min-height: 2.4rem; padding: 0.4rem 0.6rem; width: auto; }
.status-form .btn, .status-form .btn-ghost { min-height: 2.4rem; padding: 0.4rem 1rem; font-size: 0.82rem; }

.note-form { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.5rem; }
.note-form .textarea { min-height: 3.5rem; min-width: 14rem; font-size: 0.85rem; padding: 0.5rem 0.7rem; }
.note-form .btn, .note-form .btn-ghost { align-self: flex-start; min-height: 2.4rem; padding: 0.4rem 1rem; font-size: 0.82rem; }

/* Karta logowania */
.login-card {
  max-width: 22rem;
  margin: clamp(2rem, 10vh, 5rem) auto;
  padding: 2rem 1.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}
.login-card h1 { font-size: 1.3rem; margin-bottom: 1.25rem; text-align: center; }
.login-card .form { gap: 1rem; }
.login-card .btn { width: 100%; }

/* ── Responsywność ──────────────────────────────────────── */
@media (max-width: 640px) {
  .table th:nth-child(2), .table td:nth-child(2) { display: none; } /* ukryj kolumnę drugorzędną (data) na wąskich */
}

/* ── Redukcja ruchu ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* ── Tryb ciemny (data-theme ustawia /assets/theme.js) ───── */
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f2f2ef;
  --muted: #9b9b95;
  --line: #2b2b28;
  --bg: #111110;
  --text: #c9c8c0;
  --field-bg: #1a1a19;
  --field-focus: #f2f2ef;
  --danger: #ff6b7a;
  --surface: #1a1a19;
}
:root[data-theme="dark"] .badge--new { border-color: var(--ink); color: var(--ink); }
:root[data-theme="dark"] .badge--new::before { background: var(--ink); }

/* ── Nagłówek: nawigacja i przełącznik trybu ───────────── */
.site-head nav { display: flex; align-items: center; gap: 1.2rem; font-size: 0.85rem; }
.site-head nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
.site-head nav a:hover { color: var(--ink); }
.theme-toggle {
  background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 999px;
  width: 2rem; height: 2rem; font-size: 0.95rem; line-height: 1; cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--ink); }
.theme-toggle .to-light, :root[data-theme="dark"] .theme-toggle .to-dark { display: none; }
:root[data-theme="dark"] .theme-toggle .to-light { display: inline; }
/* Telefon: w menu zostaje „Usługi”; lokalne SEO jest na ich liście */
@media (max-width: 480px) { .site-head nav a[href="/pozycjonowanie-lokalne/"] { display: none; } }

/* Kolor akcentu: ten sam błękit linii z map miast co w landing.css */
:root { --accent: #1f6f93; }
:root[data-theme="dark"] { --accent: #74bcd9; }
.assure li::before, .next-steps li::marker, .faq-list summary::marker { color: var(--accent); }
.prose a, .checkbox-row a, .hint a { text-decoration-color: var(--accent); }
.input:focus, .textarea:focus { border-color: var(--accent); }
.btn:focus-visible, .btn-ghost:focus-visible { outline-color: var(--accent); }

/* Kontakt: ciemny nagłówek z nocnym zdjęciem miasta, jak na pozostałych stronach; menu leży na zdjęciu */
body[data-page="kontakt"], body[data-page="polityka"] { position: relative; }
body[data-page="kontakt"] .site-head, body[data-page="polityka"] .site-head { position: absolute; top: 0; left: 0; right: 0; z-index: 2; }
body[data-page="kontakt"] .site-head .brand, body[data-page="polityka"] .site-head .brand { color: #fff; }
body[data-page="kontakt"] .site-head nav a, body[data-page="polityka"] .site-head nav a { color: rgba(255,255,255,0.65); }
body[data-page="kontakt"] .site-head nav a:hover, body[data-page="polityka"] .site-head nav a:hover { color: #fff; }
body[data-page="kontakt"] .site-head .theme-toggle, body[data-page="polityka"] .site-head .theme-toggle { border-color: rgba(255,255,255,0.35); color: rgba(255,255,255,0.75); }
body[data-page="kontakt"] .site-head::after, body[data-page="polityka"] .site-head::after { border-bottom-color: rgba(255,255,255,0.14); }
.page-hero { position: relative; background: #111 url("/assets/img/pozycjonowanie-lokalne-miasto-noca-siec-ulic-1680.webp") center/cover no-repeat; color: #fff; }
.page-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.66) 45%, rgba(0,0,0,0.35) 100%); }
.page-hero__inner { position: relative; max-width: var(--maxw); margin: 0 auto; padding: clamp(6.5rem, 14vw, 9rem) clamp(1.25rem, 5vw, 3.5rem) clamp(2.5rem, 7vh, 4.5rem); }
.page-hero .eyebrow { font-size: 0.75rem; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase; color: rgba(255,255,255,0.68); margin-bottom: 1.4rem; }
.page-hero h1 { font-size: clamp(2rem, 5.2vw, 3.8rem); line-height: 1; letter-spacing: -0.03em; color: #fff; margin: 0; }
.page-hero h1 .line { display: block; }
.page-hero h1 .dim { color: rgba(255,255,255,0.6); }
.page-hero .lead { margin: 1.6rem 0 0; max-width: 46ch; font-size: clamp(1.05rem, 2vw, 1.3rem); color: rgba(255,255,255,0.84); }
@media (max-width: 800px) { .page-hero { background-image: url("/assets/img/pozycjonowanie-lokalne-miasto-noca-siec-ulic-840.webp"); } }
