/* MoDuet Hosting Health Check widget. Override the custom properties to match the host page. */
.mhc {
  --mhc-font: inherit;
  --mhc-text: #0f172a;
  --mhc-muted: #64748b;
  --mhc-bg: #ffffff;
  --mhc-surface: #f8fafc;
  --mhc-border: #e2e8f0;
  --mhc-primary: #2563eb;
  --mhc-primary-text: #ffffff;
  --mhc-pass: #15803d;
  --mhc-warn: #b45309;
  --mhc-fail: #b91c1c;
  --mhc-info: #475569;
  --mhc-excellent: #15803d;
  --mhc-good: #2563eb;
  --mhc-attention: #b45309;
  --mhc-risk: #b91c1c;
  --mhc-radius: 12px;
  font-family: var(--mhc-font);
  color: var(--mhc-text);
  line-height: 1.5;
  max-width: 860px;
  margin: 0 auto;
  box-sizing: border-box;
}
.mhc *, .mhc *::before, .mhc *::after { box-sizing: border-box; }
.mhc [hidden] { display: none !important; }

.mhc-h2 { font-size: 1.5rem; line-height: 1.25; margin: 0 0 .25rem; word-break: break-word; }
.mhc-h3 { font-size: 1.125rem; margin: 1.75rem 0 .5rem; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.mhc-muted { color: var(--mhc-muted); margin: .25rem 0; }
.mhc-eyebrow { text-transform: uppercase; letter-spacing: .06em; font-size: .75rem; color: var(--mhc-muted); margin: 0; font-weight: 600; }
.mhc-domain { color: var(--mhc-primary); }

/* form */
.mhc-form, .mhc-gate, .mhc-cta__form { display: grid; gap: .75rem; }
.mhc-form__row { display: flex; gap: .5rem; flex-wrap: wrap; }
.mhc-form__row > .mhc-input { flex: 1 1 220px; }
.mhc-input {
  font: inherit; font-size: 1rem; padding: .8rem 1rem; border: 1px solid var(--mhc-border); border-radius: 8px;
  background: var(--mhc-bg); color: var(--mhc-text); min-width: 0; width: 100%;
}
.mhc-input:focus { outline: 2px solid var(--mhc-primary); outline-offset: 1px; border-color: transparent; }
textarea.mhc-input { resize: vertical; }
.mhc-btn {
  font: inherit; font-weight: 600; padding: .8rem 1.25rem; border-radius: 8px; border: 1px solid var(--mhc-border);
  background: var(--mhc-bg); color: var(--mhc-text); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
.mhc-btn:hover { border-color: var(--mhc-primary); }
.mhc-btn:disabled { opacity: .6; cursor: progress; }
.mhc-btn--primary { background: var(--mhc-primary); color: var(--mhc-primary-text); border-color: var(--mhc-primary); }
.mhc-btn--primary:hover { filter: brightness(1.08); }
.mhc-btn--ghost { border-color: transparent; color: var(--mhc-primary); }
.mhc-error { color: var(--mhc-fail); margin: 0; font-weight: 500; }
.mhc-terms { font-size: .8125rem; color: var(--mhc-muted); margin: 0; }
.mhc-terms a { color: inherit; }
.mhc-notice { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; padding: .75rem 1rem; border-radius: 8px; margin: 0 0 1rem; }

/* progress */
.mhc-progress__bar { height: 10px; background: var(--mhc-border); border-radius: 999px; overflow: hidden; margin: 1rem 0; }
.mhc-progress__bar > span { display: block; height: 100%; width: 0; background: var(--mhc-primary); transition: width .6s ease; }
.mhc-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.mhc-step { display: flex; align-items: center; gap: .5rem; color: var(--mhc-muted); font-size: .9375rem; }
.mhc-step__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--mhc-border); flex: none; }
.mhc-step--running { color: var(--mhc-text); }
.mhc-step--running .mhc-step__dot { background: var(--mhc-primary); animation: mhc-pulse 1s infinite alternate; }
.mhc-step--done { color: var(--mhc-text); }
.mhc-step--done .mhc-step__dot { background: var(--mhc-pass); }
.mhc-step--unavailable .mhc-step__dot { background: var(--mhc-muted); }
@keyframes mhc-pulse { from { opacity: .3; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .mhc-step--running .mhc-step__dot { animation: none; } .mhc-progress__bar > span { transition: none; } }

/* score */
.mhc-score { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; margin-bottom: 1.25rem; }
.mhc-score__text { flex: 1 1 260px; min-width: 0; }
.mhc-score__headline { font-size: 1.125rem; font-weight: 700; margin: .25rem 0; }
.mhc-ring { position: relative; flex: none; }
.mhc-ring svg { display: block; }
.mhc-ring__track { fill: none; stroke: var(--mhc-border); stroke-width: 10; }
.mhc-ring__value { fill: none; stroke: currentColor; stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.mhc-ring__label { position: absolute; inset: 0; display: flex; align-items: baseline; justify-content: center; padding-top: 38%; }
.mhc-ring__score { font-size: 2.25rem; font-weight: 800; line-height: 1; color: var(--mhc-text); }
.mhc-ring__max { color: var(--mhc-muted); font-weight: 600; font-size: .8125rem; margin-left: 2px; }
.mhc-band--excellent { color: var(--mhc-excellent); }
.mhc-band--good { color: var(--mhc-good); }
.mhc-band--attention { color: var(--mhc-attention); }
.mhc-band--risk { color: var(--mhc-risk); }
.mhc-band--none { color: var(--mhc-muted); }
.mhc-band-text--excellent { color: var(--mhc-excellent); }
.mhc-band-text--good { color: var(--mhc-good); }
.mhc-band-text--attention { color: var(--mhc-attention); }
.mhc-band-text--risk { color: var(--mhc-risk); }

.mhc-cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; }
.mhc-cat { border: 1px solid var(--mhc-border); border-radius: var(--mhc-radius); padding: .875rem 1rem; background: var(--mhc-surface); display: flex; flex-direction: column; }
.mhc-cat__label { font-size: .8125rem; color: var(--mhc-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.mhc-cat__score { font-size: 1.75rem; font-weight: 800; }
.mhc-cat__note { font-size: .8125rem; color: var(--mhc-muted); }

/* findings */
.mhc-findings { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--mhc-border); }
.mhc-finding { display: flex; gap: .875rem; padding: 1rem 0; border-bottom: 1px solid var(--mhc-border); }
.mhc-finding__body { min-width: 0; flex: 1; }
.mhc-finding__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem; }
.mhc-finding__value { color: var(--mhc-muted); font-variant-numeric: tabular-nums; }
.mhc-finding p { margin: .25rem 0 0; }
.mhc-finding__why, .mhc-finding__fix { font-size: .9375rem; color: #334155; }
.mhc-icon {
  flex: none; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: .875rem; margin-top: 1px;
}
.mhc-icon--pass { background: var(--mhc-pass); }
.mhc-icon--warn { background: var(--mhc-warn); }
.mhc-icon--fail { background: var(--mhc-fail); }
.mhc-icon--info { background: var(--mhc-info); }
.mhc-icon--unavailable { background: #cbd5e1; color: #334155; }
.mhc-group__score { font-size: .9375rem; color: var(--mhc-muted); font-weight: 600; }
.mhc-locked { margin-top: .75rem; }

.mhc-gate, .mhc-cta, .mhc-panel { margin-top: 1.5rem; padding: 1.5rem; border: 1px solid var(--mhc-border); border-radius: var(--mhc-radius); background: var(--mhc-surface); }
.mhc-gate .mhc-h3, .mhc-cta .mhc-h3 { margin-top: 0; }
.mhc-cta { border-color: var(--mhc-primary); }
.mhc-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 .25rem; }
.mhc-panel--error { border-color: var(--mhc-fail); }

@media (max-width: 520px) {
  .mhc-score { gap: 1rem; }
  .mhc-h2 { font-size: 1.25rem; }
  .mhc-form__row > .mhc-btn { width: 100%; }
}

/* print / "Download PDF" */
@media print {
  body * { visibility: hidden; }
  .mhc, .mhc * { visibility: visible; }
  .mhc { position: absolute; left: 0; top: 0; width: 100%; max-width: none; }
  .mhc-noprint, .mhc-gate { display: none !important; }
  .mhc-finding { break-inside: avoid; }
  .mhc-icon, .mhc-ring__value, .mhc-cat { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .mhc-report--full::before { content: "MoDuet · Hosting Health Check Report"; display: block; font-weight: 700; font-size: 14px; margin-bottom: 12px; color: #2563eb; }
}
