:root {
  --ink: #14171a;
  --ink-soft: #4a5057;
  --line: #dde1e6;
  --line-soft: #eef0f3;
  --accent: #0a66c2;
  --accent-dark: #084d94;
  --bg: #fafbfc;
  --card: #ffffff;
  --danger: #b3261e;
  --radius: 14px;
  --max-w: 640px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Top progress bar ---- */
.progress-wrap {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding: 18px 24px 12px;
  border-bottom: 1px solid var(--line-soft);
}

.progress-meta {
  max-width: var(--max-w);
  margin: 0 auto 10px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  color: var(--ink-soft);
}

.progress-meta strong {
  color: var(--ink);
  font-weight: 600;
}

.progress-track {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 6px;
  background: var(--line-soft);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  border-radius: 999px;
  transition: width 0.35s ease;
}

.step-dots {
  max-width: var(--max-w);
  margin: 10px auto 0;
  display: flex;
  gap: 6px;
}

.step-dot {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--line);
  transition: background 0.25s ease;
}
.step-dot.done { background: var(--accent); }
.step-dot.current { background: var(--accent-dark); }

/* ---- Screen area ---- */
.screen-outer {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 32px 24px 140px;
}

.screen {
  width: 100%;
  max-width: var(--max-w);
  animation: fadeSlide 0.32s ease;
}

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

.screen-header {
  margin-bottom: 28px;
}

.screen-eyebrow {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.screen-title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
}

/* ---- Field blocks ---- */
.field {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 16px;
}

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

.field-helper {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 14px;
}

.field-error {
  font-size: 13px;
  color: var(--danger);
  margin-top: 8px;
  display: none;
}
.field.invalid .field-error { display: block; }
.field.invalid { border-color: var(--danger); }

textarea.text-input,
input.text-input {
  width: 100%;
  font-size: 15px;
  font-family: inherit;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  resize: vertical;
}
textarea.text-input { min-height: 76px; }
.text-input:focus, textarea.text-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10,102,194,0.12);
}

/* Options (single/multi select) */
.option-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  user-select: none;
}
.option-row:hover { border-color: var(--accent); background: #f5f9fd; }
.option-row.selected {
  border-color: var(--accent);
  background: #eaf3fc;
}
.option-row.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.option-row.disabled:hover { border-color: var(--line); background: none; }

.option-marker {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #fff;
}
.option-row.selected .option-marker {
  background: var(--accent);
  border-color: var(--accent);
}
.option-list.single .option-marker { border-radius: 999px; }

.option-text { flex: 1; font-size: 15px; }

.star-btn {
  flex: none;
  font-size: 18px;
  line-height: 1;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--line);
  padding: 4px;
}
.star-btn.active { color: #f5a623; }
.star-btn:disabled { cursor: not-allowed; opacity: 0.3; }

.other-input-row {
  margin-top: 4px;
}

.cap-note {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-top: 10px;
}

/* Goal sentence screen */
.goal-preview {
  background: linear-gradient(135deg, #0a66c2, #084d94);
  color: #fff;
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
  font-size: 17px;
  line-height: 1.55;
}
.goal-preview .placeholder { opacity: 0.6; font-style: italic; }
.goal-preview-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.8;
  margin-bottom: 8px;
}

/* ---- Nav bar ---- */
.nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card);
  border-top: 1px solid var(--line-soft);
  padding: 14px 24px;
  display: flex;
  justify-content: center;
  z-index: 10;
}

.nav-inner {
  width: 100%;
  max-width: var(--max-w);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.btn {
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 9px;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-dark); }
.btn-primary:disabled {
  background: var(--line);
  color: #9aa1a8;
  cursor: not-allowed;
}

.btn-ghost {
  background: none;
  color: var(--ink-soft);
}
.btn-ghost:hover { color: var(--ink); }
.btn-ghost:disabled { visibility: hidden; }

.nav-hint {
  font-size: 12.5px;
  color: var(--ink-soft);
  text-align: right;
}

/* ---- Review screen ---- */
.review-section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 14px;
}
.review-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.review-section-title {
  font-size: 15px;
  font-weight: 700;
}
.edit-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.review-qa { margin-bottom: 8px; }
.review-q {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-bottom: 2px;
}
.review-a {
  font-size: 14.5px;
  color: var(--ink);
  white-space: pre-wrap;
}
.review-a.empty { color: #b8bec4; font-style: italic; }

.download-block {
  text-align: center;
  padding: 24px 0 4px;
}

.brand-footer {
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 22px;
  line-height: 1.6;
}
.brand-footer strong { color: var(--ink); }

@media (max-width: 480px) {
  .screen-title { font-size: 23px; }
  .field { padding: 16px 16px; }
}
