body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f5f5f7;
    margin: 0;
    padding: 0;
}

#app {
    max-width: 800px;
    margin: 40px auto;
    background: #ffffff;
    border-radius: 12px;
    padding: 24px 32px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

h1 {
    margin-top: 0;
}

label {
    display: block;
    margin-bottom: 12px;
}

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    margin-top: 4px;
    border-radius: 6px;
    border: 1px solid #d0d0d5;
}

button {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    background: #2563eb;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
}

button.secondary {
    background: #e5e7eb;
    color: #111827;
}

button:disabled {
    opacity: 0.5;
    cursor: default;
}

.screen {
    display: block;
}

.hidden {
    display: none;
}

.error {
    margin-top: 8px;
    color: #b91c1c;
}

.test-header {
    margin-bottom: 16px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 4px;
}

.progress-inner {
    height: 100%;
    width: 0;
    background: #2563eb;
    transition: width 0.2s ease-out;
}

.scale-bounds {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-top: 4px;
    color: #666;
}

/* Карточка вопроса */
#question-card h2,
#question-text {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

/* Инструкция / description шкалы */
.question-instruction {
    font-size: 14px;
    color: #555;
    margin-bottom: 10px;
    line-height: 1.4;
}

/* Контейнер ответа */
#answer-container {
    margin-top: 10px;
}

/* Шкала (range) */
.scale-row {
    margin-top: 4px;
}

.scale-row input[type="range"] {
    width: 100%;
}

/* Подписи слева/справа от шкалы */
.scale-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

/* Текущая выбранная цифра */
#scale-value-label {
    margin-top: 6px;
    font-size: 14px;
}

/* Варианты ответов – чтобы не липли друг к другу */
.option-item {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
}

#question-text:empty { display: none; }
#test-progress-text {
    font-size: 13px;
    color: #6b7280;
}

/* ===== Группа вопросов: карточки ===== */
.group-question-item {
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 12px;
    padding: 14px 14px 12px;
    margin-bottom: 12px;
}

.group-question-text {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    line-height: 1.35;
    margin-bottom: 10px;
}

.group-question-control {
    margin-top: 6px;
}

/* ===== SCALE ===== */
.group-question-control input[type="range"] {
    width: 100%;
    margin: 6px 0 10px;
    accent-color: #2563eb;
}

.scale-value-label {
    margin-top: 8px;
    font-size: 12px;
    color: #2563eb;
    background: #eef2ff;
    border: 1px solid #dbeafe;
    padding: 6px 10px;
    border-radius: 999px;
    display: inline-block;
}

/* ===== Инструкция ===== */
#question-extra.question-instruction {
    font-size: 14px;
    color: #6b7280;
    margin: 8px 0 14px;
    line-height: 1.4;
}

/* ===== Кнопки: порядок и акценты ===== */
.buttons {
    margin-top: 16px;
    display: flex;
    gap: 10px;
    align-items: center;
}

#btn-test-exit {
    margin-left: auto; /* "Выход" уезжает вправо */
}

/* button {
    height: 40px;
    padding: 0 14px;
    border-radius: 10px;
    font-weight: 600;
} */

button.secondary {
    border: 1px solid #e5e7eb;
}

textarea.three-words-comma {
    resize: none;
    min-height: 44px;
}

.other-input {
    width: 100%;
    margin: 8px 0 0 22px; /* лёгкий отступ под чекбокс */
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #d0d0d5;
    box-sizing: border-box;
}

.consent-text{
  line-height: 1.5;
  font-size: 15px;
  padding: 5px;
}

.consent-text ul{
  margin: 8px 0 0 18px;
  padding: 0;
}

.consent-text li{
  margin: 6px 0;
}

.consent-text a{
  text-decoration: underline;
}

.consent-text code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  padding: 2px 6px;
  border-radius: 6px;
  background: #f3f4f6;
}

/* ===== Multiselect dropdown ===== */
.ms { position: relative; width: 100%; }
.ms-btn{
  width: 100%;
  height: 38px;
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
}

.ms-btn:focus{
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}

.ms-count{
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
}

.ms-panel{
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.10);
  padding: 8px;
  max-height: 260px;
  overflow: auto;
  display: none;
  z-index: 20;
}

.ms.open .ms-panel{ display: block; }

.ms-item{
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
}

.ms-item:hover{ background: #f8fafc; }
.ms-item input{ margin: 0; }

/* ===== Chaos block spacing ===== */
.chaos-block{ margin-top: 12px; display: grid; gap: 10px; }
.chaos-block .hint{ margin-top: -4px; }

.register-login-display {
    font-size: 16px;
    text-align: center;
    margin: 20px 0;
    padding: 12px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}