/* Тест бөлімі (/tests, /test/{id}) */

.emle-site .page-tests,
.emle-site .page-test {
  --t-main: var(--Main, #00af54);
  --t-main-dark: var(--main-dark, #009c4b);
  --t-main-light: #e5f9ef;
  --t-text: var(--Black, #2c2c2c);
  --t-muted: #7b7e90;
  --t-border: #e6e7eb;
  --t-surface: #f7f7f7;
  --t-wrong: #e5484d;
  --t-wrong-light: #fdeeee;
  --t-warn: #b7791f;
  --t-warn-light: #fdf6e3;
  padding-bottom: 5rem;
  color: var(--t-text);
}

/* ---------- Тесттер тізімі ---------- */

.emle-site .page-tests .tests-lead {
  font-size: 1.125rem;
  color: var(--t-muted);
  margin: -1rem 0 2rem;
  max-width: 40rem;
}

.emle-site .page-tests .tests-empty {
  color: var(--t-muted);
}

.emle-site .test-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  height: 100%;
  padding: 1.75rem;
  border: 1px solid var(--t-border);
  border-radius: 1rem;
  background: #fff;
  color: var(--t-text);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.emle-site .test-card:hover {
  border-color: var(--t-main);
  box-shadow: 0 12px 32px rgba(0, 175, 84, 0.12);
  transform: translateY(-2px);
  color: var(--t-text);
}

.emle-site .test-card__level {
  padding: 0.25rem 0.75rem;
  border-radius: 2rem;
  background: var(--t-main-light);
  color: var(--t-main-dark);
  font-size: 0.875rem;
  font-weight: 600;
}

.emle-site .test-card__title {
  font-family: Geologica;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
}

.emle-site .test-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  color: var(--t-muted);
  font-size: 0.95rem;
}

.emle-site .test-card__meta i {
  margin-right: 0.25rem;
  color: var(--t-main);
}

.emle-site .test-card__btn {
  margin-top: auto;
}

.emle-site .test-card__description {
  color: var(--t-muted);
  line-height: 1.5;
}

.emle-site .test-card__lock {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--t-warn);
  font-weight: 500;
}

.emle-site .tests-login-note {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  border-radius: 0.75rem;
  background: var(--t-warn-light);
  color: var(--t-text);
}

.emle-site .tests-login-note i {
  color: var(--t-warn);
  font-size: 1.25rem;
}

.emle-site .tests-login-note a {
  color: var(--t-main-dark);
  font-weight: 600;
  text-decoration: underline;
}

/* ---------- Тест беті ---------- */

.emle-site .page-test .test-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2.5rem;
  color: var(--t-muted);
  font-weight: 500;
}

.emle-site .page-test .test-back:hover {
  color: var(--t-main);
}

.emle-site .page-test .page-title {
  margin-top: 1rem;
}

.emle-site .test-progress {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 0;
  margin-bottom: 1.5rem;
  background: #fff;
  border-bottom: 1px solid var(--t-border);
}

.emle-site .test-progress__text {
  white-space: nowrap;
  color: var(--t-muted);
}

.emle-site .test-progress__text b {
  color: var(--t-text);
}

.emle-site .test-progress__bar {
  flex: 1;
  height: 0.5rem;
  border-radius: 1rem;
  background: var(--t-surface);
  overflow: hidden;
}

.emle-site .test-progress__bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 1rem;
  background: var(--t-main);
  transition: width 0.3s;
}

.emle-site .test-section {
  margin-bottom: 3rem;
}

.emle-site .test-section__title {
  font-family: Geologica;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.emle-site .test-section__instruction {
  color: var(--t-muted);
  font-size: 1.05rem;
  margin-bottom: 1.25rem;
}

.emle-site .test-wordbank {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.emle-site .test-wordbank__item {
  padding: 0.375rem 0.875rem;
  border: 1px dashed var(--t-main);
  border-radius: 0.5rem;
  background: var(--t-main-light);
  color: var(--t-main-dark);
  font-weight: 600;
}

.emle-site .test-question {
  display: flex;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--t-border);
  border-left: 4px solid var(--t-border);
  border-radius: 0.75rem;
  background: #fff;
  transition: border-color 0.2s;
}

.emle-site .test-question__num {
  flex: 0 0 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--t-surface);
  color: var(--t-muted);
  font-size: 0.875rem;
  font-weight: 600;
}

.emle-site .test-question__body {
  flex: 1;
  min-width: 0;
}

.emle-site .test-question__text {
  font-size: 1.0625rem;
  line-height: 1.6;
}

.emle-site .test-question__text + .test-options,
.emle-site .test-question__text + .test-input--block {
  margin-top: 0.875rem;
}

.emle-site .test-question__text strong {
  color: var(--t-main-dark);
}

.emle-site .test-options {
  display: grid;
  gap: 0.5rem;
}

.emle-site .test-options--pair {
  grid-template-columns: repeat(2, minmax(0, 14rem));
}

.emle-site .test-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--t-border);
  border-radius: 0.625rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.emle-site .test-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.emle-site .test-option:hover {
  border-color: #bae9cc;
}

.emle-site .test-option__letter {
  flex: 0 0 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  background: var(--t-surface);
  color: var(--t-muted);
  font-size: 0.875rem;
  font-weight: 700;
}

