* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f5f5;
  color: #1a1a1a;
}

.hidden {
  display: none !important;
}

/* === Overlay screens === */
.overlay-screen {
  position: fixed;
  inset: 0;
  background: #f5f5f5;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  padding: 60px 20px 40px;
  z-index: 100;
}

.overlay-box {
  width: 100%;
  max-width: 560px;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e0e0e0;
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.overlay-box h2 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1a1a1a;
}

/* Progress badge */
.progress-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #2f6be0;
  background: rgba(47, 107, 224, 0.08);
  border: 1px solid rgba(47, 107, 224, 0.2);
  border-radius: 20px;
  padding: 4px 12px;
  align-self: flex-start;
}

.progress-badge-small {
  font-size: 0.75rem;
  color: #999;
}

/* Scenario intro */
.scenario-desc-box {
  background: #f8f8f8;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 16px 18px;
  font-size: 0.9rem;
  line-height: 1.65;
  color: #444;
}

.hint-text {
  font-size: 0.83rem;
  color: #888;
  line-height: 1.55;
}

/* Done screen */
.done-text {
  font-size: 0.92rem;
  color: #666;
  line-height: 1.65;
}

/* Lock */
#code-input {
  padding: 12px 16px;
  background: #ffffff;
  border: 1px solid #d8d8d8;
  border-radius: 8px;
  color: #1a1a1a;
  font-size: 0.95rem;
  outline: none;
}

#code-input:focus {
  border-color: #2f6be0;
  box-shadow: 0 0 0 3px rgba(47,107,224,0.1);
}

/* Consent */
.consent-body {
  font-size: 0.88rem;
  line-height: 1.65;
  color: #444;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
  background: #f8f8f8;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 16px;
}

.consent-body ul {
  padding-left: 20px;
}

.consent-body a {
  color: #2f6be0;
  text-decoration: none;
}

.consent-question {
  font-size: 0.88rem;
  color: #333;
  line-height: 1.5;
  margin-bottom: 16px;
}

.consent-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

#consent-yes,
#consent-no {
  flex: 1;
  min-width: 160px;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: background 200ms ease, box-shadow 200ms ease, transform 150ms ease;
  border: 2px solid transparent;
}

#consent-yes {
  background: #1e9e52;
  color: #fff;
  border-color: #1e9e52;
  box-shadow: 0 2px 8px rgba(30,158,82,0.18);
}

#consent-yes:hover {
  background: #18894a;
  border-color: #18894a;
  box-shadow: 0 4px 14px rgba(30,158,82,0.28);
  transform: translateY(-1px);
}

#consent-no {
  background: transparent;
  color: #888;
  border-color: #ddd;
  box-shadow: none;
}

#consent-no:hover {
  background: #fafafa;
  border-color: #bbb;
  color: #555;
}

.demo-intro {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 20px;
}

.demo-group {
  margin-bottom: 20px;
}

.demo-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #222;
  margin-bottom: 10px;
}

.demo-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.demo-pill {
  cursor: pointer;
}

.demo-pill input[type=radio] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  clip: rect(0, 0, 0, 0);
  overflow: hidden;
  margin: -1px;
}

.demo-pill span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid #d8d8d8;
  background: #ffffff;
  font-size: 0.875rem;
  color: #555;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s, box-shadow 0.12s;
  user-select: none;
  line-height: 1.3;
}

.demo-pill input[type=radio]:checked + span {
  background: #2f6be0;
  color: #fff;
  border-color: #2f6be0;
  box-shadow: 0 2px 6px rgba(47,107,224,0.2);
}

.demo-pill:hover span {
  border-color: #2f6be0;
  color: #333;
}

.demo-pill input[type=radio]:focus + span {
  outline: 2px solid #2f6be0;
  outline-offset: 2px;
}

.consent-declined-text {
  font-size: 0.88rem;
  color: #888;
  text-align: center;
  padding: 12px 0;
}

/* === Buttons === */
button {
  padding: 12px 20px;
  background: #2f6be0;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: opacity 0.15s;
}

button:disabled {
  opacity: 0.35;
  cursor: default;
}

button:not(:disabled):hover {
  opacity: 0.85;
}

.error-text {
  font-size: 0.85rem;
  color: #d0363a;
  min-height: 1.2em;
}

/* === Chat app === */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  background: #ffffff;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 130px;
  border-bottom: 1px solid #e8e8e8;
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 10;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

#header-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #444;
}

#column-labels {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  padding: 8px 130px;
  background: #fafafa;
  border-bottom: 1px solid #e8e8e8;
}

.col-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #bbb;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  text-align: center;
}

#messages {
  padding: 20px 130px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.message-row.user-row {
  display: flex;
  justify-content: flex-end;
}

.message.user {
  max-width: 55%;
  padding: 12px 16px;
  border-radius: 12px;
  border-bottom-right-radius: 4px;
  background: #2f6be0;
  color: #fff;
  font-size: 0.92rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.message-row.reply-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.message.assistant {
  padding: 14px 16px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e4e4e4;
  color: #222;
  font-size: 0.88rem;
  line-height: 1.65;
  white-space: pre-wrap;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.message.loading {
  color: #ccc;
  border-color: #ececec;
  display: flex;
  align-items: center;
  min-height: 52px;
}

/* Typing dots animation */
.dots {
  display: inline-flex;
  gap: 3px;
}

.dots span {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ccc;
  animation: dot-bounce 1.2s infinite ease-in-out;
}

.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40%           { transform: translateY(-5px); opacity: 1; }
}

#chat-form {
  display: flex;
  gap: 10px;
  padding: 16px 130px;
  border-top: 1px solid #e8e8e8;
  background: #ffffff;
}

