/* CSM Shop Health Scorecard — scoped to .csm-health-wrap */

.csm-health-wrap {
  --csm-accent:      #3E8BFD;
  --csm-accent-dark: #1a6fd4;
  --csm-accent-bg:   #e8f1ff;
  --csm-text:        #1a1a2e;
  --csm-muted:       #6b7280;
  --csm-border:      #e5e7eb;
  --csm-bg:          #ffffff;
  --csm-radius:      12px;
  --csm-shadow:      0 4px 24px rgba(0,0,0,.08);

  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--csm-text);
  max-width: 640px;
  margin: 0 auto;
}

/* ── Progress bar ─────────────────────────────────────────── */

.csm-health-progress {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}

.csm-health-progress.csm-health-progress-visible {
  opacity: 1;
  pointer-events: auto;
}

.csm-health-progress-track {
  flex: 1;
  height: 6px;
  background: var(--csm-border);
  border-radius: 99px;
  overflow: hidden;
}

.csm-health-progress-fill {
  height: 100%;
  background: var(--csm-accent);
  border-radius: 99px;
  transition: width .35s ease;
  width: 0%;
}

.csm-health-progress-label {
  font-size: .75rem;
  color: var(--csm-muted);
  white-space: nowrap;
  min-width: 7rem;
  text-align: right;
}

/* ── Card base ────────────────────────────────────────────── */

.csm-health-card {
  display: none;
  background: var(--csm-bg);
  border: 1px solid var(--csm-border);
  border-radius: var(--csm-radius);
  padding: 2rem;
  box-shadow: var(--csm-shadow);
  animation: csmHealthFadeUp .28s ease both;
}

.csm-health-card.csm-health-active {
  display: block;
}

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

/* ── Intro card ───────────────────────────────────────────── */

.csm-health-intro-icon {
  color: var(--csm-accent);
  margin-bottom: 1.25rem;
}

.csm-health-intro-icon svg {
  width: 56px;
  height: 56px;
}

.csm-health-title {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 .6rem;
  color: var(--csm-text);
}

.csm-health-subtitle {
  font-size: 1rem;
  color: var(--csm-muted);
  margin: 0 0 1.5rem;
  line-height: 1.5;
}

.csm-health-intro-pills {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}

.csm-health-intro-pills li {
  display: flex;
  align-items: center;
  gap: .4rem;
  background: var(--csm-accent-bg);
  color: var(--csm-accent);
  font-size: .8rem;
  font-weight: 600;
  padding: .35rem .75rem;
  border-radius: 99px;
}

.csm-health-intro-pills li svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* ── Question card ────────────────────────────────────────── */

.csm-health-area-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--csm-accent);
  margin: 0 0 .6rem;
}

.csm-health-question {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 1.5rem;
  color: var(--csm-text);
}

/* Options */

.csm-health-options {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  margin-bottom: 1.75rem;
}

.csm-health-option {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .85rem 1rem;
  border: 2px solid var(--csm-border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
  user-select: none;
}

.csm-health-option:hover {
  border-color: var(--csm-accent);
  background: var(--csm-accent-bg);
}

.csm-health-option.csm-health-selected {
  border-color: var(--csm-accent);
  background: var(--csm-accent-bg);
  box-shadow: 0 0 0 1px var(--csm-accent);
}

.csm-health-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.csm-health-option-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--csm-border);
  flex-shrink: 0;
  margin-top: 1px;
  position: relative;
  transition: border-color .15s, background .15s;
  background: #fff;
}

.csm-health-option:hover .csm-health-option-dot {
  border-color: var(--csm-accent);
}

.csm-health-option.csm-health-selected .csm-health-option-dot {
  border-color: var(--csm-accent);
  background: var(--csm-accent);
}

.csm-health-option.csm-health-selected .csm-health-option-dot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
}

.csm-health-option-text {
  font-size: .9rem;
  color: var(--csm-text);
  line-height: 1.4;
}

.csm-health-option.csm-health-selected .csm-health-option-text {
  font-weight: 600;
}

/* Navigation */

.csm-health-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* ── Buttons ──────────────────────────────────────────────── */

.csm-health-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .75rem 1.4rem;
  background: var(--csm-accent);
  color: #fff;
  font-size: .9rem;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, transform .1s, opacity .15s;
  white-space: nowrap;
}

.csm-health-btn-primary:hover:not(:disabled) {
  background: var(--csm-accent-dark);
  transform: translateY(-1px);
}

.csm-health-btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.csm-health-btn-primary:disabled {
  opacity: .45;
  cursor: not-allowed;
}

/* Full-width start button on intro */
#csm-health-start {
  width: 100%;
  justify-content: center;
  padding: .9rem 1.4rem;
  font-size: 1rem;
}

.csm-health-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .65rem 1rem;
  background: transparent;
  color: var(--csm-muted);
  font-size: .85rem;
  font-weight: 600;
  border: 1px solid var(--csm-border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}

.csm-health-btn-ghost:hover {
  border-color: var(--csm-accent);
  color: var(--csm-accent);
}

