/* Hub survey — clean / Linear-like */
.hub-survey-shell {
  --hs-bg: #f4f6f8;
  --hs-card: #ffffff;
  --hs-ink: #0f172a;
  --hs-muted: #64748b;
  --hs-line: #e8edf2;
  --hs-line-strong: #d7dee7;
  --hs-brand: #0d9488;
  --hs-brand-2: #14b8a6;
  --hs-brand-soft: rgba(13, 148, 136, 0.1);
  --hs-brand-glow: rgba(13, 148, 136, 0.28);
  --hs-warn-bg: #fffbeb;
  --hs-warn-ink: #92400e;
  --hs-warn-line: #fde68a;
  --hs-radius: 20px;
  --hs-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px -12px rgba(15, 23, 42, 0.12);
  font-family: Vazir, system-ui, sans-serif;
  direction: rtl;
  background:
    radial-gradient(1200px 400px at 100% 0%, rgba(20, 184, 166, 0.08), transparent 55%),
    radial-gradient(900px 320px at 0% 100%, rgba(15, 23, 42, 0.04), transparent 50%),
    var(--hs-bg);
  border: 1px solid var(--hs-line);
  border-radius: 24px;
  padding: clamp(1rem, 3vw, 1.75rem);
  margin-bottom: 1.5rem;
}

.hub-survey-card {
  width: 100%;
  max-width: none;
  margin: 0;
  background: var(--hs-card);
  border: 1px solid var(--hs-line);
  border-radius: var(--hs-radius);
  box-shadow: var(--hs-shadow);
  padding: clamp(1.25rem, 3.5vw, 2rem);
  animation: hubSurveyIn 0.45s ease both;
}

.hub-survey-card.is-collapsed {
  padding: 1rem 1.15rem;
}

.hub-survey-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.hub-survey-summary-main {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  min-width: 0;
  flex: 1;
}

.hub-survey-summary-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.hub-survey-summary h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--hs-ink);
}

.hub-survey-summary p {
  margin: 0.28rem 0 0;
  color: var(--hs-muted);
  font-size: 0.84rem;
  line-height: 1.6;
}

.hub-survey-edit-btn {
  appearance: none;
  border: 1px solid var(--hs-line-strong);
  background: #fff;
  color: var(--hs-ink);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  border-radius: 12px;
  padding: 0.65rem 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.hub-survey-edit-btn:hover {
  border-color: var(--hs-brand);
  background: var(--hs-brand-soft);
  color: var(--hs-brand);
}

.hub-survey-edit-btn:active {
  transform: scale(0.98);
}

.hub-survey-body {
  display: block;
}

.hub-survey-card.is-collapsed .hub-survey-body {
  display: none;
}

.hub-survey-card.is-collapsed .hub-survey-summary {
  display: flex;
}

.hub-survey-card:not(.is-collapsed) .hub-survey-summary {
  display: none;
}

.hub-survey-collapse-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--hs-muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.35rem 0.2rem;
  margin-bottom: 0.75rem;
}

.hub-survey-collapse-btn:hover {
  color: var(--hs-brand);
}

@keyframes hubSurveyIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.hub-survey-head {
  margin-bottom: 1.5rem;
}

.hub-survey-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--hs-brand);
  background: var(--hs-brand-soft);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  margin-bottom: 0.85rem;
}

.hub-survey-title {
  margin: 0;
  font-size: clamp(1.2rem, 2.6vw, 1.55rem);
  font-weight: 800;
  color: var(--hs-ink);
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.hub-survey-sub {
  margin: 0.55rem 0 0;
  color: var(--hs-muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

.hub-survey-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: var(--hs-warn-bg);
  border: 1px solid var(--hs-warn-line);
  color: var(--hs-warn-ink);
  font-size: 0.84rem;
  line-height: 1.7;
}

.hub-survey-notice svg {
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.hub-survey-progress {
  margin: 1.35rem 0 0.25rem;
}

.hub-survey-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
  font-size: 0.78rem;
  color: var(--hs-muted);
  font-weight: 600;
}

.hub-survey-progress-bar {
  height: 6px;
  border-radius: 999px;
  background: #eef2f6;
  overflow: hidden;
}

.hub-survey-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--hs-brand), var(--hs-brand-2));
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.hub-survey-steps {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.65rem;
}

.hub-survey-step-dot {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: #e8edf2;
  transition: background 0.25s ease, transform 0.25s ease;
}

.hub-survey-step-dot.is-done {
  background: var(--hs-brand);
}

.hub-survey-step-dot.is-current {
  background: var(--hs-brand-2);
  transform: scaleY(1.35);
}

.hub-survey-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.hub-survey-q {
  padding: 1.55rem 0;
  border-bottom: 1px solid var(--hs-line);
  animation: hubSurveyIn 0.4s ease both;
}

