/* Course quiz — vanilla bridge (parity with React CourseQuiz)
   Важно: глобальные h2 { letter-spacing: -2px } склеивают кириллицу —
   все заголовки квиза явно сбрасывают tracking. */

.cq-fullwidth,
.cq-modal,
.cq-panel,
.cq-shell {
  font-family: "Manrope", system-ui, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "kern" 1, "liga" 1;
  letter-spacing: normal;
  word-spacing: normal;
}

.cq-fullwidth {
  padding: 2.5rem 0 2rem;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(37, 99, 235, 0.08), transparent 60%),
    linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
}

.cq-fullwidth__head {
  text-align: center;
  max-width: 48rem; /* max-w-3xl */
  margin: 0 auto 1.5rem;
}

/* Eyebrow */
.cq-fullwidth__brand {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #2563eb;
}

/* Главный заголовок — tracking-normal, без отрицательного kerning */
.cq-fullwidth__head h2,
.cq-modal__head h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: normal !important;
  word-spacing: normal !important;
  color: #111827;
}

@media (min-width: 768px) {
  .cq-fullwidth__head h2,
  .cq-modal__head h2 {
    font-size: 1.875rem;
  }
}

.cq-fullwidth__lead {
  margin: 1rem auto 0;
  max-width: 36rem;
  color: #4b5563;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.625;
}

@media (min-width: 768px) {
  .cq-fullwidth__lead {
    font-size: 1rem;
  }
}

.cq-panel {
  max-width: 48rem;
  margin: 0 auto;
  padding: 1.25rem;
  border-radius: 1.25rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

@media (min-width: 768px) {
  .cq-panel {
    padding: 2rem;
  }
}

.cq-progress__label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #4b5563;
  margin: 0 0 0.5rem;
}

.cq-progress__bar {
  display: none;
  height: 0.5rem;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.cq-progress__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3b82f6, #22d3ee);
  transition: width 0.3s ease-out;
}

.cq-progress__dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.cq-progress__dots i {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 999px;
  background: #d1d5db;
  transition: transform 0.2s ease, background 0.2s ease;
}

.cq-progress__dots i.is-on {
  background: #2563eb;
  transform: scale(1.15);
}

@media (min-width: 768px) {
  .cq-progress__bar {
    display: block;
  }
  .cq-progress__dots {
    display: none;
  }
}

/* Заголовок шага — ниже hero по иерархии */
.cq-step__title {
  margin: 1.5rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #1f2937;
  line-height: 1.25;
  letter-spacing: normal !important;
  word-spacing: normal !important;
}

@media (min-width: 768px) {
  .cq-step__title {
    font-size: 1.25rem;
  }
}

.cq-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .cq-options--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  }
  .cq-options--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }
}

.cq-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 140px;
  width: 100%;
  padding: 1.25rem;
  border-radius: 0.75rem;
  border: 2px solid #e5e7eb;
  background: #fff;
  text-align: left;
  cursor: pointer;
  hyphens: auto;
  -webkit-hyphens: auto;
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out,
    transform 0.2s ease-in-out, background 0.2s ease-in-out;
}

.cq-option:hover {
  border-color: #60a5fa;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.12);
  transform: scale(1.02);
}

.cq-option.is-selected,
.cq-option[aria-pressed="true"] {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 2px #bfdbfe;
  transform: scale(1.02);
}

.cq-option:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.45);
}

.cq-option__emoji {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 0.75rem;
  border-radius: 0.5rem;
  background: #f9fafb;
  font-size: 1.5rem;
  line-height: 1;
}

.cq-option__body {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  width: 100%;
  min-width: 0;
}

.cq-option__body strong {
  display: block;
  width: 100%;
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  line-height: 1.375;
}

.cq-option__body strong .cq-nowrap {
  white-space: nowrap;
}

@media (min-width: 640px) {
  .cq-label-break {
    display: block;
  }
}

@media (max-width: 639.98px) {
  .cq-label-break {
    display: none;
  }
}

.cq-option__body small {
  display: block;
  width: 100%;
  font-size: 0.875rem;
  font-weight: 400;
  color: #6b7280;
  line-height: 1.625;
}

