:root {
  --ilico-teal: #2D6F6E;
  --ilico-teal-dark: #235756;
  --ilico-sage: #A8B59A;
  --ilico-sand: #C9BCAF;
  --ilico-blue-grey: #CFD9E0;
  --ilico-coral: #F2685B;
  --ilico-coral-bg: #FFD9CC;
  --ink: #0F1621;
  --ink-soft: #3A3F46;
  --ink-faint: #8E9398;
  --bg: #F5EFE9;
  --card: #ffffff;
  --border: #E7E2D9;
  --mandatory: #F2685B;
  --mandatory-bg: #FFF0EC;
  --optional-bg: #F0F2EC;
  --optional-text: #6B7862;
  --good: #2D6F6E;
  --warn: #C98A3A;
  --bad: #F2685B;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(15, 22, 33, 0.08), 0 8px 24px rgba(15, 22, 33, 0.06);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.brand .dots span {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ilico-teal);
  margin-right: 3px;
}

.brand-name {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.brand-sub {
  color: var(--ink-soft);
  font-size: 13px;
}

h1 {
  font-size: 26px;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 19px;
  margin: 0 0 4px;
}

p.lead {
  color: var(--ink-soft);
  margin-top: 0;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}

.progress-track {
  height: 6px;
  border-radius: 4px;
  background: var(--border);
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ilico-teal), var(--ilico-sage));
  transition: width 0.25s ease;
}

.progress-label {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 24px;
}

label.field-label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 14px;
}

.field-hint {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0 0 10px;
}

input[type="text"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
}

textarea { resize: vertical; min-height: 70px; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--ilico-teal);
  box-shadow: 0 0 0 3px rgba(45, 111, 110, 0.15);
}

.field { margin-bottom: 18px; }

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.checkbox-row input { margin-top: 3px; }

.question {
  padding: 18px 0;
  border-top: 1px solid var(--border);
}
.question:first-child { border-top: none; padding-top: 0; }

.question-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 4px;
}

.question-text {
  font-weight: 600;
  font-size: 15px;
}

.tag {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.tag.mandatory { background: var(--mandatory-bg); color: var(--mandatory); }
.tag.optional { background: var(--optional-bg); color: var(--optional-text); }

.question-help {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0 0 12px;
}

.scale {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.scale label {
  flex: 1;
  text-align: center;
  cursor: pointer;
}

.scale input { display: none; }

.scale .pip {
  display: block;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 0 8px;
  font-weight: 700;
  color: var(--ink-soft);
  transition: all 0.15s ease;
}

.scale input:checked + .pip {
  background: var(--ilico-teal);
  border-color: var(--ilico-teal);
  color: #fff;
}

.scale-caption {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ink-soft);
  margin-top: -6px;
  margin-bottom: 14px;
}

.comment-toggle {
  font-size: 13px;
  color: var(--ilico-teal);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-weight: 600;
}

.buttons {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

button.btn {
  border: none;
  border-radius: 10px;
  padding: 13px 22px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary {
  background: var(--ilico-teal);
  color: #fff;
}
.btn-primary:hover { background: var(--ilico-teal-dark); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: #f2ede6; }

.error-text {
  color: var(--mandatory);
  font-size: 13px;
  margin-top: 6px;
  display: none;
}
.error-text.show { display: block; }

.intro-card {
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
}
.intro-text { flex: 1; min-width: 0; }
.intro-figure {
  width: 130px;
  height: auto;
  flex-shrink: 0;
}
@media (max-width: 560px) {
  .intro-card { flex-direction: column-reverse; text-align: center; }
  .intro-figure { width: 100px; }
}

.overview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.overview-figure {
  width: 64px;
  height: auto;
}

.done-card {
  text-align: center;
  padding: 48px 24px;
}
.done-card .stat-grid,
.done-card .bar-row {
  text-align: left;
}
.done-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--good);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 18px;
}

footer.small-print {
  text-align: center;
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 24px;
}

/* --- Admin dashboard --- */
.login-box {
  max-width: 380px;
  margin: 90px auto;
}

table.subs {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.subs th, table.subs td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
table.subs th {
  color: var(--ink-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
table.subs tr { cursor: pointer; }
table.subs tr:hover td { background: #faf6f1; }

.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.pill.good { background: #e4efee; color: var(--good); }
.pill.warn { background: #fbf0de; color: var(--warn); }
.pill.bad { background: var(--mandatory-bg); color: var(--bad); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stat-tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.stat-tile .num {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.stat-tile .label {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 2px;
}

.bar-row {
  display: grid;
  grid-template-columns: 190px 1fr 40px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  margin-bottom: 10px;
}
.bar-track {
  height: 10px;
  background: var(--optional-bg);
  border-radius: 6px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--ilico-teal), var(--ilico-sage));
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 22, 33, 0.5);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
}
.modal {
  background: var(--card);
  border-radius: var(--radius);
  max-width: 720px;
  width: 100%;
  padding: 28px;
  box-shadow: var(--shadow);
}

.detail-q {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  font-size: 14px;
}
.detail-q:first-child { border-top: none; }
.detail-q .score {
  font-weight: 800;
  flex-shrink: 0;
}

@media (max-width: 520px) {
  .bar-row { grid-template-columns: 110px 1fr 34px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
