/* Door and window health check (health-check.html). Mobile-first. */

.hc-section { padding-top: 32px; }

@media (min-width: 768px) {
  .hc-section { padding-top: 48px; }
}

.hc-head { margin-bottom: 28px; }

.hc {
  max-width: 720px;
  background: var(--black-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  scroll-margin-top: 84px;
}

.hc [hidden] { display: none !important; }

.hc-label {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bay-light);
}

/* Top bar with progress */
.hc-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px 18px 0;
}

.hc-step-label { color: var(--gold); }
.hc[data-step="intro"] .hc-step-label,
.hc[data-step="results"] .hc-step-label { visibility: hidden; }

.hc-progress {
  flex-basis: 100%;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.hc-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--gold);
  transition: width 0.3s ease;
}

.hc-panel { padding: 22px 18px 26px; }

@media (min-width: 640px) {
  .hc-top { padding: 16px 28px 0; }
  .hc-panel { padding: 28px; }
}

/* Intro */
.hc-art {
  display: block;
  width: 100%;
  max-width: 320px;
  margin: 0 auto 22px;
  height: auto;
  stroke-linejoin: round;
}

.hc-art-ground { stroke: rgba(91, 125, 146, 0.35); stroke-width: 1; }
.hc-art-frame { fill: #121c28; stroke: rgba(201, 161, 90, 0.75); stroke-width: 1.5; }
.hc-art-glass { fill: rgba(91, 125, 146, 0.22); stroke: var(--bay-light); stroke-width: 1; }
.hc-art-glass.fog { fill: rgba(201, 201, 198, 0.28); }
.hc-art-sill { fill: #1a2533; stroke: rgba(201, 161, 90, 0.75); stroke-width: 1.5; }
.hc-art-panel { fill: none; stroke: rgba(201, 161, 90, 0.45); stroke-width: 1; }
.hc-art-knob { fill: var(--gold); }
.hc-art-rot { fill: rgba(217, 140, 140, 0.35); stroke: #d98c8c; stroke-width: 1; stroke-dasharray: 3 2; }
.hc-art-drop { fill: var(--bay-light); animation: hc-drip 2.4s ease-in infinite; }

.hc-art-scan {
  stroke: var(--gold);
  stroke-width: 1.5;
  opacity: 0.8;
  animation: hc-scan 3s ease-in-out infinite;
}

.hc-facts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 22px;
}

.hc-facts li {
  font-size: 0.82rem;
  color: var(--white);
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #101418;
}

/* Questions */
.hc-q-group {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}

.hc-q-title {
  font-size: 1.4rem;
  line-height: 1.25;
  margin-bottom: 10px;
}

.hc-q-title:focus { outline: none; }

.hc-q-hint {
  font-size: 0.88rem;
  margin-bottom: 4px;
}

.hc-options {
  display: grid;
  gap: 10px;
  margin: 18px 0 8px;
}

.hc-option {
  text-align: left;
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--white);
  background: #101418;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 15px 16px;
  min-height: 52px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.hc-option:hover { border-color: var(--bay-light); }

.hc-option.on {
  background: rgba(201, 161, 90, 0.14);
  border-color: var(--gold);
  color: var(--gold-light);
}

.hc-option:focus-visible,
.hc-back:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.hc-back {
  background: none;
  border: none;
  color: var(--white-dim);
  text-decoration: underline;
  font-family: var(--font-body);
  font-size: 0.88rem;
  padding: 10px 0;
  margin-top: 6px;
  cursor: pointer;
}

/* Analyzing */
.hc-analyze-steps {
  list-style: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  margin-top: 8px;
}

.hc-analyze-steps li {
  position: relative;
  padding: 11px 0 11px 28px;
  color: var(--white-dim);
  border-bottom: 1px solid var(--border);
}

.hc-analyze-steps li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border-radius: 50%;
  border: 2px solid var(--bay-light);
  border-top-color: transparent;
  animation: hc-spin 0.8s linear infinite;
}

.hc-analyze-steps li.done { color: var(--white); }

.hc-analyze-steps li.done::before {
  content: "\2713";
  border: none;
  animation: none;
  color: var(--gold);
  line-height: 14px;
  text-align: center;
}

/* Results */
.hc {
  --lvl: var(--gold);
}

.hc[data-level="0"] { --lvl: #7fb58f; }
.hc[data-level="1"] { --lvl: var(--bay-light); }
.hc[data-level="2"] { --lvl: var(--gold); }
.hc[data-level="3"] { --lvl: #d98c8c; }

.hc-score-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
}

.hc-score-ring {
  position: relative;
  width: 104px;
  height: 104px;
  flex-shrink: 0;
}

.hc-score-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.hc-ring-track { fill: none; stroke: var(--border); stroke-width: 8; }

.hc-ring-fill {
  fill: none;
  stroke: var(--lvl);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.hc-score-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  padding-top: 36px;
  font-family: var(--font-head);
  font-size: 1.9rem;
  font-weight: 600;
  color: var(--white);
}

.hc-score-num small {
  font-family: var(--font-body);
  font-size: 0.7rem;
  color: var(--white-dim);
  margin-left: 2px;
}

.hc-score-row .hc-label {
  display: block;
  line-height: 1.5;
}

.hc-headline {
  font-size: 1.35rem;
  line-height: 1.2;
  margin-top: 6px;
}

.hc-summary { font-size: 0.95rem; margin-bottom: 18px; }

.hc-groups {
  display: grid;
  gap: 10px;
  margin-bottom: 26px;
}

@media (min-width: 560px) {
  .hc-groups { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}

.hc-group {
  --g: var(--gold);
  background: #0f1215;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
}

.hc-group.lvl-0, .hc-finding.lvl-0 { --g: #7fb58f; }
.hc-group.lvl-1, .hc-finding.lvl-1 { --g: var(--bay-light); }
.hc-group.lvl-2, .hc-finding.lvl-2 { --g: var(--gold); }
.hc-group.lvl-3, .hc-finding.lvl-3 { --g: #d98c8c; }

.hc-group-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.hc-group-name { font-weight: 600; color: var(--white); }
.hc-group-status { color: var(--g); font-weight: 500; text-align: right; }

.hc-group-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.hc-group-bar span {
  display: block;
  height: 100%;
  background: var(--g);
  border-radius: 3px;
}

.hc-subhead {
  font-size: 1.15rem;
  margin-bottom: 12px;
}

.hc-findings {
  display: grid;
  gap: 12px;
  margin-bottom: 26px;
}

.hc-finding {
  --g: var(--gold);
  background: #0f1215;
  border: 1px solid var(--border);
  border-left: 3px solid var(--g);
  border-radius: 6px;
  padding: 16px;
}

.hc-finding-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.hc-tag {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--g);
}

.hc-finding-group { font-size: 0.78rem; color: var(--white-dim); }

.hc-finding h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.hc-finding p {
  font-size: 0.9rem;
  margin-top: 6px;
}

.hc-finding strong { color: var(--white); font-weight: 600; }

.hc-callout {
  border-left: 2px solid var(--gold);
  padding: 2px 0 2px 16px;
  margin-bottom: 24px;
}

.hc-callout h3 {
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.hc-callout p { font-size: 0.92rem; }

.hc-chain {
  list-style: none;
  counter-reset: hc;
  display: grid;
  gap: 8px;
  margin: 4px 0 14px;
}

.hc-chain li {
  counter-increment: hc;
  position: relative;
  padding: 10px 12px 10px 44px;
  background: #0f1215;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--white);
}

.hc-chain li::before {
  content: counter(hc);
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  color: var(--black);
  background: var(--gold);
}

/* Later steps in the chain read as more serious */
.hc-chain li:nth-child(4)::before { background: #e0a878; }
.hc-chain li:nth-child(5)::before { background: #d98c8c; }

@media (min-width: 900px) {
  .hc-chain-wide {
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
  }

  .hc-chain-wide li {
    padding: 44px 14px 16px;
    min-height: 120px;
  }

  .hc-chain-wide li::before {
    top: 14px;
    left: 14px;
    transform: none;
  }
}

.hc-coastal {
  font-size: 0.9rem;
  color: var(--gold-light);
  margin-bottom: 18px;
}

.hc-disclaimer {
  font-size: 0.8rem;
  border-top: 1px dashed var(--border);
  padding-top: 14px;
  margin-bottom: 24px;
}

.hc-capture {
  background: #0f1215;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px 16px;
  margin-bottom: 20px;
}

@media (min-width: 640px) {
  .hc-capture { padding: 24px; }
}

.hc-capture h3 { margin-bottom: 6px; }
.hc-capture > p { font-size: 0.92rem; margin-bottom: 18px; }

.hc-lead-status {
  font-size: 0.82rem;
  margin-top: 12px;
}

.hc-lead-status.error { color: #d98c8c; }
.hc-lead-done h3 { color: var(--gold-light); }

.hc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hc-actions .btn { flex: 1 1 auto; }

.hc .btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Static sections below the tool */
.hc-compare {
  display: grid;
  gap: 16px;
}

@media (min-width: 768px) {
  .hc-compare { grid-template-columns: 1fr 1fr; }
}

.hc-compare-col {
  background: var(--black);
  border: 1px solid var(--border);
  border-top: 3px solid #7fb58f;
  border-radius: 6px;
  padding: 22px 20px;
}

.hc-compare-col.bad { border-top-color: #d98c8c; }

.hc-compare-col h3 {
  font-size: 1.15rem;
  margin-bottom: 12px;
}

.hc-compare-col ul {
  list-style: none;
}

.hc-compare-col li {
  position: relative;
  padding: 7px 0 7px 26px;
  color: var(--white-dim);
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.hc-compare-col li:last-child { border-bottom: none; }

.hc-compare-col li::before {
  position: absolute;
  left: 0;
  top: 7px;
  font-weight: 600;
}

.hc-compare-col.good li::before { content: "\2713"; color: #7fb58f; }
.hc-compare-col.bad li::before { content: "\00D7"; color: #d98c8c; font-size: 1.1rem; line-height: 1.4; }

.hc-wait-title {
  font-size: 1.2rem;
  margin: 28px 0 12px;
}

.hc-wait {
  list-style: none;
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

@media (min-width: 768px) {
  .hc-wait { grid-template-columns: 1fr 1fr; }
}

.hc-wait li {
  display: grid;
  gap: 4px;
  background: rgba(227, 154, 138, 0.06);
  border: 1px solid rgba(227, 154, 138, 0.3);
  border-radius: 6px;
  padding: 14px 16px;
  font-size: 0.92rem;
  color: var(--white-dim);
}

.hc-wait-amount {
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.2;
  color: #e39a8a;
}

.hc-cite {
  font-size: 0.9rem;
  max-width: 760px;
  margin-top: 8px;
}

.hc-cite a { color: var(--bay-light); text-decoration: underline; }

.hc-more { margin-top: 18px; }

@keyframes hc-spin { to { transform: rotate(360deg); } }

@keyframes hc-scan {
  0% { transform: translateY(0); opacity: 0; }
  15% { opacity: 0.8; }
  85% { opacity: 0.8; }
  100% { transform: translateY(128px); opacity: 0; }
}

@keyframes hc-drip {
  0%, 40% { transform: translateY(0); opacity: 0; }
  55% { opacity: 1; }
  100% { transform: translateY(6px); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hc-art-scan, .hc-art-drop, .hc-analyze-steps li::before { animation: none; }
  .hc-art-scan { display: none; }
  .hc-ring-fill, .hc-progress span { transition: none; }
}
