.nm-quiz {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: none;
  box-sizing: border-box;
  color: #22171b;
  font-family: Manrope, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  user-select: none;
}

.nm-quiz[aria-hidden="false"] {
  display: block;
}

.nm-quiz *,
.nm-quiz *::before,
.nm-quiz *::after {
  box-sizing: border-box;
}

.nm-quiz [hidden],
.nm-quiz .hp {
  display: none !important;
}

.nm-quiz input,
.nm-quiz button {
  font: inherit;
}

.nm-quiz input {
  user-select: text;
}

.nm-quiz__overlay {
  position: absolute;
  inset: 0;
  background: rgba(11, 7, 10, 0.82);
  backdrop-filter: blur(12px);
}

.nm-quiz__dialog {
  position: absolute;
  top: 53%;
  left: 50%;
  z-index: 1;
  display: grid;
  width: min(1040px, calc(100vw - 96px));
  height: min(720px, calc(100svh - 80px));
  min-height: min(680px, calc(100svh - 80px));
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: #fbf7f4;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.34);
  transform: translate(-50%, -50%);
}

.nm-quiz__close {
  position: absolute;
  z-index: 3;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(225, 212, 205, 0.9);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(33, 18, 24, 0.12);
  cursor: pointer;
}

.nm-quiz__close::before,
.nm-quiz__close::after {
  position: absolute;
  top: 19px;
  left: 10px;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: #211218;
  content: "";
}

.nm-quiz__close::before {
  transform: rotate(45deg);
}

.nm-quiz__close::after {
  transform: rotate(-45deg);
}

.nm-quiz__questions,
.nm-quiz__contacts {
  height: 100%;
  min-height: 0;
}

.nm-quiz__topline {
  min-height: 66px;
  padding: 23px 40px 19px;
  border-bottom: 1px solid #e3d7d0;
  color: #77696b;
  font-size: 13px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.nm-quiz__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  min-height: calc(100% - 66px);
}

.nm-quiz__main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 42px 40px 34px;
}

.nm-quiz__steps {
  min-height: 0;
  flex: 1;
}

.nm-quiz__step {
  display: none;
  opacity: 0;
  transform: translateY(8px);
}

.nm-quiz__step.is-active {
  display: block;
  animation: nmQuizStepIn 220ms ease both;
}

@keyframes nmQuizStepIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.nm-quiz__title,
.nm-quiz__contact-left h2 {
  margin: 0;
  color: #211218;
  font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.08;
}

.nm-quiz__options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 32px;
}

.nm-quiz__options--compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.nm-quiz__option {
  position: relative;
  display: flex;
  min-height: 68px;
  align-items: center;
  overflow: hidden;
  border: 1px solid #dfd2cc;
  border-radius: 8px;
  background: #ffffff;
  color: #2d2226;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  padding: 14px 18px 14px 54px;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background 160ms ease;
}

.nm-quiz__options--compact .nm-quiz__option {
  min-height: 54px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.nm-quiz__option:hover,
.nm-quiz__option:focus-within {
  border-color: rgba(166, 25, 66, 0.42);
  box-shadow: 0 14px 32px rgba(36, 22, 27, 0.08);
  transform: translateY(-1px);
}

.nm-quiz__option input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.nm-quiz__option::before {
  position: absolute;
  top: 50%;
  left: 20px;
  width: 20px;
  height: 20px;
  border: 1px solid #d2c1b8;
  border-radius: 50%;
  background: #f7f0ec;
  content: "";
  transform: translateY(-50%);
}

.nm-quiz__option.is-selected {
  border-color: #a61942;
  background: #fff9f7;
  box-shadow: 0 16px 34px rgba(166, 25, 66, 0.12);
}

.nm-quiz__option.is-selected::before {
  border-color: #a61942;
  background: #ffffff;
  box-shadow: inset 0 0 0 5px #a61942;
}

.nm-quiz__guard {
  min-height: 24px;
  margin: 18px 0 0;
  color: #8f2135;
  font-size: 14px;
  font-weight: 800;
}

.nm-quiz__footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 26px;
  margin-top: 34px;
}

.nm-quiz__progress {
  flex: 1;
  min-width: 0;
  color: #756668;
  font-size: 13px;
  font-weight: 750;
}

.nm-quiz__progress b {
  display: inline-block;
  margin-left: 10px;
  color: #a61942;
}

.nm-quiz__progress i {
  display: block;
  height: 6px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e3d8d2;
}

.nm-quiz__progress em {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #a61942;
  box-shadow: 0 4px 14px rgba(166, 25, 66, 0.28);
  transition: width 180ms ease;
}

.nm-quiz__nav {
  display: grid;
  grid-template-columns: 46px auto;
  grid-template-rows: 48px 16px;
  align-items: center;
  column-gap: 12px;
}