#input {
  flex: 1;
  padding: 12px 16px;
  background: #f8f8f8;
  border: 1px solid #d8d8d8;
  border-radius: 8px;
  color: #1a1a1a;
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
  resize: none;
  overflow: hidden;
  line-height: 1.5;
  min-height: 44px;
  max-height: 180px;
  overflow-y: auto;
}

#input:focus {
  border-color: #2f6be0;
  box-shadow: 0 0 0 3px rgba(47,107,224,0.08);
  background: #ffffff;
}

#input:disabled {
  opacity: 0.5;
}

/* === Beoordelingsformulier === */
#rating-section {
  border-top: 1px solid #e8e8e8;
  padding: 28px 130px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: #fafafa;
}

.rating-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 6px;
}

.rating-subtitle {
  font-size: 0.83rem;
  color: #888;
}

/* Ratings table */
.rating-table {
  width: 100%;
  border-collapse: collapse;
}

.rating-table th {
  font-size: 0.72rem;
  font-weight: 700;
  color: #bbb;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  text-align: center;
  padding: 8px 4px;
  border-bottom: 1px solid #e8e8e8;
}

.rating-table th:first-child {
  text-align: left;
  width: 130px;
}

.criterion-label {
  font-size: 0.85rem;
  color: #555;
  padding: 10px 8px 10px 0;
  white-space: nowrap;
  border-bottom: 1px solid #f0f0f0;
}

.score-cell {
  text-align: center;
  padding: 8px 4px;
  border-bottom: 1px solid #f0f0f0;
}

.score-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  margin: 0 2px;
}

.score-btn input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  clip: rect(0, 0, 0, 0);
  overflow: hidden;
  margin: -1px;
}

.score-btn span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid #d8d8d8;
  background: #ffffff;
  font-size: 0.82rem;
  color: #aaa;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  user-select: none;
}

.score-btn input[type="radio"]:checked + span {
  background: #2f6be0;
  color: #fff;
  border-color: #2f6be0;
}

.score-btn:hover span {
  border-color: #2f6be0;
  color: #555;
}

/* Best response */
.best-response-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.best-label {
  font-size: 0.88rem;
  color: #555;
  font-weight: 500;
}

#best-response-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.best-option {
  cursor: pointer;
}

.best-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  clip: rect(0, 0, 0, 0);
  overflow: hidden;
  margin: -1px;
}

.best-option span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  border-radius: 8px;
  border: 1px solid #d8d8d8;
  background: #ffffff;
  font-size: 0.88rem;
  color: #777;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  user-select: none;
}

.best-option input[type="radio"]:checked + span {
  background: #2f6be0;
  color: #fff;
  border-color: #2f6be0;
}

.best-option:hover span {
  border-color: #2f6be0;
  color: #333;
}

#rating-submit {
  align-self: flex-start;
  padding: 12px 28px;
}

/* === Scenario prefill preview (intro screen) === */
.prefill-preview {
  background: #f0f5ff;
  border: 1px solid #c8d9f8;
  border-left: 3px solid #2f6be0;
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 0.9rem;
  color: #333;
  line-height: 1.55;
  font-style: italic;
}


/* === Verticale beoordelingsform (sequentieel) === */
.single-rating-form {
  display: flex;
  flex-direction: column;
}

.single-rating-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}

.single-rating-row .criterion-label {
  min-width: 130px;
  border-bottom: none;
  padding: 0;
}

.score-cells {
  display: flex;
  gap: 6px;
}

/* === Bot identity (single-response phase) === */
.message-row.single-reply-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 68%;
}

.bot-identity {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bot-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #2f6be0;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bot-name {
  font-size: 0.77rem;
  font-weight: 500;
  color: #999;
}

/* === Reply column wrapper (bot-identity + message) === */
.reply-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inline-col-labels {
  margin-top: 4px;
}

/* === Comparison separator === */
.comparison-separator {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 0;
  animation: fadeIn 0.4s ease-out;
}

.comparison-separator::before,
.comparison-separator::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e4e4e4;
}

.comparison-separator span {
  font-size: 0.74rem;
  color: #bbb;
  white-space: nowrap;
  padding: 0 4px;
}

/* === Animations === */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.message-row.reply-row {
  animation: fadeInUp 0.4s ease-out;
}

#rating-section {
  animation: fadeInUp 0.4s ease-out;
}

/* === Error states with visual prominence === */
.error-text:not(:empty) {
  display: inline-block;
  padding: 7px 11px;
  background: #fff0f0;
  border: 1px solid #f0c0c0;
  border-radius: 6px;
}

/* === Keyboard focus on score/best-option buttons === */
.score-btn input[type="radio"]:focus + span {
  outline: 2px solid #2f6be0;
  outline-offset: 2px;
}

.best-option input[type="radio"]:focus + span {
  outline: 2px solid #2f6be0;
  outline-offset: 2px;
}
