
/* ============================================================
   QUIZ ENGINE — CSS
   Prefix: .qe- (isolates from host page)
   ============================================================ */

.mod_quiz_detail {
    padding: 0 !important;
}

/* ─── CSS Variables ─── */
:root {
  --qe-text-muted:   #888;
  --qe-error:        #ff4d4d;
  --qe-trans:        0.22s cubic-bezier(.4,0,.2,1);
}

/* ═══════════════════════════════════════════════
   LAYOUT MODES
   ═══════════════════════════════════════════════ */

/* 1. Page Full (с полями) */
.qe-layout--page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
    padding-top: 5rem;
    padding-bottom: 5rem;
}
.qe-layout--page .qe-body {
    min-height: 400px;
    position: relative;
}
.qe-layout--page .qe-shell {
  width: 100%;
  max-width: 960px;
    min-height: 533px;
    margin: auto;
}

/* 2. Landing (без полей, 100vw/vh) */
.qe-layout--landing {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--qe-bg);
  overflow: hidden;
}
.qe-layout--landing .qe-shell {
  width: min(800px, 96vw);
  max-height: 96vh;
}

/* 3. Popup / Modal */
.qe-layout--popup {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qe-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(4px);
  cursor: pointer;
}
.qe-layout--popup .qe-shell {
  position: relative;
  z-index: 1;
  width: min(700px, 94vw);
  max-height: 90vh;
}

.qe-welcome-right {flex: 2;padding: 24px;}
.qe-welcome-left {flex: 4;padding: 55px;}

@media (max-width: 991px) { 
	.mod_quiz_detail .qe-layout--page {padding: 1rem;}
	.qe-welcome {flex-wrap: wrap;}
	.qe-layout--page .qe-body {min-height: 75vh;}
}

/* ═══════════════════════════════════════════════
   SHELL (card wrapper)
   ═══════════════════════════════════════════════ */
.qe-shell {
  background: var(--qe-bg);
  color: var(--qe-text);
    overflow: hidden;
    box-shadow: 0 10px 20px #00000038;
  
  border-radius: 1rem;
  border: 1px solid rgb(160 160 160 / 20%);
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Close button (Popup / Landing) */
.qe-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 36px; height: 36px;
  border: 1px solid rgb(160 160 160 / 20%);
  background: var(--qe-bg);
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
  color: var(--qe-text-muted);
  font-size: 18px;
  line-height: 1;
  transition: var(--qe-trans);
}
.qe-close:hover { border-color: var(--qe-accent); color: var(--qe-accent); }
.qe-layout--popup .qe-close,
.qe-layout--landing .qe-close { display: flex; }

/* ─── Header (progress zone) ─── */
.qe-header {
  padding: 20px 28px 0;
  flex-shrink: 0;
}
.qe-progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--qe-text-muted);
  
}
.qe-progress-track {
  width: 100%;
  height: 3px;
  background: rgb(160 160 160 / 20%);
  border-radius: 99px;
  overflow: hidden;
}
.qe-progress-fill {
  height: 100%;
  background: var(--qe-accent);
  border-radius: 99px;
  transition: width .5s cubic-bezier(.4,0,.2,1);
  width: 0%;
}

/* ─── Body (scrollable slides area) ─── */
.qe-body {
  flex: 1;
  scroll-behavior: smooth;
    border-radius: 1rem;
}
.qe-body::-webkit-scrollbar { width: 4px; }
.qe-body::-webkit-scrollbar-track { background: transparent; }
.qe-body::-webkit-scrollbar-thumb { background: rgb(160 160 160 / 20%); border-radius: 4px; }

/* ─── Footer (sticky nav) ─── */
.qe-footer {
  flex-shrink: 0;
  padding: 20px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgb(160 160 160 / 20%);
  background: var(--qe-bg);
  gap: 12px;
}

/* ═══════════════════════════════════════════════
   SLIDE
   ═══════════════════════════════════════════════ */
