/* ─── reset / base ─────────────────────────────────────────────────────── */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #1a1a1a;
  background: #f7f7f5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0 0 0.5rem; line-height: 1.25; font-weight: 600; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; margin-bottom: 1rem; }
h3 { font-size: 1.1rem; }
p  { margin: 0 0 1rem; }

a { color: #1f6feb; text-decoration: none; }
a:hover { text-decoration: underline; }

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea, select {
  font: inherit;
  font-size: 1rem;
}

code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: #eee;
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

/* ─── layout ───────────────────────────────────────────────────────────── */

.topbar {
  background: #111;
  color: #fff;
  padding: 0.85rem 1.5rem;
  border-bottom: 1px solid #000;
}
.brand {
  font-weight: 600;
  letter-spacing: 0.02em;
  font-size: 1rem;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.25rem 6rem;
}

.footer {
  text-align: center;
  padding: 2rem 1rem;
  color: #888;
  font-size: 0.85rem;
}

.subtitle { color: #555; font-size: 1rem; margin-top: -0.25rem; margin-bottom: 1rem; }
.intro    { color: #444; font-size: 0.95rem; }
.muted    { color: #888; font-size: 0.85rem; }

/* ─── progress ─────────────────────────────────────────────────────────── */

#progress-bar {
  height: 4px;
  background: #e3e3e0;
  border-radius: 2px;
  overflow: hidden;
  margin: 1.5rem 0 0.5rem;
}
#progress-bar-fill {
  height: 100%;
  background: #2a6f4d;
  width: 0%;
  transition: width 0.3s ease;
}
.progress-text {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 1.5rem;
}

/* ─── page content ─────────────────────────────────────────────────────── */

.page {
  background: #fff;
  border: 1px solid #e3e3e0;
  border-radius: 8px;
  padding: 1.5rem 1.5rem 1rem;
  margin-bottom: 1rem;
}
.page-intro {
  background: #f7f3e8;
  border-left: 3px solid #b89c4f;
  padding: 0.75rem 1rem;
  font-size: 0.92rem;
  color: #4a3d1e;
  border-radius: 4px;
  margin: 0 0 1.5rem;
}

.question {
  margin-bottom: 1.5rem;
}
.question.error label {
  color: #b3261e;
}
.question.error input,
.question.error textarea,
.question.error select {
  border-color: #b3261e;
  background: #fff5f5;
}

.question > label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.35rem;
  color: #1a1a1a;
}
.req { color: #b3261e; font-weight: 700; }

.hint {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.5rem;
  white-space: pre-line;
}

/* ─── form controls ────────────────────────────────────────────────────── */

input[type="text"], input[type="email"], input[type="tel"], input[type="time"],
textarea, select {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid #c8c8c0;
  border-radius: 5px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #2a6f4d;
  box-shadow: 0 0 0 3px rgba(42, 111, 77, 0.15);
}

textarea {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%23555' d='M6 8L0 0h12z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.2rem;
}

/* ─── radio / checkbox groups ──────────────────────────────────────────── */

.radio-group, .checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.option {
  display: grid;
  grid-template-columns: 1.25rem 1fr;
  align-items: start;
  gap: 0.5rem 0.65rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid #e3e3e0;
  border-radius: 5px;
  background: #fafaf8;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
}
.option:hover { background: #f0efea; }
.option input[type="radio"],
.option input[type="checkbox"] {
  margin-top: 0.2rem;
  accent-color: #2a6f4d;
}
.option > span { font-size: 0.95rem; }
.option-hint {
  grid-column: 2;
  font-size: 0.82rem;
  color: #666;
  margin-top: 0.15rem;
}

.modules-group .option {
  background: #fff;
}

/* ─── navigation buttons ───────────────────────────────────────────────── */

.nav-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.nav-row button {
  padding: 0.65rem 1.5rem;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: background 0.15s, transform 0.05s;
}
.nav-row button:active { transform: translateY(1px); }
.nav-row button:disabled { opacity: 0.4; cursor: not-allowed; }

#btn-prev {
  background: #fff;
  border: 1px solid #c8c8c0;
  color: #333;
}
#btn-prev:hover:not(:disabled) { background: #f0efea; }

#btn-next, #btn-submit {
  background: #2a6f4d;
  color: #fff;
  margin-left: auto;
}
#btn-next:hover:not(:disabled),
#btn-submit:hover:not(:disabled) { background: #225b3f; }

/* ─── error banner ─────────────────────────────────────────────────────── */

.error-banner {
  background: #fff5f5;
  border: 1px solid #b3261e;
  color: #7a1b14;
  padding: 0.75rem 1rem;
  border-radius: 5px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

.submit-status {
  margin: 1rem 0;
  font-size: 0.9rem;
  color: #555;
  text-align: center;
}

/* ─── success screen ───────────────────────────────────────────────────── */

.success {
  background: #fff;
  border: 1px solid #2a6f4d;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
}
.success h2 { color: #2a6f4d; }
.success ul {
  list-style: none;
  padding: 0;
  display: inline-block;
  text-align: left;
}
.success ul li {
  padding: 0.25rem 0;
  color: #444;
}
.success ul li::before {
  content: "✓ ";
  color: #2a6f4d;
  font-weight: 700;
}

/* ─── mobile ───────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
  .container { padding: 1.25rem 0.85rem 5rem; }
  .page { padding: 1.15rem; }
  h1 { font-size: 1.4rem; }
  h2 { font-size: 1.15rem; }
  .nav-row button { padding: 0.55rem 1rem; font-size: 0.9rem; }
}
