/* INAKO Diagnostic — supplemental styles.
   The module deliberately reuses the site's existing classes:
   calc-card, calc-title, calcForm_block, input-title, input-group-custom,
   calc-submit, form-title, form_description, form-inputs-wrapper,
   action-btn and form-instruction_btn. */

:root {
  --diagnostic-blue: #2F6FED;
  --diagnostic-text: #0F172A;
  --diagnostic-muted: #64748B;
  --diagnostic-border: #E2E8F0;
  --diagnostic-soft-blue: #CBD5F5;
  --diagnostic-error: #DC2626;
  --diagnostic-success: #16A34A;
  --diagnostic-bg: #F8FAFC;
}

.diagnostic-mounted {
  transition: opacity 200ms ease, transform 200ms ease;
}

.diagnostic-mounted.diagnostic-leave,
.diagnostic-mounted.diagnostic-enter {
  opacity: 0;
  transform: translateX(8px);
}

.diagnostic {
  position: relative;
}

.diagnostic--inline .diagnostic-stage {
  min-height: 520px;
  display: flex;
  flex-direction: column;
}

.diagnostic--popup .diagnostic-stage {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.diagnostic-progress {
  margin-bottom: 18px;
}

.diagnostic-progress-segments {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 8px;
}

.diagnostic-progress-segment {
  height: 4px;
  border-radius: 999px;
  background: var(--diagnostic-border);
  transition: background-color 160ms ease;
}

.diagnostic-progress-segment.is-active {
  background: var(--diagnostic-blue);
}

.diagnostic-progress-text {
  color: var(--diagnostic-muted);
  font-size: 13px;
  line-height: 1.3;
}

.diagnostic-question {
  margin-bottom: 10px;
}

.diagnostic-description {
  color: var(--diagnostic-muted);
  margin: 0 0 22px;
  font-size: 14px;
  line-height: 1.45;
}

.diagnostic--popup .diagnostic-description span {
  color: inherit;
}

.diagnostic-fields,
.diagnostic--popup .form-inputs-wrapper {
  flex: 1 1 auto;
}

.diagnostic-choices {
  display: grid;
  gap: 10px;
}

.diagnostic-choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 13px 15px;
  border: 1px solid var(--diagnostic-border);
  border-radius: 12px;
  background: #fff;
  color: var(--diagnostic-text);
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
  user-select: none;
}

.diagnostic-choice:hover {
  border-color: var(--diagnostic-soft-blue);
}

.diagnostic-choice:focus-within {
  border-color: var(--diagnostic-blue);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.10);
}

.diagnostic-choice.is-selected {
  border-color: var(--diagnostic-blue);
  background: rgba(47, 111, 237, 0.055);
}

.diagnostic-native-control {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.diagnostic-choice-control {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border: 1.5px solid #BBC1D7;
  border-radius: 6px;
  background: #fff;
  display: grid;
  place-items: center;
}

.diagnostic--inline [type="radio"] + .diagnostic-choice-control,
.diagnostic--popup [type="radio"] + .diagnostic-choice-control {
  border-radius: 50%;
}

.diagnostic-native-control:checked + .diagnostic-choice-control {
  border-color: var(--diagnostic-blue);
  background: var(--diagnostic-blue);
}

.diagnostic-native-control:checked + .diagnostic-choice-control::after {
  content: '';
  width: 7px;
  height: 4px;
  border-left: 1.8px solid #fff;
  border-bottom: 1.8px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
}

.diagnostic-native-control[type="radio"]:checked + .diagnostic-choice-control::after {
  width: 7px;
  height: 7px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  transform: none;
}

.diagnostic-choice-label {
  font-size: 15px;
  line-height: 1.35;
}

.diagnostic-field-block {
  margin-bottom: 16px;
}

.diagnostic-input-group {
  position: relative;
}

.diagnostic-input-group > svg {
  flex: 0 0 25px;
  width: 25px;
  height: 25px;
}

.diagnostic-input-group input {
  min-width: 0;
  font-size: 16px; /* prevents iOS zoom */
}

.diagnostic-input-group.has-error {
  border-color: var(--diagnostic-error) !important;
}

.diagnostic-error {
  min-height: 18px;
  margin-top: 6px;
  color: var(--diagnostic-error);
  font-size: 12px;
  line-height: 1.35;
}

.diagnostic-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin-top: 22px;
}

.diagnostic-actions > .diagnostic-primary {
  width: 100%;
  margin: 0;
}

.diagnostic-primary {
  justify-content: flex-start;
}

.diagnostic-primary:disabled {
  opacity: 0.65;
  cursor: wait;
}

.diagnostic-button-icon {
  flex: 0 0 30px;
}

