/* =========================================================
   ОСНОВА
   ========================================================= */

.survey-task {
  font-family: Arial, sans-serif;
  max-width: 980px;
  margin: 0 auto;
  padding: 16px;
  color: #0f172a;
  box-sizing: border-box;
}

.survey-task * {
  box-sizing: border-box;
}


/* =========================================================
   ВЕРХНИЙ БЛОК
   ========================================================= */

.survey-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 12px;
}

.survey-group-label {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
}

.survey-progress {
  flex: 0 0 auto;
  background: #f1f5f9;
  color: #475569;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
}


/* =========================================================
   ВОПРОС
   ========================================================= */

.survey-question-code {
  margin: 0 0 6px;
  font-size: 13px;
  color: #475569;
}

.survey-question-text {
  margin: 0 0 14px;
  font-size: 18px;
  line-height: 1.4;
  font-weight: 400;
  color: #0f172a;
}

.survey-question-text strong {
  font-weight: 700;
}


/* =========================================================
   ALERT
   ========================================================= */

.survey-alert {
  display: none;
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
}

.survey-alert.is-error {
  display: block;
  background: #fee2e2;
  color: #991b1b;
}

.survey-alert.is-info {
  display: block;
  background: #e0f2fe;
  color: #0c4a6e;
}


/* =========================================================
   СПРАВОЧНАЯ ИНФОРМАЦИЯ
   ========================================================= */

.survey-reference,
.survey-helper-texts {
  margin-bottom: 10px;
}

.survey-info-card {
  background: #f8fafc;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.survey-info-card-title {
  font-size: 12px;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.survey-info-card-body {
  margin-top: 2px;
}

.survey-info-line {
  font-size: 14px;
  color: #334155;
  line-height: 1.45;
}

.survey-info-line + .survey-info-line {
  margin-top: 4px;
}

.survey-note {
  font-size: 14px;
  color: #334155;
}


/* =========================================================
   ВАРИАНТЫ ОТВЕТОВ
   ========================================================= */

.survey-options {
  display: grid !important;
  gap: 6px !important;
  width: 100%;
}

.survey-option {
  display: flex !important;
  align-items: flex-start !important;
  gap: 8px !important;

  width: 100% !important;

  margin: 0 !important;
  padding: 8px 10px !important;

  border-radius: 8px !important;
  border: 1px solid #e2e8f0 !important;

  background: #ffffff !important;

  cursor: pointer;
  user-select: none;

  transition:
    background 0.12s,
    border-color 0.12s;
}

.survey-option:hover {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}

.survey-option input {
  margin: 2px 0 0 !important;
  cursor: pointer;
  flex: 0 0 auto;
}

.survey-option-text {
  flex: 1 1 auto;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 400;
}


/* =========================================================
   ВЫБРАННЫЙ ВАРИАНТ
   ========================================================= */

.survey-option:has(input:checked) {
  background: #eff6ff !important;
  border-color: #bfdbfe !important;
}


/* =========================================================
   МНОЖЕСТВЕННЫЙ ВЫБОР
   ========================================================= */

.survey-options.survey-options-multi {
  gap: 3px !important;
}

.survey-options.survey-options-multi .survey-option {
  margin: 0 !important;
  padding: 6px 9px !important;
  min-height: 32px !important;
  border-radius: 6px !important;
}

.survey-options.survey-options-multi
.survey-option input[type="checkbox"] {
  width: 15px !important;
  height: 15px !important;
  margin: 2px 0 0 !important;
}

.survey-options.survey-options-multi
.survey-option-text {
  font-size: 14px !important;
  line-height: 1.3 !important;
}


/* =========================================================
   SELECT / TEXT INPUT
   ========================================================= */

.survey-select {
  width: 100%;
  max-width: 480px;
  min-height: 36px;

  padding: 7px 9px;

  border: 1px solid #cbd5e1;
  border-radius: 8px;

  background: #ffffff;

  font-family: Arial, sans-serif;
  font-size: 14px;
  color: #0f172a;
}

textarea.survey-select {
  max-width: 100%;
  min-height: 90px;
  resize: vertical;
}

.survey-select:focus {
  outline: none;
  border-color: #94a3b8;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.08);
}


/* =========================================================
   ШКАЛЫ
   ========================================================= */

.survey-scale-block {
  border: 1px solid #dbeafe;
  background: #f8fafc;
  border-radius: 10px;
  padding: 10px;
}

.survey-scale-title {
  font-size: 13px;
  color: #1e293b;
  margin-bottom: 8px;
}

.survey-scale-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.survey-scale-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  border: 1px solid #cbd5e1;
  border-radius: 8px;

  background: #ffffff;

  padding: 6px 10px;

  font-size: 14px;
  font-weight: 400;

  cursor: pointer;
  user-select: none;

  transition:
    background 0.12s,
    border-color 0.12s;
}

.survey-scale-option:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.survey-scale-option:has(input:checked) {
  background: #eff6ff;
  border-color: #93c5fd;
}

.survey-scale-option input {
  cursor: pointer;
}


/* =========================================================
   МАТРИЦЫ — КОМПАКТНАЯ ВЕРСИЯ
   ========================================================= */

.survey-options:has(.survey-matrix-table) {
  display: block !important;
}

.survey-matrix-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin: 0 0 12px;
}

.survey-matrix-table th,
.survey-matrix-table td {
  border: 1px solid #cbd5e1;

  padding: 6px;

  font-size: 13px;
  line-height: 1.25;

  text-align: center;

  overflow-wrap: break-word;
  word-break: break-word;
}

.survey-matrix-table th {
  background: #f8fafc;
  color: #334155;
  font-weight: 600;
}

