:root {
  --primary: #702082;
  --primary-dark: #631d70;
  --primary-darker: #340f3b;
  --accent: #f38b00;
  --text: #333333;
  --muted: #757575;
  --border: #dddddd;
  --bg: #f5f4f6;
  --surface: #ffffff;
  --error: #cf2a0e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Open Sans', -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  padding-bottom: 3rem;
}

.topbar {
  height: 10px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.page {
  max-width: 700px;
  margin: 0 auto;
  padding: 24px 16px 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 16px;
  transition: box-shadow 0.15s ease;
}

.card--header {
  border-top: 10px solid var(--primary);
  padding-top: 28px;
}

.card--header h1 {
  margin: 0 0 12px;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary-darker);
}

.intro {
  margin: 0 0 16px;
  line-height: 1.55;
  color: var(--text);
}

.required-note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.req {
  color: var(--error);
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.field {
  margin-bottom: 20px;
}

.field:last-child {
  margin-bottom: 0;
}

input[type="text"],
select,
textarea {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
}

input[type="text"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(112, 32, 130, 0.15);
}

.other-input {
  margin-top: 10px;
}

textarea {
  resize: vertical;
  font-family: inherit;
}

.error-text {
  display: none;
  color: var(--error);
  font-size: 0.8rem;
  margin: 6px 0 0;
}

.card.has-error {
  border-color: var(--error);
}

.card.has-error .error-text {
  display: block;
}

.card--section-title {
  background: transparent;
  border: none;
  padding: 16px 4px 8px;
  margin-bottom: 4px;
}

.card--section-title h2 {
  margin: 0 0 6px;
  font-size: 1.1rem;
  color: var(--primary-darker);
}

.scale-key {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
}

.scale-key strong {
  color: var(--primary);
}

fieldset {
  border: none;
  margin: 0;
  padding: 0;
}

legend {
  font-weight: 600;
  padding: 0;
  margin-bottom: 16px;
  line-height: 1.4;
}

.scale-row {
  display: flex;
  justify-content: space-between;
  max-width: 320px;
  margin: 0 auto;
}

.scale-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  cursor: pointer;
}

.scale-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.scale-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.15s ease;
}

.scale-option input[type="radio"]:checked + .scale-circle {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.scale-option input[type="radio"]:focus-visible + .scale-circle {
  box-shadow: 0 0 0 3px rgba(112, 32, 130, 0.25);
}

.scale-option:nth-child(4) input[type="radio"]:checked + .scale-circle {
  background: var(--accent);
  border-color: var(--accent);
}

.scale-labels {
  display: flex;
  justify-content: space-between;
  max-width: 320px;
  margin: 10px auto 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.card--submit {
  display: flex;
  align-items: center;
  gap: 16px;
  background: transparent;
  border: none;
  padding: 8px 4px;
}

button#submit-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 12px 32px;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

button#submit-btn:hover:not(:disabled) {
  background: var(--primary-dark);
}

button#submit-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.submit-status {
  font-size: 0.85rem;
  color: var(--muted);
}

.card--done {
  text-align: center;
  border-top: 10px solid var(--primary);
  padding-top: 32px;
  padding-bottom: 32px;
}

.check {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.card--done h2 {
  margin: 0 0 8px;
  color: var(--primary-darker);
}

.card--done p {
  margin: 0 0 20px;
  color: var(--muted);
}

#another-btn {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  padding: 10px 24px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
}

#another-btn:hover {
  background: rgba(112, 32, 130, 0.06);
}

.footer-note {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 24px;
}

@media (max-width: 480px) {
  .card { padding: 18px; }
  .scale-circle { width: 34px; height: 34px; font-size: 0.9rem; }
  .scale-row, .scale-labels { max-width: 100%; }
}
