/* =====================================================
   Electronics Self-Scan Quiz — Frontend v2.0.1
   ===================================================== */

#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; }

.esq-modal {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,.18);
  width: 100%;
  max-width: 580px;
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
  animation: esqModalIn .22s cubic-bezier(.4,0,.2,1);
  scrollbar-width: thin;
  scrollbar-color: #e5e7eb transparent;
}
@keyframes esqModalIn {
  from { opacity:0; transform:scale(.95) translateY(8px); }
  to   { opacity:1; transform:scale(1) translateY(0); }
}

/* ── 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; display:block; font-family:-apple-system,BlinkMacSystemFont,"Inter","Segoe UI",sans-serif; }
.esq-modal-brand-step  { font-size:11px; font-weight:600; color:#9ca3af; text-transform:uppercase; letter-spacing:.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; padding:0; flex-shrink:0; transition:background .15s,color .15s; }
.esq-close:hover { background:#f3f4f6; color:#374151; }

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

/* ── 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 .7s linear infinite; }
@keyframes esqSpin { to { transform:rotate(360deg); } }

/* ── Question ─────────────────────────────────────── */
.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: 14px 16px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  cursor: pointer;
  background: #ffffff;
  transition: border-color .14s, background .14s;
  width: 100%;
  font-size: 14px;
  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; color:#374151; }
.esq-option.esq-selected { border-color:#2563EB; background:#EFF6FF; color:#1d4ed8; }

.esq-option-label { flex:1; min-width:0; word-break:break-word; white-space:normal; line-height:1.45; padding-right:10px; }
.esq-option-radio { width:20px; height:20px; min-width:20px; border:2px solid #d1d5db; border-radius:50%; display:flex; align-items:center; justify-content:center; transition:border-color .14s,background .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); }

/* ── Nav ──────────────────────────────────────────── */
.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 .14s,transform .12s; white-space:nowrap; }
.esq-next-btn:hover:not(:disabled) { background:#0f172a; transform:translateY(-1px); }
.esq-next-btn:disabled { opacity:.4; cursor:not-allowed; }

/* ── Result card ──────────────────────────────────── */
.esq-result { animation:esqFadeUp .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; }

/* ── Contact form block ───────────────────────────── */
.esq-contact-block {
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.esq-contact-block-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 16px;
}

/* Two-column row */
.esq-form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}
.esq-form-col { flex: 1; min-width: 0; }

/* Field label */
.esq-field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 5px;
  letter-spacing: .01em;
}
.esq-required { color: #ef4444; }

/* Input / textarea */
.esq-field {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: #111827;
  box-sizing: border-box;
  outline: none;
  transition: border-color .14s, box-shadow .14s;
  background: #fff;
}
.esq-field:focus { border-color:#2563EB; box-shadow:0 0 0 3px rgba(37,99,235,.1); }
.esq-field::placeholder { color:#9ca3af; }

.esq-field-textarea {
  resize: vertical;
  min-height: 72px;
  line-height: 1.5;
  display: block;
  margin-bottom: 0;
}

/* Submit button */
.esq-form-submit-btn {
  width: 100%;
  padding: 13px 20px;
  background: #2563EB;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .14s, transform .12s;
  margin-top: 4px;
}
.esq-form-submit-btn:hover:not(:disabled) { background:#1d4ed8; transform:translateY(-1px); }
.esq-form-submit-btn:disabled { opacity:.6; cursor:not-allowed; }

/* Success state */
.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; }

/* ── Quickscan dark block ─────────────────────────── */
.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 .14s; }
.esq-quickscan-btn:hover:not(:disabled) { background:#f3f4f6; }
.esq-quickscan-btn:disabled { opacity:.7; cursor:not-allowed; }

/* ── Restart ──────────────────────────────────────── */
.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 .2s ease; }
@keyframes esqSlideIn { from{opacity:0;transform:translateX(10px);}to{opacity:1;transform:translateX(0);} }

/* ── Elementor button ─────────────────────────────── */
.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:560px) {
  .esq-modal-header { padding:16px 18px 12px; }
  .esq-modal-body   { padding:20px 18px 28px; }
  .esq-question-text { font-size:18px; }
  .esq-form-row { flex-direction:column; gap:0; }
  .esq-form-col { margin-bottom:12px; }
  .esq-next-btn { flex:1; justify-content:center; }
}
