/* ============================================================
   Public Tools — shared styling for /tools/* utilities
   Used by:
     - app/templates/public_tools/redirect_checker.html
     - app/templates/public_tools/tools_hub.html
   Design tokens (--neon-cyan, --bg-deep, --font-display, etc.)
   are inherited from /static/landing/styles.css (loaded by
   public_base.html).
   ============================================================ */

/* ----------------------------------------------------------------
   Page shell
---------------------------------------------------------------- */

.tools-page {
    max-width: 920px;
    margin: 0 auto;
    padding: 96px 24px 80px;
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
}

@media (max-width: 768px) {
    .tools-page {
        padding: 72px 16px 64px;
    }
}

.tools-breadcrumb {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.tools-breadcrumb a {
    color: var(--neon-cyan);
    text-decoration: none;
}

.tools-breadcrumb a:hover {
    text-decoration: underline;
}

.tools-breadcrumb [aria-current="page"] {
    color: var(--text-primary);
}

/* ----------------------------------------------------------------
   Hero + form
---------------------------------------------------------------- */

.tools-hero {
    margin-bottom: 56px;
}

.tools-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(28px, 5vw, 44px);
    line-height: 1.15;
    margin: 0 0 16px;
    color: var(--text-primary);
    text-shadow: 0 0 24px rgba(0, 245, 212, 0.18);
}

.hero-subhead {
    font-size: 17px;
    color: var(--text-secondary, #b8c0c8);
    margin: 0 0 28px;
    max-width: 720px;
}

.redirect-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.redirect-form input[type="url"] {
    flex: 1 1 360px;
    min-width: 240px;
    padding: 14px 16px;
    font-family: var(--font-mono);
    font-size: 15px;
    background: rgba(13, 13, 20, 0.85);
    border: 1px solid rgba(0, 245, 212, 0.3);
    clip-path: var(--clip-badge);
    color: var(--text-primary);
    transition: border-color .2s, box-shadow .2s;
}

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

@media (max-width: 768px) {
    /* 16px prevents iOS Safari from auto-zooming the page on input focus. */
    .redirect-form input[type="url"] {
        font-size: 16px;
    }
}

@media (max-width: 640px) {
    /* Stack the form and let the submit button span full width for a solid
       tap target once the input wraps. */
    .redirect-form {
        flex-direction: column;
    }
    .redirect-form .btn-primary {
        width: 100%;
    }
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 22px;
    background: var(--neon-cyan);
    color: var(--bg-deep);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    border: none;
    clip-path: var(--clip-button);
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 245, 212, 0.35);
}

.btn-primary:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    background: transparent;
    color: var(--neon-cyan);
    border: 1px solid rgba(0, 245, 212, 0.4);
    clip-path: var(--clip-button);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: background .2s, border-color .2s;
    margin-right: 8px;
}

.btn-secondary:hover {
    background: rgba(0, 245, 212, 0.1);
    border-color: var(--neon-cyan);
}

.rate-limit-note {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

.form-error {
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(255, 87, 87, 0.08);
    border: 1px solid rgba(255, 87, 87, 0.35);
    clip-path: var(--clip-badge);
    color: #ff8888;
    font-size: 14px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ----------------------------------------------------------------
   Output: status panel
---------------------------------------------------------------- */

.output-section {
    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);
}

.output-h2 {
    font-family: var(--font-display);
    font-size: 18px;
    margin: 0 0 12px;
    color: var(--text-primary);
    letter-spacing: .03em;
}

.status-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    padding: 16px 20px;
    clip-path: var(--clip-button);
    margin-bottom: 24px;
    border: 1px solid;
}

.status-panel.status-preserved {
    background: rgba(0, 245, 212, 0.08);
    border-color: rgba(0, 245, 212, 0.35);
}

.status-panel.status-degraded {
    background: rgba(255, 184, 0, 0.08);
    border-color: rgba(255, 184, 0, 0.4);
}

.status-panel.status-lost {
    background: rgba(255, 87, 87, 0.08);
    border-color: rgba(255, 87, 87, 0.4);
}

.status-label {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: .04em;
}

