:root {
  --primary:       #2d6a4f;
  --primary-light: #52b788;
  --primary-pale:  #d8f3dc;
  --accent:        #e9c46a;
  --accent-dark:   #f4a261;
  --bg:            #fef6e4;
  --card:          #ffffff;
  --text:          #2d3436;
  --text-muted:    #636e72;
  --border:        #dfe6e9;
  --danger:        #e17055;
  --shadow:        0 4px 20px rgba(0,0,0,0.08);
  --radius:        16px;
  --radius-sm:     8px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* ── Header ── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--primary);
  color: #fff;
  padding: 12px 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

header.hidden { display: none; }

.header-content {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-title {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  opacity: 0.9;
}

.progress-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.25);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.4s ease;
  width: 0%;
}

.progress-label {
  font-size: 0.8rem;
  opacity: 0.85;
  white-space: nowrap;
}

/* ── Main / Card ── */
main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 32px 16px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 48px;
  width: 100%;
  max-width: 680px;
  animation: fadeIn 0.3s ease;
}

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

/* ── Footer ── */
footer {
  text-align: center;
  padding: 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Welcome Screen ── */
.welcome-icon {
  font-size: 3.5rem;
  text-align: center;
  margin-bottom: 16px;
}

.welcome h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  margin-bottom: 12px;
}

.welcome .subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 28px;
}

.welcome-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}

.badge {
  background: var(--primary-pale);
  color: var(--primary);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.875rem;
  font-weight: 500;
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  background: #fff;
  color: var(--text);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23636e72' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
  transition: border-color 0.2s;
}

.form-group select:focus {
  outline: none;
  border-color: var(--primary);
}

/* ── Section Screen ── */
.section-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--primary-pale);
}

.section-icon {
  font-size: 2.8rem;
  line-height: 1;
  flex-shrink: 0;
}

.section-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.section-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ── Questions ── */
.question {
  margin-bottom: 28px;
}

.question-text {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 12px;
  line-height: 1.5;
}

.star-rating {
  display: flex;
  gap: 6px;
  align-items: center;
}

.star {
  background: none;
  border: none;
  font-size: 2.2rem;
  cursor: pointer;
  color: #dfe6e9;
  transition: color 0.15s, transform 0.1s;
  padding: 0;
  line-height: 1;
  user-select: none;
}

.star:hover,
.star.hovered,
.star.active { color: var(--accent-dark); }

.star:active { transform: scale(0.9); }

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

/* ── Comment textarea ── */
.comment-wrap {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.comment-wrap label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.comment-wrap textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  min-height: 90px;
  transition: border-color 0.2s;
}

.comment-wrap textarea:focus {
  outline: none;
  border-color: var(--primary);
}

/* ── Error message ── */
.error-msg {
  background: #fff5f5;
  color: var(--danger);
  border: 1px solid #fab1a0;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
}

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

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

.btn-primary:hover { background: #1e4d38; box-shadow: 0 4px 12px rgba(45,106,79,0.3); }

.btn-secondary {
  background: var(--border);
  color: var(--text);
}

.btn-secondary:hover { background: #b2bec3; }

.btn-large {
  width: 100%;
  justify-content: center;
  padding: 16px;
  font-size: 1.1rem;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.nav-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  gap: 12px;
}

.nav-buttons .btn:only-child {
  margin-left: auto;
}

/* ── Done Screen ── */
.done {
  text-align: center;
  padding: 16px 0;
}

.done-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.done h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
}

.done p {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 8px;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .card {
    padding: 28px 20px;
  }

  .welcome h1 { font-size: 1.5rem; }
  .section-header h2 { font-size: 1.2rem; }

  .star { font-size: 2rem; }

  .nav-buttons {
    flex-direction: column;
  }

  .nav-buttons .btn {
    width: 100%;
    justify-content: center;
  }
}