.hub-survey-q:nth-child(1) { animation-delay: 0.03s; }
.hub-survey-q:nth-child(2) { animation-delay: 0.06s; }
.hub-survey-q:nth-child(3) { animation-delay: 0.09s; }
.hub-survey-q:nth-child(4) { animation-delay: 0.12s; }
.hub-survey-q:nth-child(5) { animation-delay: 0.15s; border-bottom: 0; padding-bottom: 0.4rem; }

.hub-survey-q-head {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.hub-survey-q-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--hs-brand-soft);
  color: var(--hs-brand);
  border: 1px solid rgba(13, 148, 136, 0.12);
}

.hub-survey-q-meta {
  min-width: 0;
  flex: 1;
}

.hub-survey-q-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--hs-muted);
  margin-bottom: 0.28rem;
}

.hub-survey-q-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--hs-ink);
  line-height: 1.65;
}

.hub-survey-stars {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-inline-start: calc(42px + 0.85rem);
}

.hub-survey-star {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0.2rem;
  cursor: pointer;
  color: #cbd5e1;
  transition: color 0.18s ease, transform 0.18s ease;
  line-height: 0;
}

.hub-survey-star svg {
  width: 30px;
  height: 30px;
  display: block;
  filter: drop-shadow(0 0 0 transparent);
  transition: filter 0.18s ease;
}

.hub-survey-star:hover,
.hub-survey-star.is-active {
  color: #f59e0b;
  transform: translateY(-1px) scale(1.06);
}

.hub-survey-star.is-active svg {
  filter: drop-shadow(0 4px 8px rgba(245, 158, 11, 0.28));
}

.hub-survey-star:focus-visible {
  outline: 2px solid var(--hs-brand);
  outline-offset: 3px;
  border-radius: 8px;
}

.hub-survey-rating-hint {
  margin-inline-start: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--hs-muted);
  min-width: 3.5rem;
  transition: color 0.2s ease;
}

.hub-survey-rating-hint.is-set {
  color: var(--hs-brand);
}

.hub-survey-scale {
  display: flex;
  justify-content: space-between;
  margin: 0.55rem calc(42px + 0.85rem) 0 0;
  font-size: 0.7rem;
  color: #94a3b8;
  font-weight: 600;
}

.hub-survey-textarea-wrap {
  margin-inline-start: calc(42px + 0.85rem);
}

.hub-survey-textarea {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  border: 1px solid var(--hs-line-strong);
  border-radius: 14px;
  padding: 0.95rem 1rem;
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--hs-ink);
  background: #fbfcfd;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.hub-survey-textarea::placeholder {
  color: #94a3b8;
}

.hub-survey-textarea:hover {
  border-color: #c5ced9;
}

.hub-survey-textarea:focus {
  outline: none;
  background: #fff;
  border-color: var(--hs-brand);
  box-shadow: 0 0 0 4px var(--hs-brand-glow);
}

.hub-survey-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  margin-top: 1.5rem;
  padding-top: 0.25rem;
}

.hub-survey-submit {
  appearance: none;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 48px;
  padding: 0.85rem 1.45rem;
  border-radius: 14px;
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  background: linear-gradient(135deg, #0f766e 0%, #14b8a6 55%, #2dd4bf 100%);
  box-shadow: 0 10px 24px -10px rgba(13, 148, 136, 0.7);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.hub-survey-submit:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 14px 28px -10px rgba(13, 148, 136, 0.8);
}

.hub-survey-submit:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 6px 16px -8px rgba(13, 148, 136, 0.65);
}

.hub-survey-submit:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
  filter: none;
}

.hub-survey-msg {
  font-size: 0.84rem;
  color: #b45309;
  font-weight: 600;
}

.hub-survey-msg.is-ok {
  color: var(--hs-brand);
}

.hub-survey-done {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  width: 100%;
  margin: 0;
  background: var(--hs-card);
  border: 1px solid var(--hs-line);
  border-radius: var(--hs-radius);
  box-shadow: var(--hs-shadow);
  padding: 1.5rem;
  animation: hubSurveyIn 0.4s ease both;
}

.hub-survey-done-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.hub-survey-done h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--hs-ink);
}

.hub-survey-done p {
  margin: 0.4rem 0 0;
  color: var(--hs-muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

.hub-survey-loading {
  text-align: center;
  color: var(--hs-muted);
  font-size: 0.9rem;
  padding: 1.5rem 0;
}

@media (max-width: 640px) {
  .hub-survey-shell {
    padding: 0.85rem;
    border-radius: 18px;
  }

  .hub-survey-card {
    padding: 1.1rem;
    border-radius: 16px;
  }

  .hub-survey-stars,
  .hub-survey-scale,
  .hub-survey-textarea-wrap {
    margin-inline-start: 0;
  }

  .hub-survey-q-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }

  .hub-survey-star svg {
    width: 28px;
    height: 28px;
  }

  .hub-survey-summary {
    flex-direction: column;
    align-items: stretch;
  }

  .hub-survey-edit-btn {
    width: 100%;
    justify-content: center;
  }

  .hub-survey-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