.status-preserved .status-label { color: #5af0cb; }
.status-degraded .status-label  { color: #ffd365; }
.status-lost .status-label      { color: #ff8888; }

.status-score {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--text-muted);
}

.status-reason {
    flex: 1 1 100%;
    font-size: 14px;
    color: var(--text-secondary, #b8c0c8);
    margin: 0;
}

.ai-summary {
    font-size: 15px;
    color: var(--text-primary);
    background: rgba(0, 245, 212, 0.04);
    border-left: 3px solid var(--neon-cyan);
    padding: 12px 16px;
    margin: 0 0 28px;
}

/* ----------------------------------------------------------------
   Output: chain visualization
---------------------------------------------------------------- */

.hops-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hop-card {
    border: 1px solid rgba(255, 255, 255, 0.1);
    clip-path: var(--clip-badge);
    padding: 14px 16px;
    margin-bottom: 12px;
    background: rgba(20, 22, 30, 0.7);
    display: grid;
    grid-template-columns: 56px 1fr auto;
    gap: 16px;
    align-items: center;
}

.hop-index {
    font-family: var(--font-display);
    font-size: 20px;
    color: var(--neon-cyan);
}

.hop-url {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-primary);
    word-break: break-all;
    margin: 0 0 4px;
}

.hop-meta {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
}

.hop-status {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    padding: 4px 10px;
    clip-path: var(--clip-badge);
    min-width: 56px;
    text-align: center;
}

.hop-status.severity-ok      { background: rgba(0, 245, 212, 0.15); color: #5af0cb; }
.hop-status.severity-warning { background: rgba(255, 184, 0, 0.15); color: #ffd365; }
.hop-status.severity-error   { background: rgba(255, 87, 87, 0.15); color: #ff8888; }

.hop-rule {
    grid-column: 2 / 4;
    font-size: 12px;
    color: var(--text-muted);
    margin: 6px 0 0;
    line-height: 1.4;
}

@media (max-width: 640px) {
    .hop-card {
        grid-template-columns: 40px 1fr;
        grid-template-rows: auto auto auto;
    }
    .hop-status {
        grid-row: 1 / 2;
        grid-column: 2 / 3;
        justify-self: end;
    }
    .hop-url {
        grid-row: 2 / 3;
        grid-column: 1 / 3;
    }
    .hop-meta {
        grid-row: 3 / 4;
        grid-column: 1 / 3;
    }
    .hop-rule {
        grid-column: 1 / 3;
    }
}

.share-actions {
    margin-top: 24px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ----------------------------------------------------------------
   Long-form content sections
---------------------------------------------------------------- */

.tools-page h2 {
    font-family: var(--font-display);
    font-size: clamp(22px, 3vw, 28px);
    margin: 56px 0 16px;
    color: var(--text-primary);
}

.tools-page h3 {
    font-family: var(--font-display);
    font-size: 18px;
    margin: 28px 0 12px;
    color: var(--neon-cyan);
}

.tools-page p {
    color: var(--text-secondary, #b8c0c8);
    margin: 0 0 16px;
}

.tools-page .checklist {
    list-style: none;
    padding: 0;
}

.tools-page .checklist li {
    padding-left: 28px;
    position: relative;
    margin-bottom: 10px;
    color: var(--text-secondary, #b8c0c8);
}

.tools-page .checklist li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--neon-cyan);
    font-weight: 700;
}

.tools-page ol,
.tools-page .how-to-steps {
    color: var(--text-secondary, #b8c0c8);
    padding-left: 22px;
}

.tools-page ol li {
    margin-bottom: 10px;
}

/* FAQ details/summary */
.faq details {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 14px 0;
}

.faq summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-primary);
    padding: 6px 0;
    list-style: none;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::before {
    content: "+";
    color: var(--neon-cyan);
    font-weight: 700;
    margin-right: 10px;
}

.faq details[open] summary::before {
    content: "−";
}

.faq details p {
    margin: 8px 0 0;
    font-size: 14px;
    line-height: 1.6;
}

.faq details a {
    color: var(--neon-cyan);
}

/* ----------------------------------------------------------------
   CTA aside
---------------------------------------------------------------- */

.product-cta {
    margin: 56px 0;
    padding: 28px;
    background: linear-gradient(135deg, rgba(0, 245, 212, 0.06), rgba(0, 128, 255, 0.04));
    border: 1px solid rgba(0, 245, 212, 0.3);
    clip-path: var(--clip-card);
}

.product-cta h2 {
    margin-top: 0;
    color: var(--text-primary);
}

.product-cta .cta-line {
    font-size: 16px;
    color: var(--text-primary);
}

.product-cta a.btn-primary {
    margin-right: 8px;
}

/* ----------------------------------------------------------------
   Related-tools list + footer
---------------------------------------------------------------- */

.related-tools-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.related-tools-list li {
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    clip-path: var(--clip-badge);
    font-size: 14px;
}

.related-tools-list a {
    color: var(--neon-cyan);
    text-decoration: none;
}

.related-tools-list .muted {
    color: var(--text-muted);
}

.last-updated {
    margin-top: 40px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
}

/* ----------------------------------------------------------------
   /tools/ hub grid
---------------------------------------------------------------- */

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 48px;
}

.tool-card {
    display: block;
    padding: 22px;
    background: rgba(20, 22, 30, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    clip-path: var(--clip-card);
    text-decoration: none;
    color: inherit;
    transition: transform .2s, border-color .2s, box-shadow .2s;
    position: relative;
}

.tool-card-live:hover {
    transform: translateY(-3px);
    border-color: rgba(0, 245, 212, 0.5);
    box-shadow: 0 8px 24px rgba(0, 245, 212, 0.12);
}

.tool-card h2 {
    font-size: 18px;
    margin: 8px 0 10px;
}

.tool-card p {
    margin: 0 0 14px;
    font-size: 14px;
    color: var(--text-secondary, #b8c0c8);
}

.tool-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 3px 8px;
    clip-path: var(--clip-badge);
    letter-spacing: .04em;
    text-transform: uppercase;
}

.tool-badge-live {
    background: rgba(0, 245, 212, 0.15);
    color: #5af0cb;
}

.tool-badge-soon {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
}

.tool-link {
    color: var(--neon-cyan);
    font-weight: 600;
    font-size: 14px;
}

.tool-card-coming {
    opacity: .55;
}
