/* ============================================================
   MITSOLAB AGENT QUIZ — overlay styles
   ============================================================ */

/* ===== TRIGGER BUTTON ===== */
.quiz-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  color: rgba(255, 255, 255, 0.9);
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  font-family: "Inter", sans-serif;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  white-space: nowrap;
}
.quiz-trigger:hover {
  border-color: rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* Light context (pricing page hero) */
.quiz-trigger.quiz-trigger-light {
  border-color: rgba(4, 56, 115, 0.25);
  color: #043873;
  background: transparent;
}
.quiz-trigger.quiz-trigger-light:hover {
  border-color: #043873;
  background: rgba(4, 56, 115, 0.05);
}

/* ===== OVERLAY ===== */
.quiz-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.quiz-overlay[hidden] { display: none; }

.quiz-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 15, 38, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: quiz-fade-in 0.25s ease;
}

@keyframes quiz-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ===== SHELL ===== */
.quiz-shell {
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border-radius: 28px;
  width: 100%;
  max-width: 840px;
  height: min(90vh, 760px);
  max-height: 760px;
  min-height: 560px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 36px 90px rgba(2, 8, 30, 0.45), 0 0 0 1px rgba(255,255,255,0.06);
  animation: quiz-slide-up 0.3s cubic-bezier(0.34, 1.2, 0.64, 1);
}

@keyframes quiz-slide-up {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== HEADER ===== */
.quiz-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  background: linear-gradient(180deg, rgba(240, 247, 255, 0.9), rgba(255, 255, 255, 0));
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
  flex-shrink: 0;
}

.quiz-progress-track {
  flex: 1;
  height: 5px;
  background: #f1f5f9;
  border-radius: 99px;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4f9cf9, #818cf8);
  border-radius: 99px;
  width: 0%;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f1f5f9;
  border: none;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}
