body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f4f9;
    color: #333;
    margin: 0;
    padding: 20px 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

.container {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 80%;
    max-width: 800px;
    text-align: center;
}

.results-container {
    max-width: 1100px;
    text-align: left;
}

h1 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-size: 1.4rem;
    text-align: center;
}

.scan-url {
    color: #3498db;
    word-break: break-all;
}

form {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 1rem;
}

input[type="text"],
input[type="url"] {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 60%;
    font-size: 16px;
}

button {
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2980b9;
}

.permission-note,
.pending-copy {
    color: #5f6b76;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 auto;
    max-width: 560px;
}

.pending-container {
    margin-top: 10vh;
}

.eyebrow {
    color: #3498db;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin: 0 0 0.4rem;
    text-transform: uppercase;
}

.progress-track {
    background: #e8eef5;
    border-radius: 999px;
    height: 10px;
    margin: 1.5rem auto 1rem;
    max-width: 520px;
    overflow: hidden;
}

.progress-bar {
    animation: scan-progress 1.4s ease-in-out infinite;
    background: #3498db;
    border-radius: inherit;
    height: 100%;
    width: 40%;
}

@keyframes scan-progress {
    0% { transform: translateX(-110%); }
    100% { transform: translateX(260%); }
}

@media (prefers-reduced-motion: reduce) {
    .progress-bar {
        animation: none;
        width: 70%;
    }
}

/* ── Risk Banner ─────────────────────────────── */
.risk-banner {
    margin: 1rem 0 1.5rem;
    padding: 1.2rem 1.5rem;
    border-radius: 10px;
    text-align: center;
    border: 2px solid transparent;
}

.risk-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.75;
    margin-bottom: 0.3rem;
}

.risk-level {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
}

.risk-stats {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.stat-vuln  { color: #c0392b; }
.stat-warn  { color: #e67e22; }
.stat-score { color: #555; }

.risk-excellent { background: #eafaf1; border-color: #27ae60; color: #1e8449; }
.risk-low       { background: #eafaf1; border-color: #2ecc71; color: #1e8449; }
.risk-medium    { background: #fef9e7; border-color: #f39c12; color: #b7770d; }
.risk-high      { background: #fef0e7; border-color: #e67e22; color: #a04000; }
.risk-critical  { background: #fdedec; border-color: #e74c3c; color: #922b21; }

/* ── Priority Findings ───────────────────────── */
.priority-section {
    margin-bottom: 1.6rem;
}

.priority-list {
    display: grid;
    gap: 0.75rem;
}

.priority-item {
    border: 1px solid #e8e8e8;
    border-left: 4px solid #e67e22;
    border-radius: 6px;
    padding: 0.8rem 1rem;
}

.priority-heading {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.priority-item p {
    color: #444;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0.55rem 0 0;
}

/* ── Category Sections ───────────────────────── */
.category-section {
    margin-bottom: 2rem;
}

.category-title {
    font-size: 1rem;
    font-weight: 700;
    color: #2c3e50;
    background: #f0f3f7;
    padding: 0.6rem 1rem;
    border-left: 4px solid #3498db;
    border-radius: 0 4px 4px 0;
    margin: 0 0 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.category-badge {
    background: #3498db;
    color: white;
    border-radius: 12px;
    padding: 1px 8px;
    font-size: 0.75rem;
    font-weight: 600;
}

.cat-flag {
    border-radius: 10px;
    padding: 1px 8px;
    font-size: 0.72rem;
    font-weight: 600;
}
.flag-vuln { background: #fdedec; color: #c0392b; }
.flag-warn { background: #fef9e7; color: #b7770d; }

/* ── Table ───────────────────────────────────── */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.25rem;
    font-size: 0.88rem;
}

th, td {
    padding: 9px 12px;
    text-align: left;
    border-bottom: 1px solid #e8e8e8;
    vertical-align: top;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #555;
}

.check-name {
    font-weight: 500;
    color: #2c3e50;
}

.details-cell {
    color: #444;
    line-height: 1.5;
}

/* Row highlights */
.row-vulnerable { background-color: #fff5f5; }
.row-warning    { background-color: #fffbf0; }
.row-missing    { background-color: #fffbf0; }

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.status-ok, .status-secure    { background: #eafaf1; color: #1e8449; }
.status-found                  { background: #e8f4fd; color: #1a5276; }
.status-info, .status-not-found{ background: #f0f3f7; color: #555; }
.status-warning                { background: #fef9e7; color: #b7770d; }
.status-missing                { background: #fef5e7; color: #a04000; }
.status-vulnerable             { background: #fdedec; color: #922b21; font-weight: 800; }
.status-error                  { background: #f5eef8; color: #6c3483; }

.view-link {
    margin-left: 6px;
    color: #3498db;
    text-decoration: none;
    font-size: 0.8rem;
}
.view-link:hover { text-decoration: underline; }

.back-link {
    display: inline-block;
    margin-bottom: 1rem;
    color: #3498db;
    text-decoration: none;
    font-size: 0.9rem;
}
.back-link:hover { text-decoration: underline; }

@media (max-width: 720px) {
    body {
        padding: 12px 0;
    }

    .container {
        padding: 1.2rem;
        width: calc(100% - 24px);
    }

    form,
    .risk-stats {
        flex-direction: column;
    }

    input[type="text"],
    input[type="url"] {
        width: calc(100% - 22px);
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: normal;
    }
}
