/* health-check.css — Website Health Check tool.
   Deliberately separate from marketing_style.css, matching how
   cookie-banner.css already sits apart from the shared stylesheet —
   these classes exist nowhere else in the app. Reuses the existing
   --primary-color / --muted-text / --border-stroke variables and the
   existing .btn / .form-control / .bento-card / .shadow-sm / .rounded-4
   classes rather than redefining button or card styling from scratch. */

.health-check-form-card {
    background-color: var(--main-bg);
    border: 1px solid var(--border-stroke);
    border-radius: 1rem; /* matches .rounded-4 */
    padding: 2rem;
}

#health-check-results {
    margin-top: 2.5rem;
    /* base.html's nav is `sticky-top` — without this, scrollIntoView()
       in health-check.js lands the results heading right at the very
       top of the viewport, exactly where the sticky nav sits, hiding
       it. Approximate value (nav height wasn't measured directly) —
       nudge up or down if it's not quite clearing the nav in practice. */
    scroll-margin-top: 6rem;
}

.health-check-input-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.health-check-input-row .form-control {
    flex: 1 1 320px;
}

.health-check-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: health-check-spin 0.7s linear infinite;
    margin-right: 0.5rem;
    vertical-align: -2px;
}

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

.health-check-error {
    background-color: #fdecea;
    border: 1px solid #f5c6c3;
    color: #7a2e27;
    border-radius: var(--sharp-radius);
    padding: 1rem 1.25rem;
    margin-top: 1.5rem;
}

.health-check-summary {
    background-color: var(--alt-bg);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--main-text);
}

.health-check-category {
    margin-top: 2rem;
}

.health-check-category-heading {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-stroke);
}

.health-check-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-stroke);
}

.health-check-row:last-child {
    border-bottom: none;
}

.health-check-badge {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    margin-top: 0.1rem;
}

.health-check-badge--pass {
    background-color: #2e7d4f; /* deliberately not the pure #28a745 already
        used for .text-success elsewhere — a badge fill needs slightly
        more contrast against white text than a text color does */
}

.health-check-badge--fail {
    background-color: #b3413a;
}

.health-check-badge--warn {
    background-color: #b8862e;
}

.health-check-badge--unable_to_check {
    background-color: var(--muted-text);
}

.health-check-row-label {
    font-weight: 600;
    color: var(--main-text);
    font-size: 0.95rem;
}

.health-check-row-reason {
    color: var(--muted-text);
    font-size: 0.9rem;
    margin-top: 0.15rem;
    line-height: 1.5;
}

.health-check-row--fail .health-check-row-label {
    color: var(--primary-color);
}

/* Two-section structure — added 13 July 2026 so an engineer, an SEO
   specialist, and a recruiter can each find what serves them: a plain-
   English overview up top, and the full technical detail underneath as
   the "receipts" backing it up. Visually distinct on purpose — the
   overview should feel like a friendly summary, the technical section
   like a structured report. */

.health-check-overview-section {
    margin-bottom: 2.5rem;
}

.health-check-technical-section {
    border-top: 1px solid var(--border-stroke);
    padding-top: 2rem;
}

