/* =====================================================
   Electronics Self-Scan Quiz — Frontend Styles v1.2
   ===================================================== */

/* ── Overlay ─────────────────────────────────────────
   Hidden by default via display:none.
   JS adds .esq-open to show it as flex.
   ─────────────────────────────────────────────────── */
#esq-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(100, 116, 139, 0.6);
  z-index: 999999;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

#esq-overlay.esq-open {
  display: flex;
}

/* ── Modal ────────────────────────────────────────── */
.esq-modal {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.18);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: esqModalIn 0.22s cubic-bezier(0.4,0,0.2,1);
  scrollbar-width: thin;
  scrollbar-color: #e5e7eb transparent;
}

@keyframes esqModalIn {
  from { opacity:0; transform:scale(0.95) translateY(8px); }
  to   { opacity:1; transform:scale(1) translateY(0); }
}

/* ── Modal Header ─────────────────────────────────── */
.esq-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
}

.esq-modal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.esq-modal-brand-icon {
  width: 40px;
  height: 40px;
  background: #EFF6FF;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.esq-modal-brand-title {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  line-height: 1.2;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  display: block;
}

.esq-modal-brand-step {
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: block;
  margin-top: 2px;
}

.esq-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  transition: background 0.15s, color 0.15s;
  padding: 0;
  flex-shrink: 0;
}
.esq-close:hover { background: #f3f4f6; color: #374151; }

/* ── Progress Bar ─────────────────────────────────── */
.esq-progress-bar { height: 3px; background: #e5e7eb; }
.esq-progress-fill {
  height: 100%;
  background: #2563EB;
  transition: width 0.4s ease;
  width: 0%;
}

/* ── Modal Body ───────────────────────────────────── */
.esq-modal-body { padding: 28px 28px 32px; }

/* ── Loading ──────────────────────────────────────── */
.esq-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 24px;
  gap: 16px;
  color: #6b7280;
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
}
.esq-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e5e7eb;
  border-top-color: #2563EB;
  border-radius: 50%;
  animation: esqSpin 0.7s linear infinite;
}
@keyframes esqSpin { to { transform: rotate(360deg); } }

/* ── Question Text ────────────────────────────────── */
.esq-question-text {
  font-size: 22px;
  font-weight: 800;
  color: #111827;
  line-height: 1.3;
  margin: 0 0 24px;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
}

/* ── Options ──────────────────────────────────────── */
.esq-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 32px;
}