.qe-slide {
  display: none;
  animation: qe-slide-in .28s ease;
    padding: 28px;
    border-radius: 1rem;
}
.qe-slide.active { display: block; }
@keyframes qe-slide-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.qe-slide__title {
  font-family: var(--h1h6);
  font-size: clamp(1.25rem, 3.5vw, 1.8rem);
  font-weight: 700;
  color: var(--qe-text);
  line-height: 1.3;
  margin-bottom: 8px;
}
.qe-slide__subtitle {
  font-size: 0.9rem;
  color: var(--qe-text-muted);
  margin-bottom: 24px;
  line-height: 1.5;
}
.qe-required-badge {
  display: inline-block;
  font-size: 10px;
  color: var(--qe-error);
  border: 1px solid var(--qe-error);
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 8px;
  vertical-align: middle;
  
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ─── Field wrapper ─── */

.qe-field {
    position: relative;
    margin-bottom: 1rem;
}

.qe-field__label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--qe-text-muted);
  margin-bottom: 8px;
  letter-spacing: .01em;
}
.qe-field__error {
  font-size: 12px;
  color: var(--qe-error);
  margin-top: 6px;
  display: none;
    position: absolute;
    bottom: 0;
}
.qe-field.has-error .qe-field__error { display: block; }
.qe-field.has-error input,
.qe-field.has-error textarea,
.qe-field.has-error .qe-select-trigger,
.qe-field.has-error .qe-date-input {
  border-color: var(--qe-error) !important;
}
.qe-char-count {
  font-size: 11px;
  color: var(--qe-text-muted);
  text-align: right;
  margin-top: 4px;
}
.qe-char-count.over { color: var(--qe-error); }

/* ═══════════════════════════════════════════════
   INPUT TYPES
   ═══════════════════════════════════════════════ */

/* Text / Textarea */
.qe-input,
.qe-textarea {
  width: 100%;
  background: var(--qe-bg);
  border: 1px solid rgb(160 160 160 / 20%);
  border-radius: .5rem;
  color: var(--qe-text);
  
  font-size: 0.95rem;
  padding: 12px 16px;
  outline: none;
  transition: border-color var(--qe-trans);
  resize: none;
  min-height: 46px;
}
.qe-input:focus,
.qe-textarea:focus { border-color: var(--qe-accent); }
.qe-input::placeholder,
.qe-textarea::placeholder { color: var(--qe-text-muted); }

/* Radio / Checkbox Cards */
.qe-options-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 700px) { .qe-options-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .qe-options-grid { grid-template-columns: 1fr; } }

.qe-options-list { display: flex; flex-direction: column; gap: 8px; }

.qe-option {
  position: relative;
  cursor: pointer;
}
.qe-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.qe-option__card {
display: flex;
    align-items: center;
    gap: 10px;

    padding: 12px 16px;
    border: 1px solid rgb(160 160 160 / 20%);
    border-radius: .5rem;
    transition: var(--qe-trans);
    user-select: none;
    min-height: 46px;
    font-weight: normal;
    font-family: var(--font);
}
.qe-option:hover .qe-option__card,
.qe-option input:checked + .qe-option__card {
  border-color: var(--qe-accent);
  background: rgb(0 0 0 / 3%);
}
.qe-option__dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 1px solid rgb(160 160 160 / 20%);
  flex-shrink: 0;
  transition: var(--qe-trans);
  display: flex; align-items: center; justify-content: center;
}
.qe-option input:checked + .qe-option__card .qe-option__dot {
  border-color: var(--qe-accent);
  background: var(--qe-accent);
}
.qe-option__dot::after {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  transition: var(--qe-trans);
}
.qe-option input:checked + .qe-option__card .qe-option__dot::after { opacity: 1; }

/* Checkbox dot variant */
.qe-option--checkbox .qe-option__dot {
  border-radius: 4px;
}
.qe-option--checkbox input:checked + .qe-option__card .qe-option__dot::after {
  content: '✓';
  width: auto; height: auto;
  font-size: 10px; font-weight: 700;
  background: none; color: #fff; opacity: 1;
}

/* Image options */
.qe-options-images {
  --gap: 10px;
  --min-col: 135px;
  --max-cols: 5;

  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(
    auto-fit,
    minmax(
      max(
        var(--min-col),
        calc((100% - (var(--max-cols) - 1) * var(--gap)) / var(--max-cols))
      ),
      1fr
    )
  );
}
@media (max-width: 700px) { .qe-options-images { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .qe-options-images { grid-template-columns: 1fr; } }

.qe-option--image .qe-option__card {
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  align-items: stretch;
  min-height: auto;
}
.qe-option--image .qe-option__img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: rgb(160 160 160 / 20%);
  display: flex; align-items: center; justify-content: center;
}
.qe-option--image .qe-option__img img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.qe-option--image .qe-option__label {
  padding: 1rem;
  font-size: 1rem;
  display: flex; align-items: center; gap: 8px;
    line-height: 1;
}

