:root {
  --bg: #f8f3e8;
  --card: #fffaf0;
  --ink: #213529;
  --muted: #647166;
  --brand: #2f6846;
  --brand-dark: #1f4e34;
  --brand-soft: #e5efe5;
  --line: #ded5c4;
  --warning: #8a3b24;
  --shadow: 0 16px 45px rgba(33, 53, 41, 0.12);
  --radius: 22px;
  --radius-small: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

.page-shell {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 60px;
}

.hero-card,
.survey-card,
.result-card,
.open-answer-group,
.empty-state,
.error-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: clamp(22px, 4vw, 38px);
  margin-bottom: 20px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-row.split-row {
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.inner-brand { min-width: 260px; }

.brand-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: contain;
  padding: 0;
  background: #fffaf0;
  border: 1px solid rgba(47, 104, 70, 0.18);
  box-shadow: 0 8px 22px rgba(33, 53, 41, 0.10);
}

.brand-logo.large {
  width: 96px;
  height: 96px;
  margin-bottom: 12px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--brand);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

h1, h2, h3 { line-height: 1.15; }

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: -0.045em;
}

h2 {
  margin: 0 0 18px;
  font-size: clamp(1.45rem, 3vw, 2rem);
}

h3 { margin: 0 0 6px; }

.hero-text {
  max-width: 780px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.privacy-note {
  margin-top: 18px;
  padding: 14px 16px;
  background: var(--brand-soft);
  border: 1px solid rgba(47, 104, 70, 0.16);
  border-radius: var(--radius-small);
  color: var(--brand-dark);
  font-weight: 650;
}

.survey-card {
  padding: clamp(18px, 4vw, 32px);
}

.question-block {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.question-block:last-of-type { border-bottom: none; }

.required-name { padding-top: 4px; }

.question-topline {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.question-label {
  display: block;
  margin: 0 0 12px;
  color: var(--ink);
  font-weight: 800;
  font-size: 1.04rem;
}

.required { color: var(--warning); }

.text-input,
.textarea-input {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-small);
  background: #fffdf8;
  color: var(--ink);
  font: inherit;
  padding: 14px 15px;
  outline: none;
  transition: border 160ms ease, box-shadow 160ms ease;
}

.text-input:focus,
.textarea-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(47, 104, 70, 0.12);
}

.textarea-input {
  resize: vertical;
  min-height: 112px;
}

.input-error {
  border-color: var(--warning) !important;
  box-shadow: 0 0 0 4px rgba(138, 59, 36, 0.12) !important;
}

.inline-form-error {
  margin-top: 8px;
  color: var(--warning);
  font-weight: 800;
}

.range-input {
  --range-progress: 66%;
  width: 100%;
  height: 10px;
  appearance: none;
  border-radius: 999px;
  background: linear-gradient(to right, var(--brand) 0%, var(--brand) var(--range-progress), #e3dccf var(--range-progress), #e3dccf 100%);
  outline: none;
  cursor: pointer;
}

.range-input::-webkit-slider-thumb {
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand);
  border: 4px solid #fffdf8;
  box-shadow: 0 4px 14px rgba(33, 53, 41, 0.24);
}

.range-input::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand);
  border: 4px solid #fffdf8;
  box-shadow: 0 4px 14px rgba(33, 53, 41, 0.24);
}

.score-pill,
.avg-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 48px;
  min-height: 38px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--brand);
  color: #fffdf8;
  font-weight: 900;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 0.9rem;
}

.submit-block {
  padding-top: 26px;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 0;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  text-decoration: none;
}

