/* Frictiekompas — stijlen */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --teal:        #01898f;
  --teal-dark:   #016f74;
  --teal-light:  #e6f4f5;
  --bg:          #f4f6f8;
  --card:        #ffffff;
  --border:      #e2e8f0;
  --text:        #0f172a;
  --muted:       #64748b;
  --danger:      #ef4444;
  --success:     #10b981;
  --warning:     #f59e0b;
  --radius:      14px;
  --radius-sm:   8px;
  --shadow:      0 2px 12px rgba(0,0,0,.07);
  --shadow-lg:   0 8px 32px rgba(1,137,143,.15);
}

body {
  font-family: 'General Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 15px;
  line-height: 1.6;
}

/* ── Typography ── */
h1 { font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }

/* ── Header ── */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 0 24px; height: 60px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text);
}
.logo-icon {
  width: 32px; height: 32px;
  background: var(--teal); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.logo-text { font-weight: 700; font-size: 15px; }
.logo-text span { color: var(--muted); font-weight: 500; }
.header-actions { display: flex; align-items: center; gap: 12px; }

/* ── Main ── */
main { flex: 1; max-width: 1100px; margin: 0 auto; width: 100%; padding: 48px 24px; }
.page-header { margin-bottom: 36px; }
.page-subtitle { font-size: 14px; color: var(--muted); margin-top: 4px; }

/* ── Cards ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.card-sm { padding: 20px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s;
  border: none;
  text-decoration: none;
}
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); }
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--teal); color: var(--teal); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Forms ── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.form-group label {
  font-size: 12px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .5px;
}
.form-control {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit;
  outline: none;
  transition: border-color .15s;
  background: var(--card);
  color: var(--text);
  width: 100%;
}
.form-control:focus { border-color: var(--teal); }
textarea.form-control { resize: vertical; min-height: 80px; }

/* ── Alerts ── */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 14px; margin-bottom: 20px;
}
.alert-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-info { background: var(--teal-light); color: var(--teal-dark); border: 1px solid #a7d9db; }

/* ── Score badge ── */
.score-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px;
  border-radius: 50%;
  font-size: 18px; font-weight: 800;
  background: var(--teal-light); color: var(--teal-dark);
}
.score-badge.low  { background: #fef2f2; color: #991b1b; }
.score-badge.mid  { background: #fffbeb; color: #92400e; }
.score-badge.high { background: #f0fdf4; color: #166534; }

/* ── Score slider ── */
.score-track {
  display: flex; align-items: center; gap: 12px; margin: 8px 0;
}
input[type=range] {
  -webkit-appearance: none;
  flex: 1; height: 6px;
  background: var(--border); border-radius: 3px; outline: none;
  cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  background: var(--teal); border-radius: 50%;
  cursor: pointer; transition: transform .15s;
  box-shadow: 0 2px 6px rgba(1,137,143,.35);
}
input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.2); }
.score-value-display {
  min-width: 36px; text-align: center;
  font-size: 22px; font-weight: 800; color: var(--teal);
}

/* ── Checkboxes (factor pills) ── */
.factor-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.factor-pill input[type=checkbox] { display: none; }
.factor-pill label {
  display: inline-flex; align-items: center;
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  user-select: none;
  text-transform: none; letter-spacing: 0; color: var(--text);
}
.factor-pill input:checked + label {
  background: var(--teal); border-color: var(--teal); color: #fff;
}

/* ── Lost-time radio buttons ── */
.lost-time-options { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.lost-time-option input[type=radio] { display: none; }
.lost-time-option label {
  display: inline-flex; align-items: center;
  padding: 6px 16px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all .15s; color: var(--text);
  text-transform: none; letter-spacing: 0;
}
.lost-time-option input:checked + label {
  background: var(--text); border-color: var(--text); color: #fff;
}

/* ── Progress bar (survey steps) ── */
.progress-bar-wrap {
  background: var(--border); border-radius: 4px;
  height: 4px; margin-bottom: 32px; overflow: hidden;
}
.progress-bar-fill {
  height: 100%; background: var(--teal);
  transition: width .3s ease;
}
.step-indicators {
  display: flex; gap: 8px; margin-bottom: 24px;
}
.step-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border); transition: background .2s;
}
.step-dot.active { background: var(--teal); transform: scale(1.3); }
.step-dot.done { background: var(--teal); opacity: .5; }

/* ── Domain step card ── */
.domain-step { display: none; }
.domain-step.active { display: block; }
.domain-icon {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--teal-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; margin-bottom: 16px;
}

/* ── Navigation in survey ── */
.survey-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 32px; padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* ── Stats grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 28px;
}
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: var(--teal);
}
.stat-domain { font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .8px; margin-bottom: 8px; }
.stat-score {
  font-size: 42px; font-weight: 800; line-height: 1;
  color: var(--text); margin-bottom: 4px;
}
.stat-score .stat-max { font-size: 20px; color: var(--muted); font-weight: 400; }
.stat-n { font-size: 12px; color: var(--muted); }

/* ── Charts ── */
.chart-container { position: relative; height: 260px; }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 768px) { .chart-grid { grid-template-columns: 1fr; } }

/* ── Table ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
  text-align: left; padding: 10px 12px;
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 2px solid var(--border);
}
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg); }

/* ── Comment list ── */
.comment-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.comment-item:last-child { border-bottom: none; }
.comment-meta { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.comment-text { font-size: 14px; color: var(--text); }

/* ── Org cards (beheer) ── */
.org-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.org-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px;
  text-decoration: none; color: var(--text);
  transition: all .2s;
  position: relative; overflow: hidden;
}
.org-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: var(--teal); transform: scaleX(0);
  transform-origin: left; transition: transform .2s;
}
.org-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.org-card:hover::before { transform: scaleX(1); }

/* ── Badge ── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase;
}
.badge-teal { background: var(--teal-light); color: var(--teal-dark); }
.badge-gray { background: #f1f5f9; color: var(--muted); }

/* ── Toggle switch ── */
.toggle-wrap { display: flex; align-items: center; gap: 10px; }
.toggle {
  position: relative; width: 42px; height: 24px;
  background: var(--border); border-radius: 12px;
  cursor: pointer; transition: background .2s;
  flex-shrink: 0;
}
.toggle.on { background: var(--teal); }
.toggle::after {
  content: ''; position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: #fff; border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle.on::after { transform: translateX(18px); }

/* ── Footer ── */
footer {
  text-align: center; padding: 24px;
  font-size: 12px; color: var(--muted);
  border-top: 1px solid var(--border);
}

/* ── Login center ── */
.login-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 70vh;
}
.login-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 40px;
  width: 100%; max-width: 400px; box-shadow: var(--shadow);
}
.login-logo {
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 28px;
}

/* ── Radar chart canvas ── */
#radar-chart { max-width: 320px; margin: 0 auto; display: block; }

/* ── Responsive ── */
@media (max-width: 600px) {
  main { padding: 24px 16px; }
  .card { padding: 20px; }
  h1 { font-size: 22px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Utility ── */
.mt-4  { margin-top: 16px; }
.mt-8  { margin-top: 32px; }
.mb-4  { margin-bottom: 16px; }
.flex  { display: flex; }
.items-center { align-items: center; }
.gap-3 { gap: 12px; }
.gap-2 { gap: 8px; }
.text-muted { color: var(--muted); font-size: 13px; }
.text-right { text-align: right; }
.w-full { width: 100%; }
.hidden { display: none !important; }