.diagnostic-back {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 10px 0;
  color: var(--diagnostic-muted);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.diagnostic-back:hover,
.diagnostic-back:focus-visible {
  color: var(--diagnostic-blue);
}

.diagnostic-submit-status {
  min-height: 20px;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.4;
}

.diagnostic-submit-status.is-error {
  color: var(--diagnostic-error);
}

.diagnostic-success {
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.diagnostic-success-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 14px;
  background: rgba(22, 163, 74, 0.1);
  color: var(--diagnostic-success);
  font-size: 25px;
  font-weight: 700;
}

.diagnostic-success p {
  max-width: 520px;
  color: var(--diagnostic-muted);
  line-height: 1.55;
}

.diagnostic-success p + p {
  margin-top: 10px;
}

.diagnostic-success strong {
  color: var(--diagnostic-text);
}

.diagnostic-close-btn {
  z-index: 5;
}

.diagnostic-honeypot {
  position: absolute !important;
  left: -10000px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

/* =========================================================
   DIAGNOSTIC POPUP
   Поля шагов 3–4 оформляем как поля калькулятора Hero
   ========================================================= */

.diagnostic--popup .calcForm_block {
  width: 100%;
}

.diagnostic--popup .input-title {
  display: block;
  margin-bottom: 10px;
}

/* Контейнер поля — аналог input-group-custom калькулятора */
.diagnostic--popup .input-group-custom {
  width: 100%;
  min-height: 58px;

  display: flex;
  align-items: center;
  gap: 12px;

  padding: 0 18px;

  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 12px;

  box-sizing: border-box;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}


/* Иконка внутри поля */
.diagnostic--popup .input-group-custom > svg {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
}


/* Сам input */
.diagnostic--popup .input-group-custom input {
  width: 100%;
  min-width: 0;

  padding: 16px 0;

  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: transparent !important;

  font: inherit;
  font-size: 16px;
  line-height: 1.4;

  color: #0F172A;

  box-sizing: border-box;
}


/* Placeholder */
.diagnostic--popup .input-group-custom input::placeholder {
  color: #BBC1D7;
  opacity: 1;
}


/* Активное поле */
.diagnostic--popup .input-group-custom:focus-within {
  border-color: #2F6FED;
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.10);
}


/* Ошибка */
.diagnostic--popup .input-group-custom.has-error {
  border-color: #DC2626 !important;
}


/* Сообщение об ошибке */
.diagnostic--popup .diagnostic-error {
  margin-top: 6px;
  min-height: 18px;

  color: #DC2626;

  font-size: 12px;
  line-height: 1.35;
}


/* Расстояние между полями */
.diagnostic--popup .diagnostic-field-block {
  margin-bottom: 16px;
}
/* Иконка кнопки Продолжить */
.diagnostic--inline .diagnostic-button-icon g {
    opacity: 1 !important;
}

.diagnostic--inline .diagnostic-button-icon path {
    stroke: #000 !important;
}
@media (min-width: 768px) {
  .diagnostic--popup .diagnostic-choices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .diagnostic--popup .diagnostic-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    display: inline-flex !important;
  }
}

@media (max-width: 767.98px) {
  .diagnostic--inline .diagnostic-stage {
    min-height: 0;
  }

  .diagnostic-progress {
    margin-bottom: 14px;
  }

  .diagnostic-choice {
    min-height: 50px;
    padding: 12px 13px;
  }

  .diagnostic-actions {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .diagnostic-actions > span:empty {
    display: none;
  }

  .diagnostic-back {
    grid-row: 2;
    justify-self: start;
  }

  .diagnostic-primary {
    grid-row: 1;
  }

  .diagnostic-success {
    min-height: 340px;
  }

  /* Bootstrap modal becomes close to full-screen on mobile. */
  .right-panel-modal .modal-dialog {
    margin: 0;
    min-height: 100%;
  }

  .right-panel-modal .modal-content {
    min-height: 100vh;
    border-radius: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .diagnostic-mounted,
  .diagnostic-choice,
  .diagnostic-progress-segment {
    transition: none !important;
  }
}
/* =========================================
   Ошибки заполнения диагностики
   ========================================= */

/* Красная рамка вокруг неверно заполненного поля */
.diagnostic .diagnostic-input-group.has-error {
    border: 1px solid #DC2626 !important;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.08) !important;
}

/* Текст ошибки под полем */
.diagnostic .diagnostic-error {
    display: block !important;
    visibility: visible !important;

    min-height: 18px;
    margin-top: 6px;

    color: #DC2626 !important;
    font-size: 13px;
    line-height: 1.35;
}

/* Если ошибки нет — пустое место не показываем */
.diagnostic .diagnostic-error:empty {
    display: none !important;
}

/* При фокусе на ошибочном поле рамка остается красной */
.diagnostic .diagnostic-input-group.has-error:focus-within {
    border-color: #DC2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12) !important;
}
.diagnostic .diagnostic-input-group {
    border-style: solid;
}

.diagnostic .diagnostic-input-group.has-error svg path,
.diagnostic .diagnostic-input-group.has-error svg circle {
    stroke: #DC2626 !important;
}