:root {
  --bg: #f7f7fb;
  --surface: #ffffff;
  --text: #1f2430;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --danger: #dc2626;
  --success: #16a34a;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

header.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

header.topbar .brand {
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  color: var(--text);
}

header.topbar nav a {
  margin-left: 16px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
}

header.topbar nav a:hover { color: var(--primary); }

main {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

h1 { font-size: 1.6rem; margin: 0 0 6px; }
h2 { font-size: 1.2rem; margin: 0 0 12px; }
p.description { color: var(--text-muted); margin: 0 0 16px; }

.form-group { margin-bottom: 14px; }
label { display: block; margin-bottom: 6px; font-size: 0.9rem; font-weight: 600; }

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
}

button, .btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

button:hover, .btn:hover { background: var(--primary-hover); }
button:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-secondary:hover { background: #eef2ff; }

.auth-box {
  max-width: 380px;
  margin: 48px auto;
}

.error-message {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 0.9rem;
}

.success-message {
  background: #f0fdf4;
  color: var(--success);
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 0.9rem;
}

.muted { color: var(--text-muted); font-size: 0.9rem; }

.question-block {
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
}
.question-block:last-child { border-bottom: none; }

.question-text { font-weight: 600; margin-bottom: 10px; }

.likert-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.likert-options label {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 400;
  font-size: 0.9rem;
  cursor: pointer;
}

.likert-options input:checked + span,
.likert-options label:has(input:checked) {
  border-color: var(--primary);
}

.option-list { display: flex; flex-direction: column; gap: 8px; }
.option-list label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 400;
  cursor: pointer;
}

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 20px;
}
.progress-bar > div {
  height: 100%;
  background: var(--primary);
}

.badge {
  display: inline-block;
  background: #eef2ff;
  color: var(--primary);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

.actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
}

canvas { max-width: 100%; }