.nm-quiz__nav small {
  grid-column: 2;
  color: #9a8c8e;
  font-size: 10px;
  text-align: center;
}

.nm-quiz__back,
.nm-quiz__next,
.nm-quiz__messengers button,
.nm-quiz__choose,
.nm-quiz__done {
  cursor: pointer;
}

.nm-quiz__back {
  width: 46px;
  height: 46px;
  border: 1px solid #dfd2cc;
  border-radius: 8px;
  background: #ffffff;
}

.nm-quiz__back::before {
  color: #8d7e81;
  content: "<";
  font-size: 18px;
  font-weight: 850;
}

.nm-quiz__back:disabled {
  cursor: default;
  opacity: 0.46;
}

.nm-quiz__next {
  min-width: 132px;
  height: 46px;
  border: 0;
  border-radius: 8px;
  background: #251018;
  color: #ffffff;
  font-size: 15px;
  font-weight: 850;
  padding: 0 20px;
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.nm-quiz__next.is-ready,
.nm-quiz__next:hover,
.nm-quiz__next:focus-visible {
  background: #a61942;
  box-shadow: 0 14px 28px rgba(166, 25, 66, 0.26);
  transform: translateY(-1px);
}

.nm-quiz__side {
  display: flex;
  min-width: 0;
  padding: 24px;
  background: #1a1116;
  color: #ffffff;
}

.nm-quiz__side-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  min-height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 26px;
  background: #21141a;
}

.nm-quiz__side-kicker {
  color: #d5b36d;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.nm-quiz__side-card strong {
  display: block;
  margin-top: 18px;
  color: #ffffff;
  font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  font-size: 30px;
  line-height: 1.12;
}

.nm-quiz__side-card p {
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
}

.nm-quiz__bubble {
  margin-top: 28px !important;
  border-left: 3px solid #d5b36d;
  padding: 14px 0 14px 16px;
  color: rgba(255, 255, 255, 0.9) !important;
}

.nm-quiz__contacts {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(430px, 1fr);
  height: 100%;
}

.nm-quiz__contact-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid #e3d7d0;
  padding: 62px 50px;
}

.nm-quiz__contact-left p {
  max-width: 480px;
  margin: 22px 0 0;
  color: #6f6265;
  font-size: 18px;
}

.nm-quiz__contact-right {
  display: flex;
  min-width: 0;
  align-items: center;
  padding: 54px 56px;
}

.nm-quiz__messengers,
.nm-quiz__lead,
.nm-quiz__done-state {
  width: 100%;
}

.nm-quiz__messengers {
  max-width: 520px;
}

.nm-quiz__messengers h3 {
  margin: 0 0 20px;
  color: #211218;
  font-size: 22px;
  line-height: 1.25;
}

.nm-quiz__messengers button {
  display: flex;
  width: 100%;
  min-height: 72px;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  border: 1px solid #dfd2cc;
  border-radius: 10px;
  background: #ffffff;
  color: #211218;
  font-size: 16px;
  font-weight: 850;
  padding: 14px 18px;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.nm-quiz__messengers button:hover,
.nm-quiz__messengers button:focus-visible {
  border-color: rgba(166, 25, 66, 0.42);
  box-shadow: 0 16px 32px rgba(166, 25, 66, 0.12);
  transform: translateY(-1px);
}

.nm-quiz__messenger-icon,
.nm-quiz__messenger-icon img {
  width: 30px;
  height: 30px;
}

.nm-quiz__messenger-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
}

.nm-quiz__messengers label,
.nm-quiz__agree {
  display: block;
  margin-top: 16px;
  color: #6f6265;
  font-size: 12px;
  line-height: 1.35;
}

.nm-quiz__messengers input[type="checkbox"],
.nm-quiz__agree input {
  width: 15px;
  height: 15px;
  margin: 0 7px 0 0;
  vertical-align: -3px;
  accent-color: #a61942;
}

.nm-quiz__choose {
  border: 0;
  background: transparent;
  color: #a61942;
  font-size: 14px;
  font-weight: 800;
  padding: 0;
}

.nm-quiz__lead-card {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  border: 1px solid #dfd2cc;
  border-radius: 10px;
  background: #ffffff;
  padding: 22px;
}

.nm-quiz__lead-card p {
  margin: 0;
  color: #756668;
  font-size: 13px;
  font-weight: 750;
}

.nm-quiz__lead-card strong {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #211218;
  font-size: 18px;
}

.nm-quiz__lead-card label:not(.nm-quiz__agree) {
  color: #3b2c31;
  font-size: 14px;
  font-weight: 800;
}

.nm-quiz__lead-card input[type="text"] {
  width: 100%;
  min-height: 52px;
  border: 1px solid #cfc0b8;
  border-radius: 8px;
  outline: 0;
  padding: 12px 14px;
}

