:root {
  --primary:      #1b4332;
  --primary-mid:  #2d6a4f;
  --accent:       #40916c;
  --accent-light: #d8f3dc;
  --bg:           #f0f4f1;
  --white:        #ffffff;
  --text:         #1a202c;
  --muted:        #6b7280;
  --border:       #d1d5db;
  --error:        #dc2626;
  --error-bg:     #fee2e2;
  --success:      #16a34a;
  --radius:       8px;
  --shadow:       0 2px 16px rgba(0,0,0,.09);
}

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

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;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--primary);
  padding: .9rem 1.5rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}

.site-header .logo { font-size: 1.4rem; }
.site-header h1    { font-size: 1.05rem; font-weight: 700; color: white; }

/* ── Layout ─────────────────────────────────────────────────────────────── */
.container {
  max-width: 680px;
  margin: 3rem auto;
  padding: 0 1.25rem;
  flex: 1;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.25rem;
}

.card-title    { font-size: 1.5rem; font-weight: 800; margin-bottom: .4rem; }
.card-subtitle { color: var(--muted); margin-bottom: 1.75rem; line-height: 1.5; }

/* ── Forms ──────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }

label {
  display: block;
  font-weight: 600;
  font-size: .875rem;
  margin-bottom: .35rem;
}

input[type="text"], input[type="password"],
textarea, select {
  width: 100%;
  padding: .65rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  background: white;
  transition: border-color .15s, box-shadow .15s;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(64,145,108,.15);
}

.code-input {
  font-size: 1.75rem;
  text-align: center;
  font-weight: 800;
  letter-spacing: .35em;
  text-transform: uppercase;
  padding: .75rem 1rem;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .65rem 1.5rem;
  border-radius: var(--radius);
  border: none;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, transform .1s;
}
.btn:active { transform: scale(.98); }

.btn-primary  { background: var(--primary-mid); color: white; }
.btn-primary:hover  { background: var(--primary); }

.btn-secondary { background: #e5e7eb; color: var(--text); }
.btn-secondary:hover { background: #d1d5db; }

.btn-full { width: 100%; }

/* ── Alerts ─────────────────────────────────────────────────────────────── */
.alert {
  padding: .7rem 1rem;
  border-radius: var(--radius);
  font-size: .875rem;
  margin-bottom: 1rem;
  border: 1px solid;
}
.alert-error   { background: var(--error-bg);  color: var(--error);   border-color: #fca5a5; }
.alert-success { background: #dcfce7; color: var(--success); border-color: #86efac; }
.alert-info    { background: #dbeafe; color: #1d4ed8; border-color: #93c5fd; }

/* ── Survey Header ──────────────────────────────────────────────────────── */
.survey-header {
  background: var(--primary);
  color: white;
  padding: 1.5rem 2.25rem;
  border-radius: var(--radius) var(--radius) 0 0;
}
.survey-header h2  { font-size: 1.25rem; font-weight: 700; }
.survey-header p   { opacity: .75; font-size: .875rem; margin-top: .3rem; }
.survey-header .game-tag {
  display: inline-block;
  background: rgba(255,255,255,.15);
  padding: .2rem .6rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  margin-bottom: .6rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.survey-body {
  background: white;
  padding: 2rem 2.25rem;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow);
}

/* ── Progress ───────────────────────────────────────────────────────────── */
.progress-wrap {
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.progress-bar  { flex: 1; height: 6px; background: rgba(255,255,255,.25); border-radius: 3px; }
.progress-fill { height: 100%; background: var(--accent-light); border-radius: 3px; transition: width .35s ease; }
.progress-text { font-size: .8rem; opacity: .75; white-space: nowrap; }

/* ── Sections ───────────────────────────────────────────────────────────── */
.survey-section { display: none; }
.survey-section.active { display: block; }

.section-label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent);
  margin-bottom: .4rem;
}

.section-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: .4rem;
}

.section-desc {
  color: var(--muted);
  font-size: .9rem;
  margin-bottom: 1.75rem;
  line-height: 1.5;
}

/* ── Questions ──────────────────────────────────────────────────────────── */
.question-block { margin-bottom: 2rem; }

.question-text {
  font-weight: 600;
  margin-bottom: .75rem;
  line-height: 1.45;
}
.question-text .req { color: var(--error); margin-left: 2px; }

/* Radio / checkbox options */
.choice-group { display: flex; flex-direction: column; gap: .45rem; }

.choice-group label {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 400;
  cursor: pointer;
  padding: .55rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: background .12s, border-color .12s;
  user-select: none;
}
.choice-group label:hover { background: var(--accent-light); border-color: var(--accent); }
.choice-group input[type="radio"]:checked  + span,
.choice-group input[type="checkbox"]:checked + span { color: var(--primary); font-weight: 600; }

/* Rating */
.rating-wrap { display: flex; flex-direction: column; gap: .5rem; }
.rating-group { display: flex; gap: .4rem; flex-wrap: wrap; }

.rating-btn {
  width: 44px; height: 44px;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: white;
  font-weight: 700;
  font-size: .875rem;
  cursor: pointer;
  transition: all .12s;
  display: flex; align-items: center; justify-content: center;
}
.rating-btn:hover  { border-color: var(--accent); background: var(--accent-light); }
.rating-btn.active { background: var(--primary-mid); border-color: var(--primary-mid); color: white; }

.rating-labels {
  display: flex;
  justify-content: space-between;
  max-width: 468px; /* 10 × 44 + 9 × .4rem gap ≈ 468 */
  font-size: .72rem;
  color: var(--muted);
}

textarea { min-height: 110px; resize: vertical; }

/* ── Navigation ─────────────────────────────────────────────────────────── */
.nav-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  gap: .75rem;
}
.nav-buttons .spacer { flex: 1; }

/* ── Thank-you ──────────────────────────────────────────────────────────── */
.thankyou-icon {
  width: 72px; height: 72px;
  background: var(--accent-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.25rem;
  font-size: 2rem;
}

footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  font-size: .8rem;
}
