/* ============================================================
   Backlink Health Snapshot — /tools/backlink-health-snapshot/
   A1 — Wave 1 flagship tool.

   Extends redirect-checker.css (shared tools base).
   Design tokens inherited from /static/landing/styles.css.
   All corners use clip-path — NEVER border-radius.
   ============================================================ */

/* ----------------------------------------------------------------
   Hero badge
---------------------------------------------------------------- */

.bhs-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--neon-cyan);
    letter-spacing: .05em;
    text-transform: uppercase;
    padding: 5px 10px;
    background: rgba(0, 245, 212, 0.07);
    border: 1px solid rgba(0, 245, 212, 0.25);
    clip-path: var(--clip-badge);
    margin-bottom: 16px;
}

.bhs-hero-badge svg {
    stroke: var(--neon-cyan);
    flex-shrink: 0;
}

/* ----------------------------------------------------------------
   Two-input form layout
---------------------------------------------------------------- */

.bhs-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 12px;
}

.bhs-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 768px) {
    .bhs-inputs {
        grid-template-columns: 1fr;
    }
}

.bhs-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bhs-label {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bhs-label-hint {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

.bhs-field input[type="url"] {
    width: 100%;
    padding: 13px 15px;
    font-family: var(--font-mono);
    font-size: 14px;
    background: rgba(13, 13, 20, 0.85);
    border: 1px solid rgba(0, 245, 212, 0.22);
    clip-path: var(--clip-badge);
    color: var(--text-primary);
    transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
}

.bhs-field input[type="url"]::placeholder {
    color: var(--text-muted);
}

.bhs-field input[type="url"]:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 0 3px rgba(0, 245, 212, 0.12);
}

.bhs-field input[type="url"].is-invalid {
    border-color: rgba(247, 37, 133, 0.6);
    box-shadow: 0 0 0 2px rgba(247, 37, 133, 0.1);
}

.field-error {
    font-family: var(--font-mono);
    font-size: 12px;
    color: #f07;
    margin: 2px 0 0;
}

.bhs-form-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.bhs-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    font-size: 15px;
}

.bhs-submit-btn svg {
    stroke: var(--bg-deep);
    flex-shrink: 0;
}

/* ----------------------------------------------------------------
   Output panel wrapper
---------------------------------------------------------------- */

