/* ===============================
   QUIZZ MODAL – OVERLAY
   =============================== */

.quizz-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 5, 0.65);
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.quizz-modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* ===============================
   QUIZZ MODAL – WRAPPER (fullscreen flex)
   =============================== */

.quizz-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 16px;

  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.quizz-modal.active {
  opacity: 1;
  transform: translateY(0);
}

/* ===============================
   QUIZZ MODAL – INNER (a caixa)
   =============================== */

.quizz-modal-inner {
  width: 100%;
  max-width: 760px;

  max-height: calc(100vh - 32px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;

  background: #f9f9f7;
  color: #111;

  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);

  padding: 34px 40px 30px;

  position: relative; /* importante: o X ancora aqui */
}

/* iOS safe areas (notch) */
@supports (padding: max(0px)) {
  .quizz-modal-inner {
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }
}

/* ===============================
   BOTÃO FECHAR (X) – canto superior direito
   =============================== */

.quizz-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;

  width: 40px;
  height: 40px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 10px;

  font-size: 20px;
  font-weight: 700;
  line-height: 1;

  color: #111;
  cursor: pointer;
  z-index: 10;

  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.quizz-modal-close:hover {
  background: rgba(0,0,0,0.12);
  border-color: rgba(0,0,0,0.18);
  transform: translateY(-1px);
}

.quizz-modal-close:active {
  transform: translateY(0);
}

.quizz-modal-close:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Dá espaço ao X para não bater no título */
.quizz-header {
  padding-right: 56px;
  margin-bottom: 22px;
}

/* ===============================
   HEADER
   =============================== */

.quizz-title {
  margin: 0 0 6px;
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--gold);
}

.quizz-sub {
  margin: 0;
  font-size: 0.95rem;
  color: #555;
}

/* ===============================
   BODY
   =============================== */

.quizz-body {
  margin-top: 10px;
}

.quizz-progress {
  font-size: 0.85rem;
  color: #777;
  margin-bottom: 14px;
}

/* ===============================
   QUESTION
   =============================== */

.quizz-question {
  margin-bottom: 18px;
}

.quizz-qtext {
  margin: 0 0 16px;
  font-size: 1.1rem;
  font-weight: 500;
  color: #111;
  line-height: 1.45;
}

/* ===============================
   OPTIONS
   =============================== */

.quizz-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quizz-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.14);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.quizz-option input {
  margin-top: 4px;
}

.quizz-option span {
  font-size: 0.95rem;
  line-height: 1.4;
  color: #222;
}

.quizz-option:hover {
  border-color: rgba(198,166,97,0.7);
  box-shadow: 0 6px 18px rgba(0,0,0,0.10);
}

.quizz-option input:checked + span {
  font-weight: 600;
}

/* ===============================
   ALERT / INFO
   =============================== */

.quizz-alert {
  background: #fff6e5;
  border: 1px solid #f0d48a;
  color: #7a5a00;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

/* ===============================
   FOOTER / ACTIONS
   =============================== */

.quizz-footer {
  margin-top: 26px;
  border-top: 1px solid rgba(0,0,0,0.10);
  padding-top: 20px;
}

.quizz-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.quizz-actions-right {
  display: flex;
  gap: 10px;
}

/* Botões secundários (subtis, coerentes) */
.quizz-footer .btn-secondary {
  background: transparent;
  border: 1px solid rgba(198, 166, 97, 0.35);
  color: rgba(122, 90, 0, 0.75);

  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 10px;

  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.quizz-footer .btn-secondary:hover {
  background: rgba(198, 166, 97, 0.12);
  border-color: rgba(198, 166, 97, 0.65);
  color: #5b4200;
}

.quizz-footer .btn-secondary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ===============================
   SUMMARY
   =============================== */

.quizz-summary {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.quizz-summary-item {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 10px;
  padding: 14px 16px;
}

.quizz-summary-q {
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: #333;
}

.quizz-summary-n {
  font-weight: 700;
  margin-right: 6px;
}

.quizz-summary-a {
  font-size: 0.9rem;
  color: #555;
}

/* ===============================
   RESULT
   =============================== */

.quizz-result {
  text-align: center;
  padding: 22px 0;
}

.quizz-result-title {
  margin: 0 0 10px;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--gold);
}

.quizz-result-score {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 8px 0;
  color: #111;
}

.quizz-result-text {
  font-size: 0.95rem;
  max-width: 560px;
  margin: 10px auto 0;
  color: #444;
  line-height: 1.45;
}

/* ===============================
   SUBMIT STATUS
   =============================== */

.quizz-submit-status {
  font-size: 0.85rem;
  color: #777;
  margin-left: 12px;
}

/* ===============================
   RESPONSIVE
   =============================== */

@media (max-width: 680px) {
  .quizz-modal {
    padding: 12px;
  }

  .quizz-modal-inner {
    max-height: calc(100vh - 24px);
    padding: 24px 18px 18px;
  }

  .quizz-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .quizz-actions-right {
    width: 100%;
    justify-content: flex-end;
  }

  .quizz-footer .btn-secondary,
  .quizz-footer .btn,
  .quizz-footer .btn-primary {
    width: 100%;
    justify-content: center;
  }
}