/* grok-quiz.css - Version 1.9-fix-no-leak - Popup đã gọn gàng hơn */

/* Phần quiz giữ nguyên như bạn cung cấp */
.quiz-container {
  width: 100%;
  max-width: 920px;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}
.question {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
  margin-bottom: 2.4em;
  padding: 0.1em 0.5em 0.5em;
  transition: all 0.25s ease;
}
.question:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.11);
  transform: translateY(-3px);
}
.question-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 1.5em 0;
  line-height: 1.45;
  padding-bottom: 0.75em;
  border-bottom: 2px solid #e2e8f0;
}
.option {
  display: flex;
  align-items: flex-start;
  margin: 1.1em 0;
  padding: 1em 1.3em;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.22s ease;
  user-select: none;
}
.option:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  transform: translateX(5px);
}
.option input[type="radio"] {
  margin: 0.4em 1.2em 0 0;
  accent-color: #2563eb;
  transform: scale(1.45);
  flex-shrink: 0;
}
.option:has(input[type="radio"]:checked) {
  background: #eff6ff;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3.5px rgba(59, 130, 246, 0.18);
}
.option span {
  line-height: 1.62;
  color: #334155;
  font-size: 1.07rem;
  flex-grow: 1;
}
.correct-answer {
  margin-top: 1.5em;
  padding: 1em 1.3em;
  background: #ecfdf5;
  border: 1px solid #86efac;
  border-radius: 9px;
  color: #15803d;
  font-weight: 600;
  font-size: 1.07rem;
  text-align: center;
  display: none !important;
}
.option:has(input[type="radio"]:checked):not(:has(~ .correct-answer)) {
  background: #fee2e2 !important;
  border-color: #f87171 !important;
}
.option:has(input[type="radio"]:checked):not(:has(~ .correct-answer)) span {
  color: #991b1b;
  font-weight: 500;
}
.question input[type="radio"]:disabled + span {
  cursor: default;
}
.question input[type="radio"]:disabled ~ .option:hover {
  transform: none;
  background: inherit;
  border-color: inherit;
}
.submit-quiz-btn {
  display: block !important;
  width: 300px;
  margin: 2.5em auto 1.5em auto !important;
  padding: 18px 40px;
  font-size: 1.3rem;
  font-weight: 700;
  color: white;
  background: linear-gradient(90deg, #2563eb, #3b82f6);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(37,99,235,0.35);
  transition: all 0.3s ease;
}
.submit-quiz-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 36px rgba(37,99,235,0.45);
}

/* ============== PHẦN POPUP ĐÃ CHỈNH SỬA (gọn hơn, chữ nhỏ hơn, button nhỏ hơn) ============== */

#password-popup {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  z-index: 99999;
  justify-content: center;
  align-items: center;
  padding: 15px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#password-popup.show {
  display: flex;
  opacity: 1;
}

#password-popup > div {
  background: white;
  padding: 24px 20px 20px;          /* giảm padding đáng kể */
  border-radius: 14px;
  max-width: 420px;                 /* nhỏ hơn */
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 15px 50px rgba(0,0,0,0.3);
  text-align: center;
  position: relative;
}

.close-btn {
  position: absolute !important;
  top: 10px;
  right: 10px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(239,68,68,0.4);
  transition: all 0.25s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  background: #dc2626;
  transform: scale(1.08);
}

.popup-h2 {
  color: #1d4ed8;
  font-size: 1.55rem;               /* nhỏ hơn */
  font-weight: 800;
  margin: 0 0 1em;
}

.guide-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;               /* nhỏ hơn */
  font-weight: 700;
  color: #1e40af;
  margin: 1.2em 0 0.8em;
  text-align: left;
}

.guide-step::before {
  content: "✔";
  font-size: 1.5rem;
  color: #22c55e;
}

#keyword {
  padding: 11px 14px;
  font-size: 1rem;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  width: 100%;
  max-width: 340px;
  background: #f8fafc;
  color: #0f172a;
  font-weight: 600;
  text-align: center;
  margin: 0.8em 0;
}

.verify-btn,
#copyButton {
  padding: 11px 24px;
  font-size: 1.02rem;
  font-weight: 700;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0,0,0,0.12);
  transition: all 0.25s;
  width: 100%;
  max-width: 280px;
  margin: 0.6em 0;
}

.verify-btn {
  background: #3b82f6;
}

.verify-btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

#copyButton {
  background: #22c55e;
}

#copyButton:hover {
  background: #16a34a;
  transform: translateY(-1px);
}

.input-box {
  margin: 1.2em 0 0.8em;
}

.password-wrapper {
  position: relative;
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
}

.password-field {
  padding: 11px 14px 11px 42px;
  font-size: 1rem;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  width: 100%;
  background: #f8fafc;
  transition: all 0.25s;
}

.password-field:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
  outline: none;
}

.password-wrapper::before {
  content: "🔒";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: #64748b;
}

.result-message {
  margin: 1em 0 0;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.98rem;
  font-weight: 600;
  text-align: center;
}

.success { background: rgba(34,197,94,0.1); color: #15803d; border: 1px solid #86efac; }
.error   { background: rgba(239,68,68,0.1); color: #b91c1c; border: 1px solid #fca5a5; }

/* Popup kết quả */
#result-popup {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  z-index: 100000;
  justify-content: center;
  align-items: center;
  padding: 15px;
}

#result-popup > div {
  background: white;
  padding: 24px 20px 20px;
  border-radius: 14px;
  max-width: 420px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 15px 50px rgba(0,0,0,0.3);
  text-align: center;
  position: relative;
  animation: popupFadeIn 0.35s ease-out;
}

@keyframes popupFadeIn {
  from { transform: scale(0.94); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

#result-content {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0.4em 0;
}

#result-message {
  color: #64748b;
  margin: 0.8em 0 1.2em;
  font-size: 1.02rem;
}

.highlight-score {
  color: #22c55e;
  font-weight: 700;
}

.feedback-text {
  color: #64748b;
  font-size: 1.02rem;
  margin-bottom: 1em;
  display: block;
}

.detail-button-wrapper {
  text-align: center;
  margin-top: 1em;
}

.detail-button-wrapper button {
  padding: 11px 32px;
  font-size: 1.05rem;
  font-weight: 700;
  color: white;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(59,130,246,0.35);
  transition: all 0.25s;
}

.detail-button-wrapper button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(59,130,246,0.45);
  background: linear-gradient(90deg, #2563eb, #3b82f6);
}

/* Responsive */
@media (max-width: 640px) {
  .quiz-container { margin: 1.5em auto 2.5em; }
  .question { padding: 1.5em 1.3em; }
  .question-title { font-size: 1.25rem; }
  .option { padding: 0.9em 1.1em; }
  .option span { font-size: 1.02rem; }
  .submit-quiz-btn, .detail-button-wrapper button {
    width: 100%; max-width: none; padding: 16px 28px;
  }
  #password-popup > div, #result-popup > div { padding: 20px 16px 16px; }
  .popup-h2 { font-size: 1.4rem; }
  .guide-step { font-size: 0.98rem; }
  #keyword, .password-field { font-size: 0.95rem; padding: 10px 12px; }
  .verify-btn, #copyButton { padding: 10px 20px; font-size: 0.98rem; max-width: 240px; }
  .detail-button-wrapper button { padding: 10px 28px; font-size: 1rem; width: 100%; }
}