.csm-health-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .7rem 1.25rem;
  background: transparent;
  color: var(--csm-accent);
  font-size: .875rem;
  font-weight: 700;
  border: 2px solid var(--csm-accent);
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, color .15s, opacity .15s;
}

.csm-health-btn-secondary:hover:not(:disabled) {
  background: var(--csm-accent);
  color: #fff;
}

.csm-health-btn-secondary:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.csm-health-center {
  display: block;
  margin: 0 auto;
}

/* ── Results card ─────────────────────────────────────────── */

/* Score gauge */

.csm-health-score-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

@media (max-width: 480px) {
  .csm-health-score-header {
    flex-direction: column;
    text-align: center;
  }
}

.csm-health-gauge-wrap {
  position: relative;
  flex-shrink: 0;
  width: 120px;
  height: 120px;
}

.csm-health-gauge {
  width: 120px;
  height: 120px;
}

.csm-health-gauge-bg {
  fill: none;
  stroke: var(--csm-border);
  stroke-width: 10;
}

.csm-health-gauge-fill {
  fill: none;
  stroke: var(--csm-accent);
  stroke-width: 10;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 60px 60px;
  stroke-dasharray: 314.16;
  stroke-dashoffset: 314.16;
  transition: stroke .3s;
}

.csm-health-gauge-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.csm-health-gauge-score {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--csm-text);
}

.csm-health-gauge-out {
  font-size: .75rem;
  color: var(--csm-muted);
  margin-top: .1rem;
}

.csm-health-grade-block {
  flex: 1;
}

.csm-health-grade-badge {
  display: inline-block;
  padding: .3rem .85rem;
  border-radius: 99px;
  background: var(--csm-accent);
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .6rem;
}

.csm-health-grade-desc {
  font-size: .9rem;
  color: var(--csm-muted);
  line-height: 1.5;
  margin: 0;
}

/* Section label */

.csm-health-section-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--csm-muted);
  margin: 0 0 .85rem;
}

/* Breakdown bars */

.csm-health-breakdown-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .65rem;
}

.csm-health-breakdown-item {
  display: grid;
  grid-template-columns: 9rem 1fr 5rem;
  align-items: center;
  gap: .6rem;
}

@media (max-width: 420px) {
  .csm-health-breakdown-item {
    grid-template-columns: 1fr 5rem;
    grid-template-rows: auto auto;
  }
  .csm-health-breakdown-label {
    grid-column: 1 / -1;
  }
}

.csm-health-breakdown-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--csm-text);
}

.csm-health-breakdown-bar-wrap {
  height: 8px;
  background: var(--csm-border);
  border-radius: 99px;
  overflow: hidden;
}

.csm-health-breakdown-bar {
  height: 100%;
  border-radius: 99px;
  transition: width .6s ease;
}

.csm-health-breakdown-val {
  font-size: .75rem;
  font-weight: 700;
  text-align: right;
}

/* Recommendations */

#csm-health-recs {
  margin-bottom: 1.5rem;
}

.csm-health-recs-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.csm-health-rec-item {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  font-size: .875rem;
  color: var(--csm-text);
  line-height: 1.4;
}

.csm-health-rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--csm-accent);
  flex-shrink: 0;
  margin-top: .35rem;
}

/* Email block */

.csm-health-email-block {
  background: #f8fafb;
  border: 1px solid var(--csm-border);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.csm-health-email-desc {
  font-size: .85rem;
  color: var(--csm-muted);
  margin: 0 0 1rem;
}

.csm-health-email-fields {
  display: flex;
  gap: .6rem;
  margin-bottom: .75rem;
}

@media (max-width: 480px) {
  .csm-health-email-fields {
    flex-direction: column;
  }
}

.csm-health-input {
  flex: 1;
  padding: .65rem .85rem;
  border: 1px solid var(--csm-border);
  border-radius: 8px;
  font-size: .875rem;
  color: var(--csm-text);
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.csm-health-input:focus {
  border-color: var(--csm-accent);
  box-shadow: 0 0 0 3px rgba(29,127,94,.15);
}

.csm-health-email-msg {
  margin: .5rem 0 0;
  font-size: .8rem;
  min-height: 1.2em;
}

.csm-health-msg-success { color: var(--csm-accent); }
.csm-health-msg-error   { color: #dc2626; }

/* CTA */

.csm-health-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  padding: .85rem 1.25rem;
  background: var(--csm-accent);
  color: #fff !important;
  font-size: .95rem;
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none !important;
  transition: background .15s, transform .1s;
  box-sizing: border-box;
  margin-bottom: .75rem;
}

.csm-health-cta:hover {
  background: var(--csm-accent-dark);
  transform: translateY(-1px);
}

.csm-health-cta:active {
  transform: translateY(0);
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 540px) {
  .csm-health-card {
    padding: 1.4rem;
  }
  .csm-health-title {
    font-size: 1.3rem;
  }
  .csm-health-question {
    font-size: 1.05rem;
  }
}