.health-check-section-heading {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.health-check-section-subtext {
    color: var(--muted-text);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

/* Loading skeleton — added 22 July 2026, in response to a real CLS
   finding (Microsoft Clarity: 0.44 CLS, "poor", on this exact page).
   Before this, #health-check-results went straight from `display:none`
   (zero layout impact) to the full built report in one paint once the
   fetch resolved — the textbook cause of a bad CLS score, and one that
   Chrome's ~500ms post-interaction exemption window doesn't cover,
   since a real health check often takes several seconds. Sized against
   the real report's own class dimensions below (.health-check-section-
   heading, .health-check-category-heading, .health-check-row), so the
   eventual swap to real content is a smaller jump than starting from
   nothing — not a perfect match (a dual-URL submission, or an
   unusually long AI summary, will still differ somewhat from these
   fixed heights), but meaningfully closer than zero either way. */

.health-check-skeleton-bar {
    background: linear-gradient(90deg, var(--border-stroke) 25%, var(--alt-bg) 50%, var(--border-stroke) 75%);
    background-size: 200% 100%;
    animation: health-check-skeleton-pulse 1.4s ease-in-out infinite;
    border-radius: 6px;
}

@keyframes health-check-skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.health-check-skeleton-heading {
    /* Approximates .health-check-section-heading (1.4rem font-weight
       700 + 0.25rem margin-bottom) */
    height: 2.25rem;
    width: 55%;
    margin-bottom: 1rem;
}

.health-check-skeleton-summary {
    /* Approximates .health-check-summary — a padded box holding a real
       multi-sentence AI-written paragraph */
    height: 8rem;
    width: 100%;
    margin-bottom: 2.5rem;
}

.health-check-skeleton-section {
    margin-top: 2rem;
}

.health-check-skeleton-section-heading {
    /* Approximates .health-check-category-heading */
    height: 1.5rem;
    width: 40%;
    margin-bottom: 1rem;
}

.health-check-skeleton-row {
    /* Approximates .health-check-row — badge + label + 1-2 lines of
       reason text + padding */
    height: 3rem;
    width: 100%;
    margin-bottom: 0.75rem;
}

/* TICKET-148: dual-URL results — Homepage and Job Ad each get their own
   fully self-contained section (own Summary + own Full Technical
   Report). Only ever present in the DOM when a job ad URL was actually
   submitted; the single-URL case is completely unaffected — these
   classes simply don't exist in that markup at all. */

.health-check-pipeline-section + .health-check-pipeline-section {
    margin-top: 3rem;
    padding-top: 3rem;
    border-top: 2px solid var(--border-stroke);
}

.health-check-pipeline-heading {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--main-text);
    margin-bottom: 1.5rem;
}

.health-check-report-header {
    margin-bottom: 1rem;
}

.health-check-checked-url {
    color: var(--muted-text);
    overflow-wrap: anywhere;
    margin-bottom: 0;
}

.health-check-counters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 1.25rem 0 2rem;
}

.health-check-counter {
    background-color: var(--alt-bg);
    border-radius: 0.75rem;
    padding: 1rem;
}

.health-check-counter strong,
.health-check-counter span {
    display: block;
}

.health-check-counter strong {
    font-size: 1.5rem;
    line-height: 1;
    margin-bottom: 0.35rem;
}

.health-check-counter span {
    color: var(--muted-text);
    font-size: 0.85rem;
}

.health-check-technical-section summary {
    cursor: pointer;
    padding: 0.25rem 0 0.75rem;
}

.health-check-technical-section summary .health-check-section-heading {
    display: inline;
    margin-left: 0.4rem;
}

.health-check-cta {
    background-color: var(--alt-bg);
    border: 1px solid var(--border-stroke);
    border-radius: 1rem;
    padding: 2rem;
    margin-top: 2.5rem;
    text-align: center;
}

.health-check-cta h2 {
    font-size: 1.45rem;
}

.health-check-cta p {
    color: var(--muted-text);
    max-width: 38rem;
    margin: 0.75rem auto 1.25rem;
}

.health-check-stats-card {
    background-color: var(--main-bg);
    border: 1px solid var(--border-stroke);
    border-radius: 1rem;
    padding: 2rem;
    margin-top: 3rem;
}

.health-check-stats-heading {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

.health-check-stats-usage {
    color: var(--muted-text);
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
}

.health-check-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: 1rem;
}

.health-check-stat-group {
    background-color: var(--alt-bg);
    border-radius: 0.75rem;
    padding: 1.25rem;
}

.health-check-stat-group h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.health-check-stat-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.health-check-stat-list li {
    display: grid;
    grid-template-columns: 3rem 1fr;
    gap: 0.6rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-stroke);
}

.health-check-stat-list li:last-child {
    border-bottom: 0;
}

.health-check-stats-waiting {
    color: var(--muted-text);
}

@media (max-width: 575.98px) {
    .health-check-form-card,
    .health-check-stats-card,
    .health-check-cta {
        padding: 1.25rem;
    }

    .health-check-counters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .health-check-stat-list li {
        grid-template-columns: 2.75rem 1fr;
    }

    .health-check-cta .btn {
        width: 100%;
        white-space: normal;
    }
}