.bhs-output {
    margin: 48px 0 56px;
    padding: 28px;
    background: rgba(13, 13, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    clip-path: var(--clip-card);
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* ----------------------------------------------------------------
   Verdict panel — HEALTHY / DEGRADED / LOST / UNVERIFIED
---------------------------------------------------------------- */

.bhs-verdict {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
    padding: 18px 22px;
    border: 1px solid;
    clip-path: var(--clip-button);
}

/* Status colors */
.bhs-verdict.verdict-healthy {
    background: rgba(0, 200, 81, 0.07);
    border-color: rgba(0, 200, 81, 0.4);
}

.bhs-verdict.verdict-degraded {
    background: rgba(255, 187, 51, 0.07);
    border-color: rgba(255, 187, 51, 0.4);
}

.bhs-verdict.verdict-lost {
    background: rgba(247, 37, 133, 0.07);
    border-color: rgba(247, 37, 133, 0.4);
}

.bhs-verdict.verdict-unverified {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.12);
}

/* Verdict label */
.bhs-verdict-label {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: .04em;
}

.verdict-healthy  .bhs-verdict-label { color: #4de08a; }
.verdict-degraded .bhs-verdict-label { color: #ffd365; }
.verdict-lost     .bhs-verdict-label { color: #f7608a; }
.verdict-unverified .bhs-verdict-label { color: var(--text-muted); }

/* Verdict score pill */
.bhs-verdict-score {
    font-family: var(--font-mono);
    font-size: 13px;
    padding: 4px 10px;
    clip-path: var(--clip-badge);
    font-weight: 600;
}

.verdict-healthy  .bhs-verdict-score { background: rgba(0, 200, 81, 0.15); color: #4de08a; }
.verdict-degraded .bhs-verdict-score { background: rgba(255, 187, 51, 0.15); color: #ffd365; }
.verdict-lost     .bhs-verdict-score { background: rgba(247, 37, 133, 0.15); color: #f7608a; }

/* Verdict message */
.bhs-verdict-msg {
    flex: 1 1 100%;
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* UNVERIFIED CTA inside verdict #}*/
.bhs-unverified-cta {
    margin-top: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.bhs-unverified-cta a {
    color: var(--neon-cyan);
    font-weight: 600;
}

/* ----------------------------------------------------------------
   Backlink match card
---------------------------------------------------------------- */

.bhs-link-card h2 {
    margin: 0 0 12px;
}

.bhs-matches {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bhs-match-item {
    padding: 14px 16px;
    background: rgba(20, 22, 30, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.07);
    clip-path: var(--clip-badge);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 16px;
    align-items: start;
}

.bhs-match-anchor {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--neon-cyan);
    font-weight: 600;
    grid-column: 1 / 2;
    word-break: break-all;
}

.bhs-match-rel-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    grid-column: 1 / 3;
}

.bhs-rel-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    padding: 3px 8px;
    clip-path: var(--clip-badge);
}

.bhs-rel-dofollow  { background: rgba(0, 200, 81, 0.15); color: #4de08a; }
.bhs-rel-nofollow  { background: rgba(255, 187, 51, 0.15); color: #ffd365; }
.bhs-rel-sponsored { background: rgba(247, 37, 133, 0.15); color: #f7608a; }
.bhs-rel-ugc       { background: rgba(76, 201, 240, 0.15); color: var(--neon-blue); }
.bhs-rel-position  { background: rgba(255, 255, 255, 0.05); color: var(--text-muted); }
.bhs-rel-external  { background: rgba(255, 255, 255, 0.05); color: var(--text-muted); }

.bhs-match-context {
    grid-column: 1 / 3;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-top: 4px;
}

.bhs-match-context em {
    font-style: normal;
    color: var(--text-primary);
    background: rgba(0, 245, 212, 0.08);
    padding: 0 2px;
}

/* No matches notice */
.bhs-no-matches {
    font-family: var(--font-mono);
    font-size: 13px;
    color: #f7608a;
    padding: 12px 16px;
    background: rgba(247, 37, 133, 0.06);
    border: 1px solid rgba(247, 37, 133, 0.2);
    clip-path: var(--clip-badge);
}

/* ----------------------------------------------------------------
   Issues list
---------------------------------------------------------------- */

.bhs-issues-heading {
    color: #f7608a;
}

.bhs-issues-list,
.bhs-recs-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bhs-issues-list li {
    padding: 10px 14px;
    background: rgba(247, 37, 133, 0.05);
    border-left: 3px solid rgba(247, 37, 133, 0.5);
    font-size: 14px;
    color: var(--text-secondary);
    clip-path: var(--clip-badge);
    line-height: 1.45;
}

.bhs-recs-list li {
    padding: 10px 14px;
    background: rgba(0, 245, 212, 0.04);
    border-left: 3px solid rgba(0, 245, 212, 0.4);
    font-size: 14px;
    color: var(--text-secondary);
    clip-path: var(--clip-badge);
    line-height: 1.45;
}

/* ----------------------------------------------------------------
   Two-column health summary grid
---------------------------------------------------------------- */

.bhs-health-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 640px) {
    .bhs-health-grid {
        grid-template-columns: 1fr;
    }
}

.bhs-health-card {
    padding: 16px;
    background: rgba(20, 22, 30, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.07);
    clip-path: var(--clip-badge);
}

.bhs-health-card .output-h2 {
    margin-bottom: 12px;
    font-size: 15px;
}

.bhs-dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 14px;
    margin: 0;
}

.bhs-dl dt {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    align-self: start;
    padding-top: 1px;
}

.bhs-dl dd {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-primary);
    margin: 0;
    word-break: break-all;
}

.bhs-dl dd.ok    { color: #4de08a; }
.bhs-dl dd.warn  { color: #ffd365; }
.bhs-dl dd.bad   { color: #f7608a; }
.bhs-dl dd.muted { color: var(--text-muted); }

/* Gate row (anonymous — hidden field) */
.bhs-dl .dd-gated {
    color: var(--text-muted);
    font-size: 12px;
}

.bhs-dl .dd-gated a {
    color: var(--neon-cyan);
}

/* ----------------------------------------------------------------
   AI summary block
---------------------------------------------------------------- */

.bhs-ai-block .output-h2 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bhs-ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--neon-cyan);
    padding: 3px 8px;
    background: rgba(0, 245, 212, 0.08);
    border: 1px solid rgba(0, 245, 212, 0.2);
    clip-path: var(--clip-badge);
    letter-spacing: .04em;
    font-weight: 600;
}

.bhs-ai-badge svg {
    stroke: var(--neon-cyan);
}

.bhs-ai-content {
    min-height: 56px;
}

.bhs-ai-content.loaded {
    font-size: 15px;
    color: var(--text-primary);
    background: rgba(0, 245, 212, 0.04);
    border-left: 3px solid var(--neon-cyan);
    padding: 12px 16px;
    line-height: 1.6;
}

/* Skeleton shimmer */
.bhs-skeleton {
    display: block;
    height: 14px;
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    background-size: 200% 100%;
    animation: bhs-shimmer 1.4s ease-in-out infinite;
    clip-path: var(--clip-badge);
    margin-bottom: 8px;
}

@keyframes bhs-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .bhs-skeleton {
        animation: none;
        background: rgba(255, 255, 255, 0.06);
    }
}

/* AI gate (anonymous — sign up prompt) */
.bhs-ai-gate {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    margin: 8px 0 0;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    clip-path: var(--clip-badge);
}

.bhs-ai-gate svg {
    stroke: var(--text-muted);
    flex-shrink: 0;
}

.bhs-ai-gate a {
    color: var(--neon-cyan);
    font-weight: 600;
}

/* ----------------------------------------------------------------
   Share / reset actions
---------------------------------------------------------------- */

.bhs-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ----------------------------------------------------------------
   Flagship CTA block
---------------------------------------------------------------- */

.bhs-cta .bhs-cta-content {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: start;
}

@media (max-width: 768px) {
    .bhs-cta .bhs-cta-content {
        grid-template-columns: 1fr;
    }
}

.bhs-cta h2 {
    margin-top: 0;
}

.bhs-cta-list {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bhs-cta-list li {
    font-size: 14px;
    color: var(--text-secondary);
    padding-left: 20px;
    position: relative;
}

.bhs-cta-list li::before {
    content: "–";
    position: absolute;
    left: 0;
    color: var(--neon-cyan);
    font-weight: 700;
}

.bhs-cta-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
    min-width: 260px;
}

@media (max-width: 768px) {
    .bhs-cta-actions {
        min-width: 0;
        flex-direction: row;
        flex-wrap: wrap;
    }
}

.bhs-cta-btn {
    white-space: nowrap;
    font-size: 14px;
    padding: 14px 20px;
}

/* ----------------------------------------------------------------
   Loading state on submit button
---------------------------------------------------------------- */

.bhs-submit-btn.is-loading {
    opacity: .75;
    cursor: not-allowed;
}

/* ----------------------------------------------------------------
   Fade-in animation for the output panel
---------------------------------------------------------------- */

.bhs-output.fade-in {
    animation: bhs-fadein .35s ease forwards;
}

@keyframes bhs-fadein {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    @keyframes bhs-fadein {
        from { opacity: 0; }
        to   { opacity: 1; }
    }
}
