/* Security Scorecard (js/scorecard.js): floating card, dark on both themes */
.sc {
  position: fixed;
  right: 24px;
  bottom: var(--sc-bottom, 24px);
  z-index: 95;
  width: 340px;
  max-width: calc(100vw - 24px);
  border-radius: 20px;
  background: #0B2546;
  border: 1px solid rgba(92, 156, 230, 0.35);
  box-shadow: 0 20px 50px rgba(7, 23, 44, 0.45);
  color: #FFFFFF;
  font-family: "Figtree", system-ui, sans-serif;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.sc.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.sc.is-visible.is-tucked {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

.sc-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px 12px 12px;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.sc-toggle-text {
  flex: 1;
  min-width: 0;
}

.sc-toggle-text strong {
  display: block;
  font-size: 15px;
}

.sc-progress {
  font-size: 12.5px;
  color: #94A3B8;
}

.sc-badge {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px dashed rgba(255, 255, 255, 0.3);
  font-family: "Fraunces", Georgia, serif;
  font-size: 24px;
  font-weight: 700;
  color: #94A3B8;
}

.sc-badge.is-a, .sc-badge.is-b { background: #059669; border: none; color: #FFFFFF; }
.sc-badge.is-c { background: #D97706; border: none; color: #FFFFFF; }
.sc-badge.is-d, .sc-badge.is-f { background: #DC2626; border: none; color: #FFFFFF; }

.sc-badge.is-pop {
  animation: sc-pop 0.5s ease;
}

.sc.is-pop {
  animation: sc-ring 1.6s ease 2;
}

@keyframes sc-ring {
  0% { box-shadow: 0 20px 50px rgba(7, 23, 44, 0.45), 0 0 0 0 rgba(230, 74, 25, 0.7); }
  70% { box-shadow: 0 20px 50px rgba(7, 23, 44, 0.45), 0 0 0 14px rgba(230, 74, 25, 0); }
  100% { box-shadow: 0 20px 50px rgba(7, 23, 44, 0.45), 0 0 0 0 rgba(230, 74, 25, 0); }
}

@keyframes sc-pop {
  0% { transform: scale(0.6); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.sc-chevron {
  width: 9px;
  height: 9px;
  border-right: 2px solid #94A3B8;
  border-bottom: 2px solid #94A3B8;
  transform: rotate(-135deg);
  margin-top: 4px;
  transition: transform 0.2s ease;
}

.sc.is-open .sc-chevron {
  transform: rotate(45deg);
  margin-top: -4px;
}

.sc-panel {
  display: none;
  padding: 2px 16px 16px;
}

.sc.is-open .sc-panel {
  display: block;
}

.sc-rows {
  margin: 0 0 12px;
  padding: 12px 0 0;
  list-style: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
}

.sc-row-name {
  font-size: 14px;
  color: #CBD5E1;
}

.sc-row.is-done .sc-row-name::before {
  content: "✓ ";
  color: #34D399;
  font-weight: 700;
}

.sc-chip {
  flex: none;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.sc-chip.is-todo {
  background: transparent;
  border-color: rgba(92, 156, 230, 0.6);
  color: #93C5FD;
}

.sc-chip.is-todo:hover {
  background: rgba(92, 156, 230, 0.15);
}

.sc-chip.is-a, .sc-chip.is-b { background: rgba(5, 150, 105, 0.2); color: #6EE7B7; }
.sc-chip.is-c { background: rgba(217, 119, 6, 0.2); color: #FCD34D; }
.sc-chip.is-d, .sc-chip.is-f { background: rgba(220, 38, 38, 0.2); color: #FCA5A5; }

.sc-note {
  margin: 0 0 12px;
  font-size: 13.5px;
  line-height: 1.5;
  color: #CBD5E1;
}

.sc-claim {
  width: 100%;
  min-height: 48px;
  padding: 10px 16px;
  border: none;
  border-radius: 999px;
  background: #E64A19;
  color: #FFFFFF;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(230, 74, 25, 0.35);
}

.sc-claim:hover {
  background: #D84315;
}

.sc-claim[hidden],
.sc-claim[hidden] + .sc-fine {
  display: none;
}

.sc-fine {
  margin: 8px 0 0;
  text-align: center;
  font-size: 12px;
  color: #64748B;
}

@media (max-width: 768px) {
  .sc {
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
    bottom: var(--sc-bottom-mobile, 12px);
  }
  .sc.is-open .sc-panel {
    max-height: 60vh;
    overflow-y: auto;
  }
  /* Keep the end of the page clear of the collapsed card */
  body.has-scorecard {
    padding-bottom: var(--sc-body-pad, 88px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sc, .sc-badge, .sc-chevron {
    animation: none !important;
    transition: none !important;
  }
}