.quiz-close:hover { background: #e2e8f0; color: #0f172a; }

/* ===== SCREENS CONTAINER ===== */
.quiz-screens {
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* ===== INDIVIDUAL SCREEN ===== */
.quiz-screen {
  position: absolute;
  inset: 0;
  padding: 44px 52px 40px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transform: translateX(40px);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-screen.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.quiz-screen.exit-left {
  opacity: 0;
  transform: translateX(-40px);
  pointer-events: none;
}

/* ===== INTRO SCREEN ===== */
.quiz-intro-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #e0eeff, #ede9ff);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #043873;
  font-size: 28px;
  margin-bottom: 20px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

.quiz-screen h2 {
  font-family: "Outfit", sans-serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0f172a;
  margin: 0 0 12px;
  line-height: 1.15;
}

.quiz-screen > p {
  font-size: 16px;
  color: #475569;
  line-height: 1.65;
  margin: 0 0 32px;
  max-width: 620px;
}

.quiz-time-note {
  font-size: 13px;
  color: #94a3b8;
  margin-top: 14px;
  align-self: center;
}

/* ===== QUESTION META ===== */
.quiz-q-meta {
  margin-bottom: 8px;
}

.quiz-q-num {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #4f9cf9;
}

.quiz-q-sub {
  font-size: 14px;
  color: #64748b;
  margin: -2px 0 22px !important;
  max-width: 620px;
}

/* ===== OPTIONS ===== */
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-top: 20px;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  background: #fff;
  border: 1.5px solid rgba(15, 23, 42, 0.1);
  border-radius: 16px;
  padding: 16px 18px;
  cursor: pointer;
  font-family: "Inter", sans-serif;
  text-align: left;
  transition: border-color 0.15s, background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.quiz-option:hover {
  border-color: rgba(79, 156, 249, 0.5);
  background: #f8fbff;
  box-shadow: 0 12px 28px rgba(79, 156, 249, 0.08);
  transform: translateX(4px);
}

.quiz-option.selected {
  border-color: #4f9cf9;
  background: linear-gradient(135deg, #eef6ff, #fbfdff);
  box-shadow: 0 0 0 3px rgba(79, 156, 249, 0.12), 0 18px 36px rgba(79, 156, 249, 0.08);
}

.quiz-opt-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #f8fbff, #eef4fb);
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05);
  color: #475569;
  font-size: 15px;
  transition: background 0.15s, color 0.15s;
}

.quiz-opt-icon i {
  line-height: 1;
}

.quiz-option:hover .quiz-opt-icon {
  background: #e0eeff;
  color: #043873;
}

.quiz-option.selected .quiz-opt-icon {
  background: #dbeafe;
  color: #043873;
}

.quiz-opt-text {
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.4;
}

/* ===== BUTTONS ===== */
.quiz-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #043873;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 14px 26px;
  font-size: 16px;
  font-weight: 700;
  font-family: "Inter", sans-serif;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  text-decoration: none;
}
.quiz-btn-primary:hover {
  background: #0d4fa0;
  transform: translateY(-1px);
}

.quiz-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  color: #0f172a;
  border: none;
  border-radius: 10px;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 600;
  font-family: "Inter", sans-serif;
  cursor: pointer;
  margin-top: 16px;
  transition: background 0.2s;
}
.quiz-btn-secondary:hover { background: #e2e8f0; }

/* ===== CALCULATING SCREEN ===== */
[data-screen="calculating"] {
  align-items: center;
  justify-content: center;
  text-align: center;
}

.quiz-calc-anim {
  position: relative;
  width: 80px;
  height: 80px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quiz-calc-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: #4f9cf9;
  border-right-color: #818cf8;
  animation: spin 1s linear infinite;
}

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

.quiz-calc-emoji {
  font-size: 26px;
  color: #043873;
  animation: pulse-emoji 1s ease-in-out infinite alternate;
}

@keyframes pulse-emoji {
  from { transform: scale(0.9); }
  to   { transform: scale(1.1); }
}

[data-screen="calculating"] h2 {
  align-self: center;
  text-align: center;
}

.quiz-calc-steps {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-self: stretch;
}

.quiz-calc-step {
  font-size: 14px;
  color: #cbd5e1;
  padding: 10px 16px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  transition: color 0.3s, background 0.3s, border-color 0.3s;
  display: flex;
  align-items: center;
  gap: 10px;
}

.quiz-calc-step::before {
  content: '○';
  font-size: 12px;
  flex-shrink: 0;
  color: #cbd5e1;
  transition: color 0.3s;
}

.quiz-calc-step.done {
  color: #0f172a;
  background: #f0f7ff;
  border-color: rgba(79, 156, 249, 0.2);
}

.quiz-calc-step.done::before {
  content: '✓';
  color: #4f9cf9;
}

.quiz-calc-step.active {
  color: #043873;
  background: #f0f7ff;
  border-color: rgba(79, 156, 249, 0.3);
}

.quiz-calc-step.active::before {
  content: '◉';
  color: #4f9cf9;
  animation: blink-dot 0.7s ease-in-out infinite alternate;
}

@keyframes blink-dot {
  from { opacity: 1; }
  to   { opacity: 0.3; }
}

/* ===== RESULT SCREEN ===== */
[data-screen="result"] {
  padding: 36px 52px 40px;
  overflow-y: auto;
}

.quiz-result-inner {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.quiz-result-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.quiz-result-emoji {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #e0eeff, #ede9ff);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #043873;
  font-size: 22px;
  animation: float 3s ease-in-out infinite;
  flex-shrink: 0;
}

.quiz-result-plan-badge {
  background: #043873;
  color: #fff;
  font-family: "Outfit", sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 5px 14px;
  border-radius: 999px;
}

[data-screen="result"] h2 {
  font-size: 26px;
  margin-bottom: 12px;
}

.quiz-result-body {
  font-size: 16px !important;
  color: #475569 !important;
  margin: 0 0 24px !important;
  line-height: 1.65 !important;
}

.quiz-result-why {
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 16px;
}

.quiz-result-why-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-bottom: 12px;
}

.quiz-result-why-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.quiz-result-why-list li {
  font-size: 14px;
  color: #334155;
  padding-left: 20px;
  position: relative;
  line-height: 1.5;
}

.quiz-result-why-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #4f9cf9;
  font-weight: 700;
  font-size: 12px;
}

.quiz-result-volume {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #64748b;
  padding: 12px 16px;
  background: #f0f7ff;
  border: 1px solid rgba(79, 156, 249, 0.18);
  border-radius: 10px;
  margin-bottom: 24px;
}

.quiz-result-volume i {
  color: #4f9cf9;
  flex-shrink: 0;
}

.quiz-result-volume strong {
  color: #0f172a;
}

.quiz-result-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.quiz-result-secondary {
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  text-decoration: none;
  border-bottom: 1px solid rgba(100, 116, 139, 0.3);
  padding-bottom: 1px;
}
.quiz-result-secondary:hover { color: #0f172a; border-color: #0f172a; }

.quiz-restart {
  background: none;
  border: none;
  font-size: 13px;
  color: #94a3b8;
  cursor: pointer;
  font-family: "Inter", sans-serif;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  transition: color 0.2s;
}
.quiz-restart:hover { color: #475569; }

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .quiz-overlay { padding: 0; align-items: flex-end; }
  .quiz-shell {
    max-width: 100%;
    height: 92vh;
    max-height: 92vh;
    min-height: unset;
    border-radius: 24px 24px 0 0;
    animation: quiz-slide-mobile 0.3s cubic-bezier(0.34, 1.1, 0.64, 1);
  }
  @keyframes quiz-slide-mobile {
    from { transform: translateY(40px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
  }
  .quiz-screen { padding: 28px 24px 24px; }
  [data-screen="result"] { padding: 24px 24px 28px; }
  .quiz-screen h2 { font-size: 23px; }
}
