:root {
  --ink: #1d1a17;
  --muted: #5a514a;
  --accent: #c35a2b;
  --accent-strong: #9f4018;
  --paper: #fff7ef;
  --card: #ffffff;
  --border: #eadfd4;
  --shadow: 0 20px 40px rgba(35, 20, 10, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 10%, rgba(195, 90, 43, 0.18), transparent 55%),
    radial-gradient(circle at 90% 20%, rgba(34, 74, 118, 0.15), transparent 50%),
    linear-gradient(180deg, #fff4ea 0%, #f7efe6 100%);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 32px 20px 40px;
  max-width: 980px;
  margin: 0 auto;
}

.app-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.app-title {
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.app-progress {
  font-size: 1rem;
  font-weight: 600;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 28px 26px 32px;
  box-shadow: var(--shadow);
  animation: rise 360ms ease;
}

.section-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 12px;
}

.screen-title {
  margin: 0 0 16px;
  font-size: 1.8rem;
  line-height: 1.3;
}

.screen-subtitle {
  margin-top: 28px;
  font-size: 1.1rem;
  color: var(--muted);
}

.screen-content {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.6;
  white-space: pre-line;
}

.pdf-disclosure {
  margin: 18px 0 4px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fffaf5;
}

.pdf-summary {
  cursor: pointer;
  padding: 12px 14px;
  color: var(--accent-strong);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-weight: 700;
}

.pdf-frame {
  display: block;
  width: 100%;
  height: min(70vh, 720px);
  border: 0;
  border-top: 1px solid var(--border);
}

.input-root {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 20px;
}

.input-text {
  width: 100%;
  min-height: 44px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 1rem;
  font-family: inherit;
}

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

.option-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Horizontal coloured scale tiles (likert_1_7 and scale_0_10) */

.scale-root {
  margin-top: 4px;
}

.scale-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: stretch;
}

.scale-tile {
  cursor: pointer;
  user-select: none;
}

.scale-tile input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.scale-tile-face {
  width: 64px;
  height: 56px;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 10px 18px rgba(35, 20, 10, 0.06);
  transition: transform 120ms ease, box-shadow 120ms ease, outline-color 120ms ease;
}

.scale-tile:hover .scale-tile-face {
  transform: translateY(-1px);
  box-shadow: 0 14px 22px rgba(35, 20, 10, 0.10);
}

.scale-tile input:checked + .scale-tile-face {
  outline: 3px solid rgba(29, 26, 23, 0.22);
  outline-offset: 2px;
  box-shadow: 0 16px 26px rgba(35, 20, 10, 0.14);
}

.scale-neutral {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.scale-neutral-option {
  cursor: pointer;
  user-select: none;
}

.scale-neutral-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.scale-neutral-face {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f2f2f2;
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-weight: 600;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.scale-neutral-option:hover .scale-neutral-face {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(35, 20, 10, 0.08);
}

.scale-neutral-option input:checked + .scale-neutral-face {
  outline: 3px solid rgba(29, 26, 23, 0.18);
  outline-offset: 2px;
}

/* Make tiles fit better on small screens */
@media (max-width: 640px) {
  .scale-tile-face {
    width: 56px;
    height: 52px;
    border-radius: 14px;
    font-size: 17px;
  }
}

.option-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: #fffaf5;
}

.option-row input[type="radio"],
.option-row input[type="checkbox"] {
  margin-right: 10px;
}

.option-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
}

.option-row > input {
  align-self: flex-start;
}

.option-text {
  display: none;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed var(--border);
  font-family: inherit;
}

.option-text.is-visible {
  display: block;
}

.selection-hint {
  font-size: 0.9rem;
  color: var(--muted);
}

.helper-text {
  font-size: 0.95rem;
  color: var(--muted);
}

.validation {
  min-height: 20px;
  color: var(--accent-strong);
  font-size: 0.9rem;
  margin-top: 8px;
}

.nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.btn {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 10px 20px;
  font-size: 1rem;
  cursor: pointer;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-primary {
  background: var(--accent);
  color: #fffaf5;
  box-shadow: 0 10px 20px rgba(195, 90, 43, 0.2);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}

.summary-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 18px 0 28px;
}

.summary-row {
  background: #fffaf5;
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
}

.summary-question {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.summary-answer {
  font-size: 1rem;
  font-weight: 600;
}

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

@media (max-width: 640px) {
  .app {
    padding: 24px 16px 32px;
  }

  .card {
    padding: 22px 18px 26px;
  }

  .screen-title {
    font-size: 1.5rem;
  }

  .nav {
    flex-direction: column;
  }
}