.primary-button {
  background: var(--brand);
  color: #fffdf8;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.danger-button:hover { transform: translateY(-1px); }

.secondary-button {
  background: var(--brand-soft);
  color: var(--brand-dark);
  border: 1px solid rgba(47, 104, 70, 0.16);
}

.ghost-button {
  background: transparent;
  color: var(--brand-dark);
  border: 1px solid var(--line);
}

.danger-button {
  background: #fff3ed;
  color: var(--warning);
  border: 1px solid rgba(138, 59, 36, 0.25);
}

.link-button { margin-top: 20px; }

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.small-print,
.muted {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.error-box {
  margin: 0 0 20px;
  padding: 16px 18px;
  color: var(--warning);
  background: #fff7f1;
  border-color: rgba(138, 59, 36, 0.25);
}

.error-box.compact { margin: 16px 0; }

.error-box ul { margin: 8px 0 0 20px; padding: 0; }

.thanks-shell,
.results-shell { max-width: 1180px; }

.thanks-card,
.login-card {
  max-width: 680px;
  margin: 42px auto;
  text-align: center;
}

.login-form {
  max-width: 420px;
  margin: 24px auto 0;
  text-align: left;
}

.login-form .primary-button { width: 100%; margin-top: 14px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  padding: 16px;
  box-shadow: 0 8px 20px rgba(33, 53, 41, 0.07);
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-weight: 750;
  font-size: 0.9rem;
}

.stat-card strong {
  display: block;
  margin-top: 6px;
  font-size: 2rem;
  line-height: 1;
  color: var(--brand-dark);
}

.results-section {
  margin-top: 28px;
}

.score-results {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.result-card {
  padding: 22px;
}

.result-card-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.result-card-header p { margin: 0; color: var(--muted); }

.avg-badge {
  flex-direction: column;
  border-radius: 18px;
  min-width: 92px;
  min-height: 74px;
}

.avg-badge span { font-size: 0.75rem; opacity: 0.9; }
.avg-badge strong { font-size: 1.65rem; }

.bucket-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}

.bucket-row span {
  padding: 8px 10px;
  background: var(--brand-soft);
  border-radius: 999px;
  color: var(--brand-dark);
  font-size: 0.9rem;
}

.distribution {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;
  align-items: end;
  min-height: 190px;
  padding-top: 10px;
}

.bar-item {
  display: grid;
  grid-template-rows: 130px auto auto;
  gap: 5px;
  align-items: end;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.bar-track {
  height: 130px;
  border-radius: 999px;
  background: #e3dccf;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.bar-fill {
  width: 100%;
  min-height: 2px;
  background: var(--brand);
  border-radius: 999px 999px 0 0;
}

.bar-score { color: var(--ink); }

.open-answer-group {
  padding: 22px;
  margin-bottom: 18px;
}

.answer-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.answer-card {
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: #fffdf8;
}

.answer-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.answer-meta strong { color: var(--brand-dark); }
.answer-card p { margin: 10px 0 0; }


.success-box {
  margin: 0 0 20px;
  padding: 16px 18px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  border: 1px solid rgba(47, 104, 70, 0.20);
  border-radius: var(--radius-small);
  font-weight: 800;
}

.individual-list {
  display: grid;
  gap: 14px;
}

.individual-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.individual-card summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
}

.individual-card summary::-webkit-details-marker { display: none; }

.individual-card summary::after {
  content: 'Open';
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 900;
  font-size: 0.82rem;
}

.individual-card[open] summary::after { content: 'Sluit'; }

.individual-summary-main {
  display: grid;
  gap: 4px;
}

.individual-summary-main strong {
  font-size: 1.05rem;
  color: var(--brand-dark);
}

.individual-summary-main span,
.individual-average {
  color: var(--muted);
  font-weight: 750;
  font-size: 0.92rem;
}

.individual-content {
  padding: 0 22px 22px;
  border-top: 1px solid var(--line);
}

.individual-columns {
  display: grid;
  grid-template-columns: minmax(250px, 0.8fr) minmax(320px, 1.2fr);
  gap: 18px;
  margin-top: 18px;
}

.detail-panel {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  padding: 16px;
}

.detail-panel h4 {
  margin: 0 0 12px;
  color: var(--brand-dark);
}

.score-dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.score-dl div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.score-dl div:last-child { border-bottom: none; padding-bottom: 0; }
.score-dl dt { color: var(--ink); font-weight: 750; }
.score-dl dd { margin: 0; font-weight: 950; color: var(--brand-dark); }

.answer-detail {
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.answer-detail:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.answer-detail strong { display: block; color: var(--ink); margin-bottom: 6px; }
.answer-detail p { margin: 0; color: var(--muted); white-space: normal; }

.delete-form {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}

.submission-table .actions-cell { white-space: nowrap; }

.table-wrap {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.submission-table {
  width: 100%;
  min-width: 840px;
  border-collapse: collapse;
}

.submission-table th,
.submission-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.submission-table th {
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.86rem;
}

.submission-table tr:last-child td { border-bottom: none; }

.empty-state {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-weight: 800;
}

@media (max-width: 760px) {
  .page-shell { width: min(100% - 22px, 980px); padding-top: 18px; }
  .brand-row, .brand-row.split-row, .result-card-header, .answer-meta { align-items: flex-start; flex-direction: column; }
  .button-row { justify-content: flex-start; width: 100%; }
  .range-labels { flex-direction: column; gap: 4px; }
  .stats-grid { grid-template-columns: 1fr; }
  .distribution { gap: 4px; }
  .result-card { padding: 16px; }
  .individual-card summary { align-items: flex-start; flex-direction: column; }
  .individual-columns { grid-template-columns: 1fr; }
  .delete-form { justify-content: stretch; }
  .delete-form .danger-button { width: 100%; }
}