.survey-matrix-table th:first-child,
.survey-matrix-table td:first-child {
  text-align: left;
  width: 30%;
}

.survey-matrix-table td:first-child {
  font-weight: 400;
}

.survey-matrix-table td:not(:first-child) {
  padding: 0;
  height: 1px;
}

.survey-matrix-cell {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  height: 100%;

  padding: 6px;
  margin: 0;

  box-sizing: border-box;
  cursor: pointer;
}

.survey-matrix-cell:hover {
  background: #f1f5f9;
}

.survey-matrix-cell:has(input:checked) {
  background: #eff6ff;
}

.survey-matrix-cell input {
  margin: 0;
  cursor: pointer;
}


/* =========================================================
   НАЗВАНИЯ ОТРАСЛЕЙ
   ========================================================= */

.survey-industry-heading {
  margin: 20px 0 8px 0;
  padding: 6px 0;

  font-size: 15px;
  font-weight: 600;

  color: #1e293b;

  border-bottom: 2px solid #e2e8f0;
}

.survey-industry-heading:first-child {
  margin-top: 0;
}


/* =========================================================
   КНОПКИ
   ========================================================= */

.survey-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;

  margin-top: 14px;
  padding-top: 12px;

  gap: 10px;

  border-top: 1px solid #e2e8f0;
}

.survey-button {
  border: 1px solid #cbd5e1;
  background: #ffffff;

  border-radius: 8px;

  padding: 8px 14px;

  font-family: Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;

  cursor: pointer;
}

.survey-button-primary {
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
  font-weight: 600;
}

.survey-button-primary:hover:not(:disabled) {
  border-color: #1d4ed8;
  background: #1d4ed8;
}

.survey-button-secondary:hover:not(:disabled) {
  background: #f1f5f9;
}

.survey-button:disabled {
  opacity: 0.45;
  cursor: default;
}


/* =========================================================
   СЛУЖЕБНОЕ
   ========================================================= */

.survey-hidden-fields,
#survey-input-bridge,
#survey-group-picker {
  display: none !important;
}


/* =========================================================
   МОБИЛЬНЫЙ ВИД
   ========================================================= */

@media (max-width: 700px) {

  .survey-task {
    padding: 12px;
  }

  .survey-topline {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .survey-question-text {
    font-size: 17px;
    line-height: 1.4;
  }

  .survey-options {
    gap: 5px !important;
  }

  .survey-options.survey-options-multi {
    gap: 2px !important;
  }

  .survey-options.survey-options-multi .survey-option {
    padding: 6px 8px !important;
  }

  .survey-matrix-table {
    min-width: 650px;
  }

  .survey-navigation {
    position: sticky;
    bottom: 0;

    margin-left: -12px;
    margin-right: -12px;

    padding: 10px 12px;

    background: #ffffff;
  }

  .survey-button {
    flex: 1;
  }
}


/* =========================================================
   АВТОНОМНАЯ ВЕРСИЯ: страница, старт, финал, прогресс
   ========================================================= */

html,
body {
  margin: 0;
  padding: 0;
  background: #f1f5f9;
}

body {
  min-height: 100vh;
}

.survey-task {
  padding-top: 24px;
  padding-bottom: 24px;
}

.survey-screen {
  display: none;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
}

.survey-panel {
  background: #ffffff;
}

.survey-panel {
  display: none;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 24px;
}

.survey-intro-title {
  margin: 0 0 12px;
  font-size: 22px;
  line-height: 1.3;
  font-weight: 700;
  color: #0f172a;
}

.survey-intro-text p,
.survey-final-text p {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.5;
  color: #334155;
}

.survey-intro .survey-button {
  margin-top: 8px;
  min-width: 180px;
}

.survey-final-title {
  margin: 0 0 12px;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 700;
  color: #0f172a;
}

.survey-final-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.survey-progress-track {
  height: 4px;
  margin: -4px 0 14px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.survey-progress-bar {
  width: 0;
  height: 100%;
  background: #2563eb;
  transition: width 0.2s;
}

.survey-group-label:empty {
  display: none;
}

.survey-matrix-scroll,
.survey-options {
  overflow-x: auto;
}

@media (max-width: 700px) {
  .survey-task {
    padding: 0;
  }

  .survey-screen,
  .survey-panel {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .survey-panel {
    padding: 18px 14px;
  }

  .survey-screen {
    padding: 14px;
  }

  .survey-navigation {
    margin-left: -14px;
    margin-right: -14px;
    padding: 10px 14px;
  }

  .survey-final-actions .survey-button,
  .survey-intro .survey-button {
    width: 100%;
  }
}


/* =========================================================
   ФИНАЛЬНЫЙ OVERRIDE ТЕКСТА ВОПРОСА

   ВАЖНО:
   этот блок должен оставаться самым последним в CSS.

   Он перебивает возможный font-weight Яндекса.
   ========================================================= */

#survey-task-root #survey-question-text,
#survey-task-root .survey-question-text {
  margin: 0 0 14px !important;

  font-family: Arial, sans-serif !important;
  font-size: 18px !important;
  line-height: 1.4 !important;

  font-weight: 400 !important;
  font-style: normal !important;

  color: #0f172a !important;
}


/*
  Обычные span внутри текста вопроса
  всегда НЕ жирные.
*/
#survey-task-root #survey-question-text span,
#survey-task-root .survey-question-text span {
  font-weight: 400 !important;
  font-style: normal !important;
}


/*
  Только специально размеченные в исходном тексте
  фрагменты **...** остаются жирными.
*/
#survey-task-root #survey-question-text strong,
#survey-task-root .survey-question-text strong {
  font-weight: 700 !important;
}