@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,wght@0,400;0,600;0,700;1,400&family=Source+Sans+3:wght@400;500;600;700&display=swap');
@import url('https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css');

:root {
  --sm-accent:   #5b5ef4;
  --sm-accent-2: #8b5cf6;
  --sm-ink:      #0d0f1a;
  --sm-ink-2:    #3d4154;
  --sm-ink-3:    #8a8da8;
  --sm-border:   #e8eaf2;
  --sm-surface:  #f7f8fd;
  --sm-white:    #ffffff;
  --sm-success:  #10b981;
  --sm-danger:   #f43f5e;
  --sm-radius:   10px;
  --sm-shadow:   0 2px 12px rgba(13,15,26,.07);
  --sm-shadow-lg:0 8px 32px rgba(91,94,244,.13);
}

.sm-survey, .sm-survey * { box-sizing: border-box; }

.sm-survey {
  font-family: 'Source Sans 3', sans-serif;
  max-width: 700px;
  margin: 0 auto 48px;
  border-radius: 20px;
  border: 1px solid var(--sm-border);
  box-shadow: 0 4px 40px rgba(91,94,244,.1);
  overflow: hidden;
  background: var(--sm-white);
}

/* ── Header ──────────────── */
.sm-survey-header {
  background: linear-gradient(135deg, var(--sm-accent) 0%, var(--sm-accent-2) 100%);
  padding: 34px 38px 30px;
  position: relative; overflow: hidden;
}
.sm-survey-header::before {
  content: ''; position: absolute; top: -40px; right: -40px;
  width: 160px; height: 160px; border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.sm-survey-header::after {
  content: ''; position: absolute; bottom: -60px; left: -20px;
  width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255,255,255,.05);
}
.sm-survey-header-inner { position: relative; z-index: 1; }
.sm-survey-title {
  margin: 0 0 8px; font-family: 'Source Serif 4', serif;
  font-size: 22px; font-weight: 800; color: #fff; line-height: 1.3;
}
.sm-survey-desc {
  margin: 0; color: rgba(255,255,255,.8); font-size: 14px; line-height: 1.6;
}
.sm-survey-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.25);
  color: #fff; font-size: 11.5px; font-weight: 600;
  padding: 4px 11px; border-radius: 20px; margin-bottom: 12px; backdrop-filter: blur(4px);
}
.sm-survey-badge i { font-size: 11px; }

/* ── Progress bar ─────────── */
.sm-progress-wrap { padding: 0 38px; background: var(--sm-surface); border-bottom: 1px solid var(--sm-border); }
.sm-progress-inner { display: flex; align-items: center; gap: 12px; padding: 14px 0; }
.sm-progress-text { font-size: 12px; font-weight: 600; color: var(--sm-ink-3); white-space: nowrap; }
.sm-progress-track { flex: 1; height: 6px; background: var(--sm-border); border-radius: 99px; overflow: hidden; }
.sm-progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--sm-accent), var(--sm-accent-2));
  border-radius: 99px; transition: width .4s ease;
}

/* ── Form body ────────────── */
.sm-survey-form { padding: 30px 38px; }

/* ── Question ─────────────── */
.sm-q {
  margin-bottom: 30px; padding-bottom: 30px;
  border-bottom: 1px solid var(--sm-border);
  animation: smFadeUp .3s ease both;
}
.sm-q:last-of-type { border-bottom: none; }

@keyframes smFadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sm-q-label {
  display: flex; align-items: flex-start; gap: 11px;
  font-size: 15px; font-weight: 600; color: var(--sm-ink); margin-bottom: 14px; line-height: 1.5;
}
.sm-q-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; min-width: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--sm-accent), var(--sm-accent-2));
  color: #fff; font-size: 12px; font-weight: 700; flex-shrink: 0; margin-top: 1px;
  box-shadow: 0 2px 8px rgba(91,94,244,.3);
}
.sm-required { color: var(--sm-danger); margin-left: 2px; }
.sm-q-input { padding-left: 39px; }

