@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;1,400&family=Inter:wght@400;500;600&display=swap');

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

:root {
  --cream: #f5f0e8;
  --card: #fffdf7;
  --green: #4a7c59;
  --green-light: #e8f0eb;
  --border: #d9d2c5;
  --text: #2c2c2c;
  --muted: #7a7065;
  --shadow: 2px 3px 12px rgba(0,0,0,0.08);
}

html, body {
  height: 100%;
  background: var(--cream);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

/* ── Progress bar ── */
#progress-bar-wrap {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--border);
  z-index: 100;
}
#progress-bar {
  height: 100%;
  background: var(--green);
  transition: width 0.4s ease;
  width: 0%;
}

/* ── Layout ── */
#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 16px 32px;
}

.slide-container {
  width: 100%;
  max-width: 680px;
  position: relative;
  overflow: hidden;
}

/* ── Card ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow);
  padding: 40px 44px 36px;
  position: relative;
}

/* lined-paper rule lines */
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: repeating-linear-gradient(
    transparent,
    transparent 31px,
    #e8e3d9 31px,
    #e8e3d9 32px
  );
  background-position: 0 52px;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0.45;
}

.card > * { position: relative; }

/* ── Question meta ── */
.q-meta {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

/* ── Question text ── */
.q-text {
  font-family: 'Lora', serif;
  font-size: 1.2rem;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 28px;
}

/* ── Answer options ── */
.options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }

.option-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 5px;
  background: transparent;
  transition: background 0.15s, border-color 0.15s;
  font-size: 0.95rem;
  line-height: 1.5;
}

.option-label:hover {
  background: var(--green-light);
  border-color: var(--green);
}

.option-label input[type="radio"] { display: none; }

.option-check {
  flex-shrink: 0;
  width: 18px; height: 18px;
  margin-top: 2px;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: white;
  transition: border-color 0.15s, background 0.15s;
}

.option-label.selected {
  background: var(--green-light);
  border-color: var(--green);
}

.option-label.selected .option-check {
  border-color: var(--green);
  background: var(--green);
  box-shadow: inset 0 0 0 3px white;
}

/* ── Comment field ── */
.comment-wrap { margin-bottom: 28px; }

.comment-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  font-style: italic;
}

.comment-field {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 12px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: rgba(255,255,255,0.7);
  resize: vertical;
  min-height: 60px;
  transition: border-color 0.15s;
}

.comment-field:focus { outline: none; border-color: var(--green); }

/* ── Navigation buttons ── */
.nav-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.btn {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 10px 22px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  border: none;
}

.btn-back {
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--border);
}
.btn-back:hover { background: var(--green-light); border-color: var(--green); color: var(--green); }

.btn-next {
  background: var(--green);
  color: white;
  margin-left: auto;
}
.btn-next:hover:not(:disabled) { background: #3d6b4b; }
.btn-next:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Slide animations ── */
.slide-enter-right { animation: slideInRight 0.3s ease forwards; }
.slide-exit-left   { animation: slideOutLeft 0.3s ease forwards; }
.slide-enter-left  { animation: slideInLeft 0.3s ease forwards; }
.slide-exit-right  { animation: slideOutRight 0.3s ease forwards; }

@keyframes slideInRight  { from { transform: translateX(60px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOutLeft  { from { transform: translateX(0); opacity: 1; } to { transform: translateX(-60px); opacity: 0; } }
@keyframes slideInLeft   { from { transform: translateX(-60px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOutRight { from { transform: translateX(0); opacity: 1; } to { transform: translateX(60px); opacity: 0; } }

/* ── Intro / Outro screens ── */
.screen {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow);
  padding: 48px 44px;
  max-width: 620px;
  width: 100%;
  text-align: center;
}

.screen h1 {
  font-family: 'Lora', serif;
  font-size: 1.8rem;
  margin-bottom: 16px;
  color: var(--text);
}

.screen p {
  font-size: 0.97rem;
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1.7;
}

.screen .scale-info {
  background: var(--green-light);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 16px 20px;
  margin: 24px 0;
  text-align: left;
}

.screen .scale-info p { margin-bottom: 6px; color: var(--text); font-size: 0.93rem; }
.screen .scale-info p:last-child { margin-bottom: 0; }

/* ── Results page ── */
.results-wrap {
  max-width: 760px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.results-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow);
  padding: 36px 40px;
}

.results-card h2 {
  font-family: 'Lora', serif;
  font-size: 1.3rem;
  margin-bottom: 20px;
  color: var(--text);
}

.score-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}

.score-table th {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 2px solid var(--border);
  color: var(--muted);
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
}

.score-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.score-table tr:last-child td { border-bottom: none; font-weight: 600; }

.score-bar-wrap {
  display: flex; align-items: center; gap: 10px;
}

.score-bar-bg {
  flex: 1; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden;
}
.score-bar-fill { height: 100%; background: var(--green); border-radius: 4px; }
.score-val { font-weight: 600; min-width: 32px; text-align: right; }

.chart-wrap { position: relative; max-width: 420px; margin: 0 auto; }

.disclaimer {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  margin-top: 12px;
  line-height: 1.6;
}

/* ── Likert scale (CAT-Q) ── */
.likert-wrap { margin: 20px 0 8px; }

.likert-scale {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.scale-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--card);
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.scale-btn:hover { background: var(--green-light); border-color: var(--green); }
.scale-btn.selected { background: var(--green-light); border-color: var(--green); color: var(--green); font-weight: 700; }

.likert-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--muted);
}

/* ── Overview tabs ── */
.tab-btn {
  padding: 7px 18px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--card);
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.tab-btn:hover { background: var(--green-light); border-color: var(--green); color: var(--ink); }
.tab-btn.active { background: var(--green); border-color: var(--green); color: #fff; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .card { padding: 28px 22px 24px; }
  .results-card { padding: 24px 20px; }
  .screen { padding: 32px 22px; }
  .q-text { font-size: 1.05rem; }
  .score-table th, .score-table td { padding: 8px 6px; }
}
