/* ================================================================
   Quiz Master – Frontend Styles
   ================================================================ */

/* Wrapper */
.qm-quiz-wrapper {
  max-width: 720px;
  margin: 30px auto;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
    sans-serif;
  color: #1f1915;
}

.qm-screen {
  display: none;
}
.qm-screen.qm-active {
  display: block;
}

/* ── Info Screen ─────────────────────────────────────────────── */

.qm-screen-info {
  text-align: center;
  background: #fff;
  color: #1f1915;
  border-radius: 16px;
  padding: 48px 36px;
  box-shadow: 0 4px 24px rgba(31, 25, 21, 0.08);
}

.qm-quiz-title {
  font-size: 28px;
  margin: 0 0 16px;
  font-weight: 700;
}

.qm-info-text {
  font-size: 16px;
  line-height: 1.7;
  opacity: 0.95;
  margin-bottom: 24px;
}

.qm-info-text p {
  margin: 0 0 10px;
}

.qm-meta {
  font-size: 14px;
  opacity: 0.8;
  margin-bottom: 28px;
}

/* ── Buttons ─────────────────────────────────────────────────── */

.qm-btn {
  display: inline-block;
  padding: 14px 36px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.25s ease;
  background: #1f1915;
  color: #fffdf5;
}

.qm-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(31, 25, 21, 0.25);
}

.qm-btn-outline {
  background: transparent;
  border: 2px solid #1f1915;
  color: #1f1915;
}

.qm-screen-questions .qm-btn,
.qm-screen-result .qm-btn {
  background: #1f1915;
  color: #fffdf5;
}

.qm-screen-questions .qm-btn-outline {
  background: transparent;
  border: 2px solid #1f1915;
  color: #1f1915;
}

/* ── Progress Bar ────────────────────────────────────────────── */

.qm-progress-bar {
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
  margin-bottom: 8px;
  overflow: hidden;
}

.qm-progress-fill {
  height: 100%;
  background: #1f1915;
  border-radius: 3px;
  width: 0%;
  transition: width 0.4s ease;
}

.qm-question-counter {
  text-align: right;
  font-size: 13px;
  color: #888;
  margin-bottom: 20px;
}

/* ── Question Slide ──────────────────────────────────────────── */

.qm-screen-questions {
  background: #fff;
  border-radius: 16px;
  padding: 36px;
  box-shadow: 0 4px 24px rgba(31, 25, 21, 0.08);
}

.qm-q-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 20px;
  line-height: 1.5;
}

.qm-q-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #1f1915;
  color: #fffdf5;
  border-radius: 50%;
  font-size: 14px;
  margin-right: 10px;
  vertical-align: middle;
}

.qm-q-image {
  margin-bottom: 20px;
  text-align: center;
}

.qm-q-image img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

/* ── Options ─────────────────────────────────────────────────── */

.qm-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.qm-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border: 2px solid #e8e8e8;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fafafa;
}

.qm-option:hover {
  border-color: #1f1915;
  background: #fffdf5;
}

.qm-option input[type="radio"] {
  display: none;
}

.qm-option input[type="radio"]:checked + .qm-option-letter {
  background: #1f1915;
  color: #fffdf5;
  border-color: #1f1915;
}

.qm-option input[type="radio"]:checked ~ .qm-option-text {
  font-weight: 600;
  color: #1f1915;
}

.qm-option-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 2px solid #ccc;
  border-radius: 50%;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.qm-option-text {
  font-size: 15px;
  line-height: 1.5;
  transition: all 0.2s ease;
}

/* ── Navigation ──────────────────────────────────────────────── */

.qm-nav-buttons {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid #eee;
}

/* ── Result Screen ───────────────────────────────────────────── */

.qm-screen-result {
  display: none;
}
.qm-screen-result.qm-active {
  display: block;
}

.qm-result-card {
  background: #fffdf5;
  border-radius: 16px;
  padding: 48px 36px;
  text-align: center;
  box-shadow: 0 4px 24px rgba(31, 25, 21, 0.08);
}

.qm-result-icon {
  font-size: 56px;
  margin-bottom: 12px;
}

.qm-result-title {
  font-size: 24px;
  margin: 0 0 16px;
}

.qm-result-score {
  font-size: 48px;
  font-weight: 800;
  line-height: 1.3;
  padding: 10px 0;
  color: #1f1915;
  margin-bottom: 20px;
}

.qm-result-message {
  font-size: 17px;
  line-height: 1.7;
  color: #1f1915;
  margin-bottom: 32px;
  padding: 20px;
  background: rgba(31, 25, 21, 0.04);
  border-radius: 12px;
  border-left: 4px solid #1f1915;
}

/* ── Email Section ───────────────────────────────────────────── */

.qm-email-section {
  border-top: 1px solid #eee;
  padding-top: 24px;
}

.qm-email-section p {
  color: #666;
  margin-bottom: 12px;
}

.qm-email-form {
  display: flex;
  gap: 10px;
  justify-content: center;
  max-width: 420px;
  margin: 0 auto;
}

.qm-email-input {
  flex: 1;
  padding: 12px 18px;
  border: 2px solid #ddd;
  border-radius: 50px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

.qm-email-input:focus {
  border-color: #1f1915;
}

.qm-email-status {
  margin-top: 12px;
  font-size: 14px;
}

.qm-email-status.qm-success {
  color: #27ae60;
}
.qm-email-status.qm-error {
  color: #e74c3c;
}

/* ── Loading / Spinner ───────────────────────────────────────── */

.qm-loading {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  z-index: 10;
}

.qm-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e0e0e0;
  border-top-color: #1f1915;
  border-radius: 50%;
  animation: qm-spin 0.7s linear infinite;
}

@keyframes qm-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Responsive ──────────────────────────────────────────────── */

@media (max-width: 600px) {
  .qm-screen-info,
  .qm-screen-questions,
  .qm-result-card {
    padding: 28px 18px;
  }

  .qm-quiz-title {
    font-size: 22px;
  }
  .qm-q-title {
    font-size: 17px;
  }
  .qm-result-score {
    font-size: 36px;
  }

  .qm-email-form {
    flex-direction: column;
  }

  .qm-nav-buttons {
    flex-direction: column;
  }

  .qm-nav-buttons .qm-btn {
    width: 100%;
    text-align: center;
  }
}