/* ── Radio & Checkbox ─────── */
.sm-choice-label {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px; margin-bottom: 8px; cursor: pointer;
  border: 1.5px solid var(--sm-border); border-radius: var(--sm-radius);
  transition: all .16s; font-size: 14px; color: var(--sm-ink-2);
  user-select: none; position: relative;
}
.sm-choice-label::before {
  content: ''; position: absolute; inset: 0; border-radius: var(--sm-radius);
  background: transparent; transition: background .16s;
}
.sm-choice-label:hover { border-color: #b2b4fc; background: #fafaff; }
.sm-choice-label input { accent-color: var(--sm-accent); width: 17px; height: 17px; flex-shrink: 0; position: relative; z-index: 1; }
.sm-choice-label span  { position: relative; z-index: 1; }
.sm-choice-label.sm-selected { border-color: var(--sm-accent); background: #eff0ff; color: #3730a3; font-weight: 500; }

/* ── Select ───────────────── */
.sm-sel {
  width: 100%; padding: 11px 42px 11px 14px;
  border: 1.5px solid var(--sm-border); border-radius: var(--sm-radius);
  font-family: 'Source Sans 3', sans-serif; font-size: 14px; color: var(--sm-ink);
  background: var(--sm-white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M0 0l6 8 6-8z' fill='%238a8da8'/%3E%3C/svg%3E") right 14px center no-repeat;
  appearance: none; cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.sm-sel:focus { outline: none; border-color: var(--sm-accent); box-shadow: 0 0 0 3px rgba(91,94,244,.11); }

/* ── Text inputs ──────────── */
.sm-txt-input, .sm-txt-area {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--sm-border); border-radius: var(--sm-radius);
  font-family: 'Source Sans 3', sans-serif; font-size: 14px; color: var(--sm-ink);
  transition: border-color .15s, box-shadow .15s; background: var(--sm-white);
}
.sm-txt-input:focus, .sm-txt-area:focus {
  outline: none; border-color: var(--sm-accent); box-shadow: 0 0 0 3px rgba(91,94,244,.11);
}
.sm-txt-area { resize: vertical; min-height: 100px; }

/* ── Rating ───────────────── */
.sm-rating { display: flex; gap: 6px; align-items: center; }
.sm-star {
  background: none; border: none; padding: 0; cursor: pointer; line-height: 1;
  transition: transform .1s; font-size: 0;
}
.sm-star i {
  font-size: 32px; color: #e2e4f0; transition: color .15s, transform .12s;
  display: block;
}
.sm-star:hover i, .sm-star.sm-active i { color: #f59e0b; }
.sm-star:hover { transform: scale(1.15); }
.sm-star.sm-active { transform: scale(1.08); }
.sm-rating-val {
  font-size: 13px; font-weight: 600; color: var(--sm-ink-3); margin-left: 10px;
}

/* ── Error states ─────────── */
.sm-q.sm-error .sm-q-label { color: var(--sm-danger); }
.sm-q.sm-error .sm-choice-label { border-color: #fca5b5; }
.sm-q.sm-error .sm-txt-input,
.sm-q.sm-error .sm-txt-area,
.sm-q.sm-error .sm-sel { border-color: #fca5b5; box-shadow: 0 0 0 3px rgba(244,63,94,.08); }

.sm-error-banner {
  display: flex; align-items: center; gap: 10px;
  background: #fff1f2; border: 1px solid #ffd1d8; border-radius: var(--sm-radius);
  padding: 12px 16px; margin-bottom: 18px;
  color: #881337; font-size: 14px; font-weight: 500;
}
.sm-error-banner i { font-size: 17px; color: var(--sm-danger); flex-shrink: 0; }

/* ── Submit ───────────────── */
.sm-submit-btn {
  width: 100%; padding: 15px 28px;
  background: linear-gradient(135deg, var(--sm-accent), var(--sm-accent-2));
  color: #fff; border: none; border-radius: 12px;
  font-family: 'Source Sans 3', sans-serif; font-size: 15.5px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 9px;
  transition: filter .18s, transform .12s, box-shadow .18s;
  box-shadow: 0 4px 20px rgba(91,94,244,.3);
}
.sm-submit-btn i { font-size: 18px; }
.sm-submit-btn:hover { filter: brightness(1.07); transform: translateY(-1px); box-shadow: 0 8px 28px rgba(91,94,244,.4); }
.sm-submit-btn:active { transform: scale(.99); }
.sm-submit-btn:disabled { opacity: .65; cursor: not-allowed; transform: none; }

/* ── Thank you / Success ───── */
.sm-survey.sm-done .sm-survey-form { display: none; }

.sm-success-state {
  padding: 70px 40px; text-align: center;
  animation: smFadeUp .4s ease;
}
.sm-success-icon {
  width: 80px; height: 80px; border-radius: 50%; margin: 0 auto 22px;
  background: linear-gradient(135deg, #d1fae5, #ecfdf5);
  display: flex; align-items: center; justify-content: center; font-size: 38px; color: var(--sm-success);
  box-shadow: 0 8px 24px rgba(16,185,129,.2);
  animation: smPop .4s cubic-bezier(.175,.885,.32,1.275) .1s both;
}
@keyframes smPop {
  from { transform: scale(.5); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.sm-success-state h3 { font-family: 'Source Serif 4', serif; font-size: 24px; font-weight: 800; color: var(--sm-ink); margin: 0 0 10px; }
.sm-success-state p  { color: var(--sm-ink-3); font-size: 15px; margin: 0; line-height: 1.6; }

/* ── Already answered ─────── */
.sm-thank-you {
  text-align: center; padding: 60px 40px; background: var(--sm-white);
}
.sm-ty-icon {
  width: 80px; height: 80px; border-radius: 50%; margin: 0 auto 20px;
  background: linear-gradient(135deg, #eff0ff, #f0ebff);
  display: flex; align-items: center; justify-content: center; font-size: 36px; color: var(--sm-accent);
}
.sm-thank-you h3 { font-family: 'Source Serif 4', serif; font-size: 22px; font-weight: 700; color: var(--sm-ink); margin: 0 0 8px; }
.sm-thank-you p  { color: var(--sm-ink-3); font-size: 14px; margin: 0; }

.sm-hidden { display: none !important; }