/* Custom Dropdown */
.qe-select-wrap { position: relative; }
.qe-select-trigger {
  width: 100%;
  background: var(--qe-bg);
  border: 1px solid rgb(160 160 160 / 20%);
  border-radius: .5rem;
  color: var(--qe-text);
  
  font-size: 0.95rem;
  padding: 12px 42px 12px 16px;
  cursor: pointer;
  transition: var(--qe-trans);
  display: flex; align-items: center; justify-content: space-between;
  user-select: none;
  min-height: 46px;
}
.qe-select-trigger:hover,
.qe-select-trigger.open { border-color: var(--qe-accent); }
.qe-select-arrow {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--qe-text-muted); pointer-events: none; font-size: 12px;
  transition: var(--qe-trans);
}
.qe-select-trigger.open ~ .qe-select-arrow { transform: translateY(-50%) rotate(180deg); }
.qe-select-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--qe-bg);
  border: 1px solid var(--qe-accent);
  border-radius: .5rem;
  z-index: 100;
  overflow: hidden;
  max-height: 220px; overflow-y: auto;
  display: none;
}
.qe-select-dropdown.open { display: block; animation: qe-slide-in .18s ease; }
.qe-select-search {
  padding: 8px 12px;
  border-bottom: 1px solid rgb(160 160 160 / 20%);
}
.qe-select-search input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--qe-text);
  
  font-size: 0.88rem;
}
.qe-select-search input::placeholder { color: var(--qe-text-muted); }
.qe-select-option {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--qe-text);
  transition: background var(--qe-trans);
}
.qe-select-option:hover { background: rgb(0 0 0 / 3%); }
.qe-select-option.selected { color: var(--qe-accent); }

/* Slider */
.qe-slider-wrap { padding: 16px 0 8px; }
.qe-slider-labels {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--qe-text-muted); margin-bottom: 8px;
}
.qe-slider-val {
  font-family: var(--h1h6);
  font-size: 1.6rem;
  color: var(--qe-accent);
  text-align: center;
  margin-bottom: 12px;
}
.qe-range-vals {
  display: flex; justify-content: center;
  font-family: var(--h1h6);
  font-size: 1.1rem;
  color: var(--qe-accent);
  margin-bottom: 12px;    gap: 1rem;
}

/* Native range override */
.qe-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 99px;
  background: rgb(160 160 160 / 20%);
  outline: none;
  cursor: pointer;
}
.qe-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--qe-accent);
  border: 2px solid #fff;
  cursor: pointer;
  transition: transform .15s;
  position:relative;z-index:9
}
.qe-range::-webkit-slider-thumb:active { transform: scale(1.25); }
.qe-range::-moz-range-thumb {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--qe-accent);
  border: 2px solid #fff;
  cursor: pointer;
  position:relative;z-index:9
}
.qe-range-dual { position: relative; height: 1rem; margin: 8px 0; }
.qe-range-dual input[type=range] {
  position: absolute;
  width: 100%;
  pointer-events: none;
}
.qe-range-dual input[type=range]::-webkit-slider-thumb { pointer-events: all; }




/* Date */
.qe-date-input {
  width: 100%;
  border: 1px solid rgb(160 160 160 / 20%);
  border-radius: .5rem;
    line-height: 1 !important;
  padding: 12px 16px;
  outline: none;
  transition: border-color var(--qe-trans);
  cursor: pointer;
}
.qe-date-input:focus { border-color: var(--qe-accent); }
.qe-date-input::-webkit-calendar-picker-indicator {
  cursor: pointer;
}

/* File Upload */
.qe-file-zone {
  border: 1px dashed rgb(160 160 160 / 20%);
  border-radius: .5rem;
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--qe-trans);
  position: relative;
}
.qe-file-zone:hover, .qe-file-zone.drag-over {
  border-color: var(--qe-accent);
  background: rgb(0 0 0 / 3%);
}
.qe-file-zone input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
}
.qe-file-icon { font-size: 2rem; margin-bottom: 8px; color: var(--qe-text-muted); }
.qe-file-text { font-size: 0.9rem; color: var(--qe-text-muted); }
.qe-file-text span { color: var(--qe-accent); text-decoration: underline; }
.qe-file-preview {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px;
}
.qe-file-preview__item {
  background: var(--qe-bg);
  border: 1px solid rgb(160 160 160 / 20%);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--qe-text-muted);
  display: flex; align-items: center; gap: 6px;
}
.qe-file-preview__remove {
  color: var(--qe-error); cursor: pointer; font-size: 14px; line-height: 1;
}

/* ═══════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════ */
.qe-btn {
  font-family: var(--h1h6);
  font-size: 0.9rem;
  letter-spacing: .04em;
  padding: 12px 28px;
  border-radius: .5rem;
  border: none;
  cursor: pointer;
  transition: var(--qe-trans);
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px;
}
.qe-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}
.qe-btn--primary {
  background: var(--qe-accent);
  color: #fff;
}
.qe-btn--primary:hover:not(:disabled) { background: var(--qe-accent); transform: translateY(-1px); }
.qe-btn--primary:active:not(:disabled) { transform: translateY(0); }
.qe-btn--ghost {
  background: transparent;
  color: var(--qe-text-muted);
  border: 1px solid rgb(160 160 160 / 20%);
}
.qe-btn--ghost:hover:not(:disabled) { border-color: var(--qe-text-muted); color: var(--qe-text); }
.qe-btn--back { visibility: hidden; }
.qe-btn--back.visible { visibility: visible; }

/* Spinner */
.qe-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: qe-spin .7s linear infinite;
}
@keyframes qe-spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════
   SUCCESS SCREEN
   ═══════════════════════════════════════════════ */
.qe-success {
  display: none;
  text-align: center;
  padding: 52px 28px;
}
.qe-success.active { display: block; animation: qe-slide-in .35s ease; }
.qe-success__icon {
  width: 72px; height: 72px;
  background: rgba(64,201,126,.12);
  border: 2px solid var(--success);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  margin: 0 auto 24px;
  animation: qe-pop .4s .1s both cubic-bezier(.4,0,.2,1);
}
@keyframes qe-pop {
  from { transform: scale(.6); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.qe-success__title {
  font-family: var(--h1h6);
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 700;
  margin-bottom: 12px;
}
.qe-success__text {
  color: var(--qe-text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════
   ENDPOINT STATUS (bottom block)
   ═══════════════════════════════════════════════ */
.qe-endpoint-log {
  margin-top: 12px;
  background: var(--qe-bg);
  border: 1px solid rgb(160 160 160 / 20%);
  border-radius: .5rem;
  padding: 12px 16px;
  font-size: 12px;
  font-family: 'DM Mono', monospace;
  color: var(--qe-text-muted);
  max-height: 120px;
  overflow-y: auto;
  line-height: 1.7;
}
.qe-endpoint-log .ok   { color: var(--success); }
.qe-endpoint-log .err  { color: var(--qe-error); }
.qe-endpoint-log .info { color: #64b5f6; }





.qe-checkbox-label__text {
    font-family: var(--font);
    font-weight: 400;
}

.qe-checkbox-label__text a {
    color: var(--qe-accent);
    text-decoration: underline;
}

.qe-checkbox-label {
    display: flex;
    gap: 10px;
    align-items: center;
    padding-bottom: 1rem;
    font-size: .9rem;
    white-space: nowrap;
}

.qe-checkbox {
    margin: 0!important;
}





/* Приветственный экран */
.qe-slide--welcome {
  background-size: cover;
  background-position: center;
  padding: 0;position: absolute;
    inset: 0;
}
.qe-welcome {
    display: flex;
    justify-content: space-between;height: 100%;
    border-radius: 1rem;
    overflow: hidden;
}
.qe-welcome__name { font-size: 28px; margin: 0 0 12px; 
    font-weight: 700;}
.qe-welcome__desc { font-size: 16px; margin: 0 0 24px; opacity: .85; }
.qe-btn--start { padding: 14px 36px; font-size: 16px; }

/* Бонусы */
.qe-bonus { margin: 24px 0 32px; }
.qe-bonus__title { font-size: .7rem; margin-bottom: 12px; }
.qe-bonus__list { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center;    font-size: .8rem; }
.qe-bonus-item {
  display: flex; gap: 8px; align-items: center;
  padding: 8px; border: 1px solid rgb(160 160 160 / 20%); border-radius: 8px;
    background-color: var(--qe-bg);width: 100%;
}
.qe-bonus-item__img img {
  width: 44px; height: 44px; object-fit: cover; border-radius: 8px; display: block;
}
.qe-bonus-item__value { font-weight: 700; color: #e53935; }

/* Фоновое изображение модуля */
.qe-shell[style*="background-image"] {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}



