/* WP Survey Master — Frontend CSS — Tema Claro */

:root {
  --wsp-bg:      #ffffff;
  --wsp-surface: #f8fafc;
  --wsp-border:  #e2e8f0;
  --wsp-text:    #1e293b;
  --wsp-muted:   #64748b;
  --wsp-accent:  #6366f1;
  --wsp-radius:  16px;
}

/* ── Base reset ──────────────────────────────────────────────────── */
.wsm-popup-overlay, .wsm-widget, .wsm-survey-embed,
.wsm-popup-overlay *, .wsm-widget *, .wsm-survey-embed * {
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ══════════════════════════════════════════════════════════════════
   POPUP
══════════════════════════════════════════════════════════════════ */
.wsm-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.45);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s;
}
.wsm-popup-overlay.wsm-open {
  opacity: 1;
  pointer-events: all;
}

.wsm-popup {
  background: var(--wsp-bg, #ffffff);
  border: 1px solid var(--wsp-border, #e2e8f0);
  border-radius: var(--wsp-radius);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  position: relative;
  box-shadow: 0 24px 80px rgba(15,23,42,.18);
  transform: translateY(30px) scale(.95);
  transition: transform .35s cubic-bezier(.34,1.56,.64,1);
}
.wsm-popup-overlay.wsm-open .wsm-popup {
  transform: translateY(0) scale(1);
}

.wsm-popup__close {
  position: absolute;
  top: 14px; right: 14px;
  background: #f1f5f9;
  border: none;
  color: #64748b;
  width: 30px; height: 30px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.wsm-popup__close:hover { background: #e2e8f0; color: #1e293b; }

.wsm-popup__header { margin-bottom: 20px; }
.wsm-popup__icon   { font-size: 36px; margin-bottom: 8px; }
.wsm-popup__header h2 { color: var(--wsp-text, #1e293b); font-size: 18px; font-weight: 700; margin: 0 0 6px; }
.wsm-popup__header p  { color: var(--wsp-muted, #64748b); font-size: 14px; margin: 0; }

/* ══════════════════════════════════════════════════════════════════
   WIDGET LATERAL
══════════════════════════════════════════════════════════════════ */
.wsm-widget {
  position: fixed;
  right: 0;
  bottom: 80px;
  z-index: 99998;
  display: flex;
  align-items: flex-end;
}

.wsm-widget__tab {
  background: linear-gradient(135deg, var(--wsp-accent, #6366f1), #8b5cf6);
  border: none;
  border-radius: 10px 0 0 10px;
  padding: 12px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: -4px 4px 16px rgba(99,102,241,.35);
  transition: transform .2s;
}
.wsm-widget__tab:hover { transform: translateX(-2px); }
.wsm-widget__tab-icon  { font-size: 20px; }
.wsm-widget__tab-label {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.wsm-widget__panel {
  background: var(--wsp-bg, #ffffff);
  border: 1px solid var(--wsp-border, #e2e8f0);
  border-right: none;
  border-radius: var(--wsp-radius) 0 0 var(--wsp-radius);
  width: 340px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 20px;
  box-shadow: -8px 0 40px rgba(15,23,42,.12);
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.34,1.2,.64,1);
}
.wsm-widget.wsm-open .wsm-widget__panel { transform: translateX(0); }

.wsm-widget__panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--wsp-border, #e2e8f0);
}
.wsm-widget__panel-header h3 { color: var(--wsp-text, #1e293b); font-size: 15px; font-weight: 600; margin: 0; }
.wsm-widget__close-btn {
  background: none; border: none;
  color: #94a3b8; cursor: pointer; font-size: 16px; padding: 2px 6px;
  border-radius: 4px; transition: background .15s;
}
.wsm-widget__close-btn:hover { background: #f1f5f9; color: #1e293b; }

/* ══════════════════════════════════════════════════════════════════
   EMBED / SHORTCODE
══════════════════════════════════════════════════════════════════ */
.wsm-survey-embed {
  background: var(--wsp-bg, #ffffff);
  border: 1px solid var(--wsp-border, #e2e8f0);
  border-radius: var(--wsp-radius);
  padding: 28px;
  margin: 24px 0;
  box-shadow: 0 4px 20px rgba(15,23,42,.08);
}
.wsm-embed__header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--wsp-border, #e2e8f0);
}
.wsm-embed__icon { font-size: 32px; }
.wsm-embed__header h2 { color: var(--wsp-text, #1e293b); font-size: 18px; font-weight: 700; margin: 0 0 4px; }
.wsm-embed__header p  { color: var(--wsp-muted, #64748b); font-size: 13px; margin: 0; }

/* ══════════════════════════════════════════════════════════════════
   FORM BODY — comum a todos os modos
══════════════════════════════════════════════════════════════════ */

/* Progress bar */
.wsm-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.wsm-progress__bar {
  flex: 1;
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}
.wsm-progress__bar::after {
  content: '';
  position: absolute;
  inset-block: 0; left: 0;
  width: var(--progress, 0%);
  background: linear-gradient(90deg, var(--wsp-accent, #6366f1), #8b5cf6);
  border-radius: 2px;
  transition: width .4s ease;
}
.wsm-progress__label { color: var(--wsp-muted, #64748b); font-size: 11px; white-space: nowrap; }

/* Question */
.wsm-question { margin-bottom: 22px; }
.wsm-question__label {
  display: block;
  color: var(--wsp-text, #1e293b);
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 12px;
  line-height: 1.5;
}
.wsm-required { color: #ef4444; margin-left: 3px; }

/* NPS */
.wsm-nps-scale {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.wsm-nps-btn {
  width: 42px; height: 42px;
  border-radius: 10px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.wsm-nps-btn:hover  { border-color: var(--wsp-accent, #6366f1); color: var(--wsp-accent, #6366f1); background: #eef2ff; transform: scale(1.08); }
.wsm-nps-btn.active {
  background: var(--wsp-accent, #6366f1);
  border-color: var(--wsp-accent, #6366f1);
  color: #fff;
  box-shadow: 0 4px 14px rgba(99,102,241,.3);
  transform: scale(1.1);
}
.wsm-nps-labels {
  display: flex;
  justify-content: space-between;
  color: var(--wsp-muted, #64748b);
  font-size: 11px;
  margin-top: 6px;
}

/* Stars */
.wsm-stars { display: flex; gap: 6px; justify-content: center; margin: 8px 0; }
.wsm-star {
  font-size: 28px;
  background: none; border: none;
  cursor: pointer;
  color: #cbd5e1;
  transition: all .15s;
  line-height: 1;
  padding: 2px;
}
.wsm-star.active, .wsm-star.hover { color: #f59e0b; transform: scale(1.2); }

/* CSAT */
.wsm-csat { display: flex; gap: 10px; flex-wrap: wrap; }
.wsm-csat-btn {
  font-size: 30px;
  background: none; border: none;
  cursor: pointer;
  filter: grayscale(100%) opacity(0.35);
  transition: all .2s;
  padding: 4px;
  border-radius: 8px;
  line-height: 1;
}
.wsm-csat-btn:hover  { filter: grayscale(0) opacity(1); transform: scale(1.15); }
.wsm-csat-btn.active { filter: grayscale(0) opacity(1); transform: scale(1.25); background: #f1f5f9; }

/* Likert */
.wsm-likert { display: flex; flex-direction: column; gap: 6px; }
.wsm-likert__opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  color: var(--wsp-text, #1e293b);
  font-size: 13px;
  transition: all .2s;
}
.wsm-likert__opt:hover { border-color: var(--wsp-accent, #6366f1); background: #eef2ff; }
.wsm-likert__opt input[type=radio] { accent-color: var(--wsp-accent, #6366f1); }
.wsm-likert__opt:has(input:checked) { border-color: var(--wsp-accent, #6366f1); background: #eef2ff; }

/* Radio / Checkbox options */
.wsm-options { display: flex; flex-direction: column; gap: 6px; }
.wsm-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  color: var(--wsp-text, #1e293b);
  font-size: 13px;
  transition: all .2s;
}
.wsm-option:hover { border-color: var(--wsp-accent, #6366f1); background: #eef2ff; }
.wsm-option input { accent-color: var(--wsp-accent, #6366f1); }
.wsm-option:has(input:checked) { border-color: var(--wsp-accent, #6366f1); background: #eef2ff; }

/* Select */
.wsm-select {
  width: 100%;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--wsp-text, #1e293b);
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.wsm-select:focus { border-color: var(--wsp-accent, #6366f1); box-shadow: 0 0 0 3px rgba(99,102,241,.1); }
.wsm-select option { background: #fff; }

/* Textarea */
.wsm-textarea {
  width: 100%;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--wsp-text, #1e293b);
  font-size: 14px;
  outline: none;
  resize: vertical;
  min-height: 80px;
  transition: border-color .2s;
  line-height: 1.5;
}
.wsm-textarea::placeholder { color: #94a3b8; }
.wsm-textarea:focus { border-color: var(--wsp-accent, #6366f1); box-shadow: 0 0 0 3px rgba(99,102,241,.1); }

/* Submit button */
.wsm-form__footer { margin-top: 24px; }
.wsm-submit-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--wsp-accent, #6366f1), #8b5cf6);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(99,102,241,.3);
  transition: all .25s;
}
.wsm-submit-btn:hover  { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(99,102,241,.4); }
.wsm-submit-btn:active { transform: translateY(0); }
.wsm-submit-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.wsm-privacy { color: #94a3b8; font-size: 11px; text-align: center; margin: 10px 0 0; }

/* Success screen */
.wsm-success {
  text-align: center;
  padding: 20px 0;
}
.wsm-success__icon { font-size: 56px; margin-bottom: 12px; animation: wsm-bounce .5s; }
.wsm-success h3 { color: var(--wsp-text, #1e293b); font-size: 18px; font-weight: 700; margin: 0 0 8px; }
.wsm-success p  { color: var(--wsp-muted, #64748b); font-size: 14px; margin: 0; }

@keyframes wsm-bounce {
  0%   { transform: scale(0); }
  60%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Error highlight */
.wsm-q-error .wsm-question__label { color: #ef4444 !important; }
.wsm-q-error .wsm-option,
.wsm-q-error .wsm-likert__opt,
.wsm-q-error .wsm-textarea,
.wsm-q-error .wsm-select { border-color: #fca5a5 !important; background: #fff1f2 !important; }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .wsm-popup { padding: 20px; }
  .wsm-nps-btn { width: 36px; height: 36px; font-size: 12px; }
  .wsm-widget__panel { width: 90vw; }
}

/* ── Print / PDF ─────────────────────────────────────────────────── */
@media print {
  .wsm-popup-overlay, .wsm-widget { display: none !important; }
}

/* ══════════════════════════════════════════════════════════════════
   WIZARD — uma pergunta por vez
══════════════════════════════════════════════════════════════════ */

/* Cabeçalho do wizard */
.wsm-wiz-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}
.wsm-wiz-counter {
  display: flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
  font-size: 13px;
  color: var(--wsp-muted, #64748b);
}
.wsm-wiz-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--wsp-accent, #6366f1);
  line-height: 1;
}
.wsm-wiz-total { font-weight: 600; color: var(--wsp-text, #1e293b); }
.wsm-wiz-bar {
  flex: 1;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}
.wsm-wiz-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--wsp-accent, #6366f1), #8b5cf6);
  border-radius: 3px;
  transition: width .45s cubic-bezier(.4,0,.2,1);
}

/* Steps */
.wsm-step {
  display: none;
  animation: wsm-step-in .25s ease both;
}
.wsm-step--active { display: block; }
.wsm-step--enter-right { animation: wsm-step-in .25s ease both; }
.wsm-step--exit-left   { animation: wsm-step-out .22s ease both; }

@keyframes wsm-step-in {
  from { opacity: 0; transform: translateX(32px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes wsm-step-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-32px); }
}

/* Shake on required error */
.wsm-step--error { animation: wsm-shake .4s ease; }
@keyframes wsm-shake {
  0%,100% { transform: translateX(0); }
  20%,60% { transform: translateX(-6px); }
  40%,80% { transform: translateX(6px); }
}

/* Step nav (Anterior / Próxima / Enviar) */
.wsm-step-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  gap: 10px;
}
.wsm-btn-prev {
  background: none;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all .2s;
}
.wsm-btn-prev:hover { border-color: var(--wsp-accent, #6366f1); color: var(--wsp-accent, #6366f1); }

.wsm-btn-next {
  flex: 1;
  padding: 13px 20px;
  background: linear-gradient(135deg, var(--wsp-accent, #6366f1), #8b5cf6);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s;
  box-shadow: 0 4px 14px rgba(99,102,241,.25);
}
.wsm-btn-next:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99,102,241,.35); }

.wsm-step-nav .wsm-submit-btn {
  flex: 1;
  width: auto;
}

/* privacy note */
.wsm-privacy { color: #94a3b8; font-size: 11px; text-align: center; margin: 12px 0 0; }


/* Separator between main question and comment textarea in same step */
.wsm-q-block + .wsm-q-block {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed #e2e8f0;
}

/* ── Identification screen ─────────────────────────────────────── */
.wsm-id-screen {
  padding: 24px 20px;
}
.wsm-id-screen__inner {
  text-align: center;
}
.wsm-id-icon {
  font-size: 40px;
  margin-bottom: 8px;
}
.wsm-id-title {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 6px;
}
.wsm-id-desc {
  font-size: 14px;
  color: #64748b;
  margin: 0 0 20px;
}
.wsm-id-error {
  color: #ef4444;
  font-size: 13px;
  margin-top: 8px;
}
.wsm-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 15px;
  outline: none;
  transition: border-color .2s;
}
.wsm-input:focus {
  border-color: #6366f1;
}