.esq-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  cursor: pointer;
  background: #ffffff;
  transition: border-color 0.14s, background 0.14s;
  width: 100%;
  font-size: 15px;
  font-weight: 500;
  color: #374151;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  text-align: left;
  box-sizing: border-box;
}
.esq-option:hover { border-color: #2563EB; background: #F8FAFF; }
.esq-option.esq-selected { border-color: #2563EB; background: #EFF6FF; color: #1d4ed8; }

.esq-option-label { flex: 1; }

.esq-option-radio {
  width: 20px;
  height: 20px;
  border: 2px solid #d1d5db;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 12px;
  transition: border-color 0.14s, background 0.14s;
}
.esq-option.esq-selected .esq-option-radio {
  border-color: #2563EB;
  background: #2563EB;
}
.esq-option.esq-selected .esq-option-radio::after {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: white;
}

.esq-other-input {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 10px 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  color: #111827;
  font-family: inherit;
  box-sizing: border-box;
  outline: none;
}
.esq-other-input:focus { border-color: #2563EB; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }

/* ── Navigation ───────────────────────────────────── */
.esq-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.esq-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: #6b7280;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 10px 4px;
  font-family: inherit;
}
.esq-back-btn:hover { color: #374151; }

.esq-next-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  background: #1e293b;
  color: white;
  border: none;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.14s, transform 0.12s;
  white-space: nowrap;
}
.esq-next-btn:hover:not(:disabled) { background: #0f172a; transform: translateY(-1px); }
.esq-next-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Result ───────────────────────────────────────── */
.esq-result { animation: esqFadeUp 0.25s ease; }
@keyframes esqFadeUp {
  from { opacity:0; transform:translateY(8px); }
  to   { opacity:1; transform:translateY(0); }
}

.esq-result-card { border-radius: 12px; padding: 24px; margin-bottom: 20px; }
.esq-result-card-1 { background:#f0fdf4; border:1px solid #bbf7d0; }
.esq-result-card-2 { background:#fffbeb; border:1px solid #fde68a; }
.esq-result-card-3 { background:#f0fdf4; border:1px solid #bbf7d0; }

.esq-result-title {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.3;
  margin: 0 0 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
}
.esq-result-card-1 .esq-result-title,
.esq-result-card-3 .esq-result-title { color: #065f46; }
.esq-result-card-2 .esq-result-title { color: #92400e; }

.esq-result-desc { font-size:14px; line-height:1.65; margin:0; }
.esq-result-card-1 .esq-result-desc,
.esq-result-card-3 .esq-result-desc { color: #047857; }
.esq-result-card-2 .esq-result-desc { color: #78350f; }

.esq-email-block { border:1.5px solid #e5e7eb; border-radius:12px; padding:20px; margin-bottom:16px; }
.esq-email-block-label {
  display:flex; align-items:center; gap:8px;
  font-size:14px; font-weight:600; color:#374151; margin-bottom:14px;
}
.esq-email-row { display:flex; gap:8px; }
.esq-email-input {
  flex:1; padding:11px 14px; border:1.5px solid #e5e7eb; border-radius:8px;
  font-size:14px; font-family:inherit; color:#111827; min-width:0; outline:none;
}
.esq-email-input:focus { border-color:#2563EB; box-shadow:0 0 0 3px rgba(37,99,235,.1); }
.esq-email-input::placeholder { color:#9ca3af; }
.esq-email-submit {
  padding:11px 18px; background:#2563EB; color:white; border:none; border-radius:8px;
  font-size:14px; font-weight:600; cursor:pointer; font-family:inherit; white-space:nowrap;
  transition:background 0.14s;
}
.esq-email-submit:hover:not(:disabled) { background:#1d4ed8; }
.esq-email-submit:disabled { opacity:0.6; cursor:not-allowed; }

.esq-email-success {
  display:flex; align-items:center; gap:10px; padding:12px 16px;
  background:#f0fdf4; border:1.5px solid #bbf7d0; border-radius:8px;
  color:#166534; font-size:14px; font-weight:500;
}

.esq-quickscan-block { background:#1e293b; border-radius:12px; padding:24px; margin-bottom:20px; }
.esq-quickscan-title { font-size:17px; font-weight:700; color:#fff; margin:0 0 8px; font-family:-apple-system,BlinkMacSystemFont,"Inter","Segoe UI",sans-serif; }
.esq-quickscan-desc  { font-size:13px; color:#94a3b8; margin:0 0 18px; line-height:1.5; }
.esq-quickscan-btn {
  display:inline-flex; align-items:center; gap:8px; padding:11px 20px;
  background:white; color:#111827; border:none; border-radius:8px;
  font-size:14px; font-weight:600; cursor:pointer; font-family:inherit;
  text-decoration:none; transition:background 0.14s;
}
.esq-quickscan-btn:hover { background:#f3f4f6; color:#111827; text-decoration:none; }

.esq-restart-row { display:flex; justify-content:center; padding-top:8px; }
.esq-restart-btn { background:none; border:none; color:#9ca3af; font-size:13px; cursor:pointer; font-family:inherit; }
.esq-restart-btn:hover { color:#6b7280; }

/* ── Step animation ───────────────────────────────── */
.esq-step-enter { animation: esqSlideIn 0.2s ease; }
@keyframes esqSlideIn {
  from { opacity:0; transform:translateX(10px); }
  to   { opacity:1; transform:translateX(0); }
}

/* ── Elementor widget ─────────────────────────────── */
.esq-elementor-btn-wrap { line-height:1; }
.esq-elementor-btn { display:inline-flex; align-items:center; gap:8px; cursor:pointer; font-family:inherit; }

/* ── Mobile ───────────────────────────────────────── */
@media (max-width:540px) {
  .esq-modal-header { padding:16px 18px 12px; }
  .esq-modal-body   { padding:20px 18px 28px; }
  .esq-question-text { font-size:19px; }
  .esq-email-row { flex-direction:column; }
  .esq-email-submit { width:100%; }
  .esq-next-btn { flex:1; justify-content:center; }
}
