/* ── Cyber Scorecard Plugin Styles ── */

.csc-wrap {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  max-width: 640px;
  margin: 2rem auto;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 2.5rem 2rem;
  color: #1e293b;
  box-sizing: border-box;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

/* Only constrain height + scroll internally when the widget is actually
   sitting inside a popup/modal box (JetPopup, Elementor Popup, and similar
   dialog wrappers). A plain in-page embed should just flow with the page
   and scroll normally, so this rule is scoped to known popup containers
   rather than applied to .csc-wrap everywhere. */
.jet-popup .csc-wrap,
.jet-popup-content .csc-wrap,
.jet-popup__content-wrap .csc-wrap,
.elementor-popup-modal .csc-wrap,
.dialog-widget-content .csc-wrap,
.dialog-lightbox-widget .csc-wrap {
  max-height: 85vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 0;
  margin-bottom: 0;
}

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

/* ── Header ── */
.csc-header { text-align: center; margin-bottom: 2rem; }
.csc-shield-icon { margin-bottom: 1rem; }
.csc-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.5rem;
  letter-spacing: 1px;
}
.csc-subtitle {
  font-size: 0.9rem;
  color: #64748b;
  margin: 0;
  line-height: 1.6;
}

/* ── Fields ── */
.csc-field {
  margin-bottom: 1.25rem;
}
.csc-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.csc-req { color: #0b8543; }

.csc-field input {
  width: 100%;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: #0f172a;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.csc-field input:focus { border-color: #0b8543; }
.csc-field input::placeholder { color: #94a3b8; }
.csc-field-err {
  font-size: 0.78rem;
  color: #dc2626;
  margin-top: 0.3rem;
  display: block;
  min-height: 1rem;
}

/* ── Buttons ── */
.csc-btn-primary {
  width: 100%;
  background: #0b8543;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.85rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  margin-top: 0.5rem;
}
.csc-btn-primary:hover { background: #086b36; }
.csc-btn-primary:active { transform: scale(0.98); }
.csc-btn-primary:disabled { background: #86efac; color: #f0fdf4; cursor: not-allowed; }

.csc-btn-ghost {
  background: transparent;
  color: #64748b;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.7rem 1.2rem;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.csc-btn-ghost:hover { border-color: #0b8543; color: #065f2f; }
.csc-btn-ghost:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── Progress ── */
.csc-progress-bar-wrap {
  background: #e2e8f0;
  border-radius: 999px;
  height: 4px;
  margin-bottom: 0.5rem;
  overflow: hidden;
}
.csc-progress-bar {
  height: 100%;
  background: #0b8543;
  border-radius: 999px;
  transition: width 0.35s ease;
  width: 0%;
}
.csc-progress-label {
  font-size: 0.78rem;
  color: #94a3b8;
  text-align: right;
  margin: 0 0 1.75rem;
}

/* ── Question card ── */
.csc-question-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.csc-q-number {
  font-size: 0.72rem;
  font-weight: 700;
  color: #0b8543;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.6rem;
}
.csc-q-text {
  font-size: 1rem;
  color: #1e293b;
  line-height: 1.55;
  margin: 0 0 1.25rem;
  font-weight: 500;
}

/* ── Answer options ── */
.csc-options { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.csc-option {
  flex: 1;
  min-width: 90px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
  color: #475569;
  font-size: 0.88rem;
  font-weight: 500;
  user-select: none;
}
.csc-option:hover { border-color: #0b8543; color: #065f2f; }
.csc-option.selected-yes  { background: #dcfce7; border-color: #0b8543; color: #065f2f; }
.csc-option.selected-somewhat { background: #fef9c3; border-color: #ca8a04; color: #854d0e; }
.csc-option.selected-no  { background: #fee2e2; border-color: #dc2626; color: #991b1b; }
.csc-option-score { font-size: 0.72rem; opacity: 0.65; margin-top: 3px; display: block; }

/* ── Nav ── */
.csc-nav { display: flex; gap: 0.75rem; margin-top: 0.5rem; }
.csc-nav .csc-btn-primary { width: auto; flex: 1; }
.csc-nav-hint { font-size: 0.78rem; color: #94a3b8; text-align: center; margin: 0.5rem 0 0; }

/* ── Results ── */
.csc-result-header { text-align: center; margin-bottom: 2rem; }
.csc-score-ring {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: #f8fafc;
  border: 3px solid #0b8543;
  border-radius: 50%;
  width: 100px;
  height: 100px;
  margin-bottom: 1.25rem;
}
.csc-score-ring.ring-moderate { border-color: #ca8a04; }
.csc-score-ring.ring-high     { border-color: #dc2626; }

.csc-score-num {
  font-size: 2.2rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
}
.csc-score-den {
  font-size: 0.9rem;
  color: #64748b;
  font-weight: 500;
}
.csc-result-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: #0f172a;
  letter-spacing: 1px;
}
.csc-result-title.strong   { color: #16a34a; }
.csc-result-title.moderate { color: #d97706; }
.csc-result-title.high     { color: #dc2626; }
.csc-result-desc { font-size: 0.88rem; color: #64748b; margin: 0; line-height: 1.6; }

/* ── Breakdown ── */
.csc-breakdown { margin-bottom: 1.75rem; }
.csc-breakdown-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.82rem;
}
.csc-breakdown-row:last-child { border-bottom: none; }
.csc-breakdown-label { flex: 1; color: #64748b; }
.csc-breakdown-pill {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}
.pill-yes      { background: #dcfce7; color: #065f2f; }
.pill-somewhat { background: #fef9c3; color: #854d0e; }
.pill-no       { background: #fee2e2; color: #991b1b; }

/* ── Legend ── */
.csc-risk-legend {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.csc-legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: #64748b; }
.csc-legend-dot  { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.csc-dot-strong   { background: #16a34a; }
.csc-dot-moderate { background: #d97706; }
.csc-dot-high     { background: #dc2626; }

.csc-retake { display: block; margin: 0 auto; }
.csc-mc-status {
  text-align: center;
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 0.75rem;
  min-height: 1rem;
}

@media (max-width: 480px) {
  .csc-wrap { padding: 1.5rem 1rem; }
  .csc-options { flex-direction: column; }
  .csc-nav { flex-direction: column; }
}

/* ── Intro step ── */
.csc-intro-meta {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}
.csc-intro-pill {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 0.8rem;
  color: #64748b;
}

/* ── Info gate step ── */
.csc-gate-header {
  text-align: center;
  margin-bottom: 1.75rem;
}
.csc-gate-icon {
  margin-bottom: 0.75rem;
}
.csc-gate-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.4rem;
}
.csc-gate-desc {
  font-size: 0.88rem;
  color: #64748b;
  margin: 0;
  line-height: 1.6;
}
.csc-btn-reveal {
  margin-top: 0.25rem;
  letter-spacing: 0.01em;
}
