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

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

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

body {
  font-family: 'Inter', 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, 2rem);
}

.site-head {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 2rem) clamp(1.25rem, 5vw, 2rem) 0;
}
.site-head .brand {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
}

h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
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: #fff;
}
.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; }

/* ── Stopka NAP ─────────────────────────────────────────── */
.site-footer {
  padding: clamp(1.25rem, 3vh, 2rem) clamp(1.25rem, 5vw, 2rem);
  text-align: center;
  color: var(--muted);
  border-top: 1px solid var(--line);
  margin-top: 2rem;
}
.site-footer .nap { font-size: 0.72rem; line-height: 1.5; margin-bottom: 0.5rem; }
.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: #fff;
  transition: border-color 0.15s ease;
}
.counter:hover { border-color: var(--ink); }
.counter.is-active { border-color: var(--ink); background: var(--ink); color: #fff; }
.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: #fff;
  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: #fff;
}
.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; }
}
