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

:root {
  --bg: #f0f7f2;
  --primary: #6aab8a;
  --accent: #4d8f6a;
  --card: #ffffff;
  --text: #2a332e;
  --muted: #6b7d72;
  --border: #dce8e0;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(45, 42, 38, 0.06);
}

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.loading,
.error-state {
  text-align: center;
  color: var(--muted);
  padding: 3rem 1rem;
}

.error-state {
  color: var(--primary);
}

/* Header */
.header {
  margin-bottom: 1.75rem;
}

.header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.header p {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Progress */
.progress-wrap {
  margin-bottom: 1.5rem;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.25s ease;
}

/* Form card */
.form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.question-block {
  display: none;
}

.question-block.active {
  display: block;
}

.question-label {
  font-size: 1.05rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
  line-height: 1.4;
}

.optional-tag {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--muted);
  display: block;
  margin-top: 0.25rem;
}

/* Slider */
.slider-wrap {
  padding: 0.5rem 0;
}

.slider-input {
  width: 100%;
  height: 6px;
  appearance: none;
  background: var(--border);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.slider-input::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--card);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.slider-input::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--card);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.slider-labels span:last-child {
  text-align: right;
}

/* Choice / Multi-choice */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.option-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.option-item:hover {
  border-color: var(--primary);
  background: rgba(106, 171, 138, 0.04);
}

.option-item.selected {
  border-color: var(--primary);
  background: rgba(106, 171, 138, 0.08);
}

.option-item input {
  margin-top: 0.15rem;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.option-content {
  flex: 1;
}

.option-label {
  font-size: 0.95rem;
}

.option-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

/* Text */
.text-input {
  width: 100%;
  min-height: 120px;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--card);
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
}

.text-input:focus {
  border-color: var(--primary);
}

.text-input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

/* Rating */
.rating-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.rating-stars {
  display: flex;
  gap: 0.35rem;
}

.rating-star {
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--border);
  cursor: pointer;
  padding: 0.15rem;
  line-height: 1;
  transition: color 0.15s, transform 0.1s;
}

.rating-star:hover,
.rating-star.active {
  color: var(--primary);
}

.rating-star:hover {
  transform: scale(1.1);
}

.rating-labels {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 220px;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Navigation */
.nav-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn {
  flex: 1;
  padding: 0.85rem 1.25rem;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.9;
}

.btn-secondary {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--text);
}

.field-error {
  color: var(--primary);
  font-size: 0.85rem;
  margin-top: 0.75rem;
}

/* Thank you */
.thank-you {
  text-align: center;
  padding: 2rem 1rem;
}

.thank-you h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.thank-you p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

@media (max-width: 400px) {
  #app {
    padding: 1.5rem 1rem 2.5rem;
  }

  .form-card {
    padding: 1.25rem;
  }
}
