/* Collytics — wspólny arkusz stylów (elegancki, spokojny, dużo bieli). */

:root {
  --bg: #FFFFFF;
  --bg-section: #FAFAFA;
  --text: #141416;
  --text-muted: #6B7280;
  --border: #ECECEC;
  --border-strong: #D6D6D6;
  --brand: #823C7C;
  --brand-dark: #6F326B;
  --accent: #DD3F84;
  --accent-soft: rgba(221, 63, 132, 0.18);
  --green: #1E6B44;
  --green-bg: #E7F4EC;
  --yellow: #8A6D1B;
  --yellow-bg: #FBF3D9;
  --gray: #5B6168;
  --gray-bg: #F0F0F0;
  --red: #A93226;
  --red-bg: #FCE9E9;
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 1.35rem; font-weight: 700; margin: 0 0 8px; }
h2 { font-size: 1.05rem; font-weight: 600; margin: 0 0 12px; }
p { margin: 0 0 12px; }

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

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.card:last-child { margin-bottom: 0; }
.card > :last-child { margin-bottom: 0; }
.card--narrow { max-width: 440px; margin-left: auto; margin-right: auto; }

.muted { color: var(--text-muted); font-size: 0.88rem; }

.error {
  background: var(--red-bg);
  color: var(--red);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.ok {
  background: var(--green-bg);
  color: var(--green);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

/* --- Górne menu ---------------------------------------------------------- */

.navbar {
  background: var(--bg);
}
.brand-strip {
  height: 3px;
  background: linear-gradient(to right, #F0D264, #E5835C, #DD3F84, #823C7C);
}
.navbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 20px;
}
.brand {
  font-weight: 800;
  letter-spacing: 0.16em;
  font-size: 0.92rem;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 15px 0 13px;
  border-bottom: 2px solid transparent;
}
.nav-link:hover { color: var(--text); text-decoration: none; }
.nav-link.active {
  color: var(--brand);
  font-weight: 600;
  border-bottom-color: var(--brand);
}
.nav-button {
  background: none;
  border: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 15px 0 13px;
  border-bottom: 2px solid transparent;
}
.nav-button:hover { color: var(--text); }
.nav-spacer { margin-left: auto; }

.impersonate-bar {
  background: #FDF1F6;
  color: var(--text);
  font-size: 0.88rem;
  padding: 8px 16px;
}
.impersonate-bar .impersonate-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
}

/* --- Przyciski ----------------------------------------------------------- */

button {
  font: inherit;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
  border: 1px solid transparent;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.4;
}
button:hover { background: var(--brand-dark); }

.btn {
  display: inline-block;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.4;
  background: var(--brand);
  color: #fff;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; color: #fff; }

.btn-secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); background: #fff; }

.btn-danger {
  background: #fff;
  color: var(--red);
  border-color: #E7BFBF;
}
.btn-danger:hover { background: var(--red-bg); color: var(--red); border-color: var(--red); }

.btn-sm { padding: 4px 11px; font-size: 0.8rem; border-radius: 6px; }

/* --- Formularze ---------------------------------------------------------- */

label {
  display: block;
  margin: 16px 0 6px;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
}
label:first-of-type { margin-top: 0; }

input, select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font: inherit;
  color: var(--text);
  background: #fff;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { resize: vertical; }

.field-error {
  color: var(--red);
  font-size: 0.82rem;
  margin-top: 4px;
}

/* --- Tabele -------------------------------------------------------------- */

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th {
  text-align: left;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  vertical-align: middle;
}

tbody tr:hover { background: var(--bg-section); }

.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* --- Pigułki statusów ---------------------------------------------------- */

.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}
.pill--green { background: var(--green-bg); color: var(--green); }
.pill--yellow { background: var(--yellow-bg); color: var(--yellow); }
.pill--gray { background: var(--gray-bg); color: var(--gray); }
.pill--red { background: var(--red-bg); color: var(--red); }

/* --- Strona logowania ---------------------------------------------------- */

.auth-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  background: var(--bg);
}
.auth-brand {
  font-weight: 800;
  letter-spacing: 0.2em;
  font-size: 1.35rem;
  color: var(--text);
}
.auth-strip {
  width: 170px;
  height: 3px;
  margin: 14px auto 28px;
  border-radius: 2px;
  background: linear-gradient(to right, #F0D264, #E5835C, #DD3F84, #823C7C);
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

/* --- Strona ankiety i podziękowania -------------------------------------- */

.survey-wrap {
  max-width: 480px;
  margin: 32px auto;
  padding: 16px;
  text-align: center;
}
.survey-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
}
.scores {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 28px 0;
  flex-wrap: wrap;
}
.scores button {
  width: 60px;
  height: 60px;
  font-size: 1.6rem;
  font-weight: 700;
  border-radius: 50%;
  border: 2px solid var(--brand);
  background: #fff;
  color: var(--brand);
  cursor: pointer;
}
.scores button:hover { background: #FBF3F9; }
.notice { color: var(--text); font-weight: 600; }

/* --- Elementy pomocnicze ------------------------------------------------- */

.code-key {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.05rem;
  letter-spacing: 2px;
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin: 4px 0;
}
.break-all { word-break: break-all; }
.inline { display: inline; }
.ml-auto { margin-left: auto; }
.checkbox { width: auto; }
.card--accent { border-left: 4px solid var(--accent); }

/* --- Dostępność i responsywność ------------------------------------------ */

:focus-visible {
  outline: 3px solid rgba(221, 63, 132, 0.55);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .navbar-inner { gap: 4px 14px; }
  .nav-link { padding: 12px 0 11px; }
  .wrap { padding: 20px 12px; }
  .card { padding: 18px; }
}