.cq-social {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid #f3f4f6;
  background: transparent;
  border-radius: 0;
}

.cq-social__avatars {
  display: flex;
  flex-shrink: 0;
}

.cq-social__avatars span {
  width: 2rem;
  height: 2rem;
  margin-left: -0.5rem;
  border-radius: 999px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #fff;
  background: linear-gradient(135deg, #93c5fd, #6366f1);
}

.cq-social__avatars span:first-child {
  margin-left: 0;
}

.cq-social__avatars span:nth-child(2) {
  background: linear-gradient(135deg, #f9a8d4, #fb7185);
}

.cq-social__avatars span:nth-child(3) {
  background: linear-gradient(135deg, #86efac, #14b8a6);
}

.cq-social__avatars span:nth-child(4) {
  background: linear-gradient(135deg, #fcd34d, #f97316);
}

.cq-social__text {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: #4b5563;
  line-height: 1.625;
  text-align: left;
}

.cq-social__text strong {
  font-weight: 600;
  color: #111827;
}

.cq-result {
  text-align: center;
}

.cq-result__kicker {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #059669;
}

.cq-result__title {
  margin: 0 0 1.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: normal !important;
  color: #111827;
}

.cq-result__card {
  text-align: left;
  max-width: 36rem;
  margin: 0 auto;
  padding: 1.25rem;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}

.cq-result__badge {
  display: inline-flex;
  margin-bottom: 0.55rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: #ffedd5;
  color: #c2410c;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cq-result__card h4 {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: normal !important;
  color: #111827;
}

.cq-result__card p {
  margin: 0;
  color: #4b5563;
  font-weight: 500;
  line-height: 1.625;
}

.cq-result__actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

@media (min-width: 576px) {
  .cq-result__actions {
    flex-direction: row;
  }
}

.cq-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.7rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  flex: 1;
}

.cq-btn--primary {
  background: #2563eb;
  color: #fff !important;
}

.cq-btn--primary:hover {
  background: #1d4ed8;
  color: #fff !important;
}

.cq-btn--ghost {
  background: #fff;
  border-color: #d1d5db;
  color: #374151;
}

.cq-anim {
  animation: cqFadeSlide 0.3s ease-out;
}

@keyframes cqFadeSlide {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.cq-float-btn {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 1050;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 48px;
  padding: 0.75rem 1.1rem;
  border: 0;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 14px 32px rgba(37, 99, 235, 0.35);
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.35s ease, background 0.2s ease;
}

.cq-float-btn.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.cq-float-btn:hover {
  background: #1d4ed8;
}

.cq-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}

@media (min-width: 576px) {
  .cq-modal {
    align-items: center;
    padding: 1rem;
  }
}

.cq-modal__dialog {
  width: 100%;
  max-width: 48rem;
  max-height: 92vh;
  overflow: auto;
  padding: 1.25rem 1.25rem 1.5rem;
  border-radius: 1.25rem 1.25rem 0 0;
  background: #fff;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.28);
}

@media (min-width: 576px) {
  .cq-modal__dialog {
    border-radius: 1.25rem;
    padding: 1.5rem 2rem 2rem;
  }
}

.cq-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.cq-modal__close {
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  border: 0;
  border-radius: 999px;
  background: #f3f4f6;
  font-size: 1.4rem;
  line-height: 1;
  color: #4b5563;
  cursor: pointer;
}

body.cq-modal-open {
  overflow: hidden;
}

/* Mobile: чуть крупнее тач-цели и текст */
@media (max-width: 639.98px) {
  .cq-option {
    min-height: 48px;
    padding: 1.15rem;
  }

  .cq-option__body strong {
    font-size: 1.05rem;
  }

  .cq-option__body small {
    font-size: 0.9375rem;
  }

  .cq-step__title {
    font-size: 1.2rem;
  }

  .cq-social__text {
    font-size: 0.9375rem;
  }

  body.has-catalog-sticky-cta .cq-float-btn,
  .sticky-mobile-cta:not([hidden]) ~ .cq-float-btn {
    bottom: 5.5rem;
  }
}
