* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #f5f7fb;
    --card: #ffffff;
    --text: #1a1f36;
    --muted: #6b7280;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --critical: #dc2626;
    --critical-bg: #fef2f2;
    --warning: #d97706;
    --warning-bg: #fffbeb;
    --info: #2563eb;
    --info-bg: #eff6ff;
    --success: #16a34a;
    --success-bg: #f0fdf4;
    --border: #e5e7eb;
    --shadow: 0 4px 20px rgba(0,0,0,0.06);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

.hero {
    text-align: center;
    margin-bottom: 40px;
}
.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 8px;
}
.subtitle {
    color: var(--muted);
    font-size: 1.1rem;
}

.check-form {
    background: var(--card);
    padding: 24px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}
.input-wrap {
    display: flex;
    gap: 12px;
}
.input-wrap input {
    flex: 1;
    padding: 14px 18px;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s;
}
.input-wrap input:focus {
    border-color: var(--primary);
}
.input-wrap button {
    padding: 14px 28px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}
.input-wrap button:hover:not(:disabled) { background: var(--primary-hover); }
.input-wrap button:disabled { opacity: 0.6; cursor: not-allowed; }
.hint {
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.85rem;
    text-align: center;
}

.loader {
    text-align: center;
    padding: 40px;
    color: var(--muted);
}
.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

.error-box {
    background: var(--critical-bg);
    color: var(--critical);
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid var(--critical);
}

.results {
    animation: fadeIn 0.4s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.score-card {
    background: var(--card);
    padding: 32px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 32px;
    align-items: center;
    margin-bottom: 24px;
}
.score-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: conic-gradient(var(--success) 0deg, #e5e7eb 0deg);
    position: relative;
}
.score-circle::before {
    content: '';
    position: absolute;
    inset: 10px;
    background: var(--card);
    border-radius: 50%;
}
.score-value {
    position: relative;
    font-size: 2.5rem;
    font-weight: 700;
}
.score-label {
    position: relative;
    color: var(--muted);
    font-size: 0.85rem;
}
.score-info h2 { margin-bottom: 8px; }
.score-info p { color: var(--muted); margin-bottom: 12px; }
.meta {
    display: flex;
    gap: 20px;
    color: var(--muted);
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.summary .badge {
    background: var(--card);
    padding: 16px;
    border-radius: 10px;
    text-align: center;
    box-shadow: var(--shadow);
}
.badge .num { font-size: 1.8rem; font-weight: 700; display: block; }
.badge .lbl { color: var(--muted); font-size: 0.85rem; }
.badge.critical .num { color: var(--critical); }
.badge.warning .num  { color: var(--warning); }
.badge.info .num     { color: var(--info); }
.badge.passed .num   { color: var(--success); }

.section {
    background: var(--card);
    padding: 24px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.section h3 { margin-bottom: 16px; }

.issues-list, .passed-list {
    list-style: none;
}
.issue {
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 12px;
    border-left: 4px solid;
}
.issue.critical { background: var(--critical-bg); border-color: var(--critical); }
.issue.warning  { background: var(--warning-bg);  border-color: var(--warning); }
.issue.info     { background: var(--info-bg);     border-color: var(--info); }
.issue h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 1rem;
}
.issue .tag {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 700;
    color: #fff;
}
.issue.critical .tag { background: var(--critical); }
.issue.warning .tag  { background: var(--warning); }
.issue.info .tag     { background: var(--info); }
.issue p { margin-bottom: 6px; font-size: 0.95rem; }
.issue .fix {
    font-size: 0.9rem;
    color: var(--text);
    background: rgba(255,255,255,0.6);
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 8px;
}
.issue .fix strong { color: var(--success); }

.passed-list li {
    padding: 10px 14px;
    background: var(--success-bg);
    border-left: 3px solid var(--success);
    border-radius: 6px;
    margin-bottom: 8px;
    color: var(--success);
}

.footer {
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
    margin-top: 40px;
    padding: 20px;
}

@media (max-width: 600px) {
    .hero h1 { font-size: 1.8rem; }
    .input-wrap { flex-direction: column; }
    .score-card { flex-direction: column; text-align: center; }
    .meta { justify-content: center; }
}