.emle-site .test-options--pair .test-option__letter {
  display: none;
}

.emle-site .test-option.is-selected {
  border-color: var(--t-main);
  background: var(--t-main-light);
}

.emle-site .test-option.is-selected .test-option__letter {
  background: var(--t-main);
  color: #fff;
}

.emle-site .test-input {
  width: 10rem;
  max-width: 100%;
  margin: 0 0.375rem;
  padding: 0.125rem 0.375rem;
  border: none;
  border-bottom: 2px solid var(--t-border);
  background: transparent;
  color: var(--t-main-dark);
  font-weight: 600;
  outline: none;
  transition: border-color 0.15s;
}

.emle-site .test-input:focus {
  border-bottom-color: var(--t-main);
}

.emle-site .test-input--block {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--t-border);
  border-radius: 0.625rem;
}

.emle-site .test-input--block:focus {
  border-color: var(--t-main);
}

.emle-site .test-question__feedback:empty {
  display: none;
}

.emle-site .test-question__feedback {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
}

/* ---------- Кіру қажет / алдын ала қарау ---------- */

.emle-site .test-gate {
  display: flex;
  gap: 1.5rem;
  padding: 2rem;
  margin-bottom: 2rem;
  border: 1px solid var(--t-border);
  border-radius: 1rem;
  background: #fff;
}

.emle-site .test-gate__icon {
  flex: 0 0 4rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  background: var(--t-main-light);
  color: var(--t-main-dark);
  font-size: 1.75rem;
}

.emle-site .test-gate__title {
  font-family: Geologica;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.emle-site .test-gate__text {
  color: var(--t-muted);
  max-width: 40rem;
  margin-bottom: 1rem;
}

.emle-site .test-gate__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  color: var(--t-muted);
}

.emle-site .test-gate__meta i {
  margin-right: 0.25rem;
  color: var(--t-main);
}

.emle-site .test-gate__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.emle-site .test-gate__description {
  color: var(--t-muted);
  margin-bottom: 1rem;
}

.emle-site .test-gate__sections {
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: 40rem;
}

.emle-site .test-gate__sections li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--t-border);
}

.emle-site .test-gate__sections b {
  color: var(--t-muted);
  font-weight: 500;
  white-space: nowrap;
}

.emle-site .test-preview-note {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-radius: 0.75rem;
  background: var(--t-warn-light);
  color: var(--t-warn);
  font-weight: 500;
}

/* ---------- Тексеру нәтижесі ---------- */

.emle-site .is-checked .test-option {
  cursor: default;
}

.emle-site .test-question.is-correct {
  border-left-color: var(--t-main);
}

.emle-site .test-question.is-wrong,
.emle-site .test-question.is-skipped {
  border-left-color: var(--t-wrong);
}

.emle-site .test-question.is-wrong .test-question__feedback,
.emle-site .test-question.is-skipped .test-question__feedback {
  color: var(--t-wrong);
}

.emle-site .test-question.is-unkeyed {
  border-left-color: #eab846;
}

.emle-site .test-question.is-unkeyed .test-question__feedback {
  color: var(--t-warn);
}

.emle-site .test-option.is-answer {
  border-color: var(--t-main);
  background: var(--t-main-light);
}

.emle-site .test-option.is-answer .test-option__letter {
  background: var(--t-main);
  color: #fff;
}

.emle-site .test-option.is-wrong {
  border-color: var(--t-wrong);
  background: var(--t-wrong-light);
}

.emle-site .test-option.is-wrong .test-option__letter {
  background: var(--t-wrong);
  color: #fff;
}

.emle-site .test-question.is-correct .test-input {
  border-color: var(--t-main);
}

.emle-site .test-question.is-wrong .test-input {
  border-color: var(--t-wrong);
  color: var(--t-wrong);
}

.emle-site .test-result {
  padding: 2rem;
  margin-bottom: 1.5rem;
  border-radius: 1rem;
  background: var(--t-main-light);
  text-align: center;
}

.emle-site .test-result__score {
  font-family: Geologica;
  font-size: 3rem;
  font-weight: 700;
  color: var(--t-main-dark);
  line-height: 1.1;
}

.emle-site .test-result__label {
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.emle-site .test-result__details {
  color: var(--t-muted);
  max-width: 36rem;
  margin: 0 auto;
}

.emle-site .test-actions {
  display: flex;
  gap: 0.75rem;
}

@media (max-width: 767.98px) {
  .emle-site .test-card {
    padding: 1.25rem;
  }

  .emle-site .test-gate {
    flex-direction: column;
    padding: 1.25rem;
    gap: 1rem;
  }

  .emle-site .test-question {
    padding: 1rem;
    gap: 0.75rem;
  }

  .emle-site .test-question__num {
    flex-basis: 1.75rem;
    height: 1.75rem;
  }

  .emle-site .test-options--pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .emle-site .test-progress__text {
    font-size: 0.875rem;
  }

  .emle-site .test-input {
    width: 7.5rem;
  }

  .emle-site .test-input--block {
    width: 100%;
  }

  .emle-site .test-actions .e-btn {
    flex: 1;
  }
}