.nm-quiz__lead-card input[type="text"]:focus {
  border-color: #a61942;
  box-shadow: 0 0 0 3px rgba(166, 25, 66, 0.12);
}

.nm-quiz__done {
  width: 100%;
  min-height: 52px;
  margin-top: 14px;
  border: 0;
  border-radius: 8px;
  background: #a61942;
  color: #ffffff;
  font-weight: 850;
}

.nm-quiz__done:disabled {
  cursor: wait;
  opacity: 0.72;
}

.nm-quiz__submit-status {
  min-height: 22px;
  margin: 10px 0 0;
  color: #211218;
  font-size: 13px;
  font-weight: 800;
}

.nm-quiz__submit-status.is-error {
  color: #8f2135;
}

.nm-quiz__done-state {
  border: 1px solid #dfd2cc;
  border-radius: 8px;
  background: #ffffff;
  color: #211218;
  padding: 22px;
}

.nm-quiz__done-state strong {
  display: block;
  font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  font-size: 28px;
  line-height: 1.1;
}

.nm-quiz__done-state p {
  margin: 14px 0 0;
  color: #6f6265;
}

@media (max-width: 900px) {
  .nm-quiz__dialog {
    top: 54%;
    left: 50%;
    width: calc(100vw - 8px);
    height: min(760px, calc(100svh - 70px));
    max-height: none;
    margin: 0;
    transform: translate(-50%, -50%);
  }

  .nm-quiz__close {
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border-color: #e1d4cd;
    background: #ffffff;
  }

  .nm-quiz__close::before,
  .nm-quiz__close::after {
    top: 16px;
    left: 8px;
    width: 17px;
    background: #211218;
  }

  .nm-quiz__topline {
    min-height: 64px;
    padding: 16px 54px 14px 16px;
  }

  .nm-quiz__body,
  .nm-quiz__contacts {
    display: block;
    min-height: 0;
  }

  .nm-quiz__contacts {
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .nm-quiz__main {
    height: calc(100% - 64px);
    padding: 22px 16px 92px;
    position: relative;
  }

  .nm-quiz__title,
  .nm-quiz__contact-left h2 {
    font-size: 29px;
  }

  .nm-quiz__options {
    grid-template-columns: 1fr;
    gap: 11px;
    margin-top: 20px;
  }

  .nm-quiz__options--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .nm-quiz__option {
    min-height: 52px;
    font-size: 15px;
  }

  .nm-quiz__options--compact .nm-quiz__option {
    min-height: 46px;
    padding: 10px 10px 10px 42px;
    font-size: 13px;
  }

  .nm-quiz__options--compact .nm-quiz__option::before {
    left: 14px;
    width: 16px;
    height: 16px;
  }

  .nm-quiz__options--compact .nm-quiz__option.is-selected::after {
    left: 19px;
  }

  .nm-quiz__side {
    display: none;
  }

  .nm-quiz__footer {
    position: absolute;
    right: 16px;
    bottom: 0;
    left: 16px;
    display: block;
    height: 86px;
    margin: 0;
    background: #fbf7f4;
  }

  .nm-quiz__progress {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    font-size: 0;
  }

  .nm-quiz__progress span,
  .nm-quiz__progress b {
    display: none;
  }

  .nm-quiz__progress i {
    margin: 0;
  }

  .nm-quiz__nav {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 16px;
    display: flex;
    width: auto;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .nm-quiz__nav small {
    display: none;
  }

  .nm-quiz__next {
    flex: 1;
    min-width: 0;
  }

  .nm-quiz__contact-left {
    min-height: 220px;
    justify-content: flex-end;
    border-right: 0;
    border-bottom: 1px solid #e3d7d0;
    padding: 70px 20px 24px;
  }

  .nm-quiz__contact-left p {
    font-size: 16px;
  }

  .nm-quiz__contact-right {
    display: block;
    padding: 20px 18px 96px;
  }

  .nm-quiz__messengers {
    max-width: none;
  }

  .nm-quiz__messengers h3 {
    font-size: 19px;
  }

  .nm-quiz__messengers button {
    min-height: 62px;
    align-items: center;
    justify-content: flex-start;
    border-radius: 8px;
  }

  .nm-quiz__lead {
    display: block;
  }

  .nm-quiz__lead-card {
    margin-top: 14px;
    padding: 16px;
  }

  .nm-quiz__done {
    position: sticky;
    bottom: 12px;
    z-index: 2;
    box-shadow: 0 14px 30px rgba(166, 25, 66, 0.26);
  }

  .nm-quiz__submit-status {
    border-radius: 8px;
    background: rgba(251, 247, 244, 0.92);
    padding: 6px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nm-quiz *,
  .nm-quiz *::before,
  .nm-quiz *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
