* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f4f6f8;
    color: #1f2937;
    line-height: 1.5;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

header { text-align: center; margin-bottom: 30px; }
header h1 { font-size: 28px; margin-bottom: 8px; }
header p { color: #6b7280; }

.analyze-form {
    display: flex;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto 40px;
}

.analyze-form input {
    flex: 1;
    padding: 14px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
}

.analyze-form button {
    padding: 14px 28px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
.analyze-form button:hover { background: #1d4ed8; }

.recent { background: #fff; border-radius: 10px; padding: 20px; }
.recent h2 { font-size: 16px; margin-bottom: 12px; }
.recent ul { list-style: none; }
.recent li {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    gap: 10px;
}
.recent li:last-child { border-bottom: none; }
.recent a { color: #2563eb; text-decoration: none; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent .score { color: #059669; font-weight: 600; }
.recent .date { color: #9ca3af; }

.back-link { display: inline-block; margin-bottom: 16px; color: #2563eb; text-decoration: none; }
h1 { font-size: 22px; margin-bottom: 20px; word-break: break-all; }

.score-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 30px;
}

.score-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px 10px;
    text-align: center;
    border-top: 4px solid #d1d5db;
}
.score-card .score-value { display: block; font-size: 28px; font-weight: 700; }
.score-card .score-label { display: block; font-size: 12px; color: #6b7280; margin-top: 4px; }

.score-card.good { border-top-color: #10b981; }
.score-card.good .score-value { color: #10b981; }
.score-card.average { border-top-color: #f59e0b; }
.score-card.average .score-value { color: #f59e0b; }
.score-card.poor { border-top-color: #ef4444; }
.score-card.poor .score-value { color: #ef4444; }
.score-card.info { border-top-color: #6366f1; }
.score-card.info .score-value { color: #6366f1; }
.score-card.unknown { border-top-color: #9ca3af; }

.notice {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.metrics, .issues, .passed, .suggestions {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}
.metrics h2, .issues h2, .passed h2, .suggestions h2 { font-size: 16px; margin-bottom: 14px; }

.metrics ul { list-style: none; }
.metrics li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
.metrics li:last-child { border-bottom: none; }
.metrics li span { color: #6b7280; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.issues ul, .passed ul { list-style: none; }
.issues li, .passed li { padding: 10px 0; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
.issues li:last-child, .passed li:last-child { border-bottom: none; }

.badge {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 6px;
    font-weight: 600;
}
.badge-high { background: #fee2e2; color: #b91c1c; }
.badge-medium { background: #fef3c7; color: #92400e; }
.badge-low { background: #e0e7ff; color: #3730a3; }

.good-text { color: #059669; font-weight: 600; }

.suggestions ol { padding-left: 20px; }
.suggestions li { padding: 8px 0; font-size: 14px; }

@media (max-width: 640px) {
    .score-cards { grid-template-columns: repeat(2, 1fr); }
    .two-col { grid-template-columns: 1fr; }
    .analyze-form { flex-direction: column; }
}

/* ---------- Top navigation ---------- */
.topnav {
    background: #111827;
    color: #fff;
}
.topnav-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.topnav .brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 17px; }
.topnav nav { display: flex; align-items: center; gap: 16px; font-size: 14px; }
.topnav .user-greeting { color: #9ca3af; }
.topnav a { color: #fff; text-decoration: none; }
.topnav a:hover { text-decoration: underline; }

/* ---------- Dashboard ---------- */
.dash-header { margin-bottom: 24px; }
.dash-header h1 { font-size: 24px; margin-bottom: 4px; }
.dash-header p { color: #6b7280; font-size: 14px; }

.sites-table-wrap {
    background: #fff;
    border-radius: 10px;
    padding: 10px;
    overflow-x: auto;
}
.sites-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sites-table th {
    text-align: left;
    padding: 12px 14px;
    color: #6b7280;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    border-bottom: 2px solid #f0f0f0;
}
.sites-table td { padding: 12px 14px; border-bottom: 1px solid #f0f0f0; white-space: nowrap; }
.sites-table tr:last-child td { border-bottom: none; }
.sites-table .site-cell { font-weight: 600; white-space: normal; word-break: break-all; }

.pill {
    display: inline-block;
    min-width: 32px;
    text-align: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 13px;
}
.pill.good { background: #d1fae5; color: #065f46; }
.pill.average { background: #fef3c7; color: #92400e; }
.pill.poor { background: #fee2e2; color: #991b1b; }
.pill.unknown { background: #e5e7eb; color: #4b5563; }

.trend-up { color: #059669; font-weight: 600; }
.trend-down { color: #dc2626; font-weight: 600; }
.trend-flat { color: #9ca3af; }

.actions { display: flex; gap: 10px; align-items: center; }
.actions a { color: #2563eb; text-decoration: none; font-weight: 600; }
.inline-form { display: inline; }
.link-btn {
    background: none;
    border: none;
    color: #6b7280;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    font-size: 14px;
    font-family: inherit;
}
.link-btn:hover { color: #2563eb; }

.empty-state { text-align: center; color: #6b7280; padding: 40px 20px; }

/* ---------- Auth pages ---------- */
.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #f4f6f8;
}
.auth-card {
    background: #fff;
    border-radius: 12px;
    padding: 36px 32px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.auth-card h1 { font-size: 20px; text-align: center; margin-bottom: 4px; }
.auth-subtitle { text-align: center; color: #6b7280; font-size: 13px; margin-bottom: 24px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label { font-size: 13px; font-weight: 600; color: #374151; display: flex; flex-direction: column; gap: 6px; }
.auth-form input {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 400;
}
.auth-form button {
    margin-top: 6px;
    padding: 12px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.auth-form button:hover { background: #1d4ed8; }
.auth-switch { text-align: center; font-size: 13px; color: #6b7280; margin-top: 18px; }
.auth-switch a { color: #2563eb; text-decoration: none; font-weight: 600; }
.form-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}
.form-success {
    background: #d1fae5;
    color: #065f46;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
}
.form-success a { color: #065f46; font-weight: 700; }

/* ---------- Wider container for crawl reports ---------- */
.container-wide { max-width: 1200px; }
.page-subtitle { color: #6b7280; font-size: 14px; margin-bottom: 24px; }

/* ---------- Dashboard section headers ---------- */
.dash-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0 12px;
}
.dash-section-header h2 { font-size: 16px; }
.btn-primary-small {
    background: #2563eb;
    color: #fff;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}
.btn-primary-small:hover { background: #1d4ed8; }
.crawls-table-wrap { margin-bottom: 10px; }
.muted { color: #9ca3af; font-size: 13px; }

/* ---------- New crawl form ---------- */
.crawl-form {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 560px;
}
.crawl-form label { font-size: 13px; font-weight: 600; color: #374151; display: flex; flex-direction: column; gap: 6px; }
.crawl-form input, .crawl-form select {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 400;
}
.crawl-form .form-row { display: flex; gap: 16px; }
.crawl-form .form-row label { flex: 1; }
.crawl-form button {
    padding: 12px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.crawl-form button:hover { background: #1d4ed8; }

/* ---------- Crawl progress ---------- */
.crawl-status-card {
    background: #fff;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
}
.progress-bar-track {
    background: #e5e7eb;
    border-radius: 10px;
    height: 14px;
    overflow: hidden;
    margin: 20px 0 10px;
}
.progress-bar-fill {
    background: #2563eb;
    height: 100%;
    transition: width 0.4s ease;
}
#progress-text { color: #6b7280; font-size: 14px; }

/* ---------- Crawl report sections ---------- */
.score-cards-6 { grid-template-columns: repeat(6, 1fr); }
.report-section {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}
.report-section h2 { font-size: 15px; margin-bottom: 14px; }

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
    text-align: left;
    padding: 8px 10px;
    color: #6b7280;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    border-bottom: 2px solid #f0f0f0;
}
.data-table td { padding: 8px 10px; border-bottom: 1px solid #f5f5f5; vertical-align: top; }
.data-table tr:last-child td { border-bottom: none; }
.url-cell { word-break: break-all; max-width: 380px; }
.sources-cell { font-size: 12px; color: #6b7280; word-break: break-all; }
.table-scroll { max-height: 500px; overflow-y: auto; }

.url-list { list-style: none; font-size: 13px; }
.url-list li { padding: 6px 0; border-bottom: 1px solid #f5f5f5; word-break: break-all; }
.url-list li:last-child { border-bottom: none; }

@media (max-width: 900px) {
    .score-cards-6 { grid-template-columns: repeat(3, 1fr); }
    .crawl-form .form-row { flex-direction: column; }
}

/* ---------- Public landing page ---------- */
.public-nav { background: #fff; border-bottom: 1px solid #eee; }
.public-nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.public-nav .brand { color: #111827; text-decoration: none; font-weight: 700; font-size: 18px; }
.public-nav nav { display: flex; align-items: center; gap: 16px; }
.public-nav nav a { color: #374151; text-decoration: none; font-size: 14px; font-weight: 600; }
.public-nav nav a:hover { color: #2563eb; }

.hero {
    text-align: center;
    padding: 70px 20px 50px;
    background: linear-gradient(180deg, #eff6ff 0%, #f4f6f8 100%);
}
.hero h1 { font-size: 34px; margin-bottom: 14px; color: #111827; }
.hero p { color: #4b5563; font-size: 16px; max-width: 560px; margin: 0 auto 30px; }
.hero-form {
    display: flex;
    gap: 10px;
    max-width: 560px;
    margin: 0 auto;
}
.hero-form input {
    flex: 1;
    padding: 16px 18px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
}
.hero-form button {
    padding: 16px 32px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}
.hero-form button:hover { background: #1d4ed8; }
.hero-note { font-size: 13px; color: #9ca3af; margin-top: 14px; }

.features { padding: 60px 20px; }
.features-inner {
    max-width: 1000px;
    margin: 0 auto 50px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.feature-card { background: #fff; border-radius: 10px; padding: 24px; text-align: center; }
.feature-card h3 { font-size: 16px; margin-bottom: 10px; }
.feature-card p { font-size: 13px; color: #6b7280; }

.features-cta {
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
    background: #111827;
    color: #fff;
    border-radius: 14px;
    padding: 40px 30px;
}
.features-cta h2 { font-size: 20px; margin-bottom: 10px; }
.features-cta p { color: #d1d5db; font-size: 14px; margin-bottom: 20px; }
.features-cta .btn-primary-small { display: inline-block; }

/* ---------- Public audit report ---------- */
.audit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border-radius: 12px;
    padding: 24px 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}
.audit-header h1 { font-size: 20px; margin-bottom: 4px; }
.audit-header .page-subtitle { margin: 0; word-break: break-all; }

.overall-gauge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    border: 6px solid #e5e7eb;
    flex-shrink: 0;
}
.overall-gauge-score { font-size: 26px; font-weight: 800; line-height: 1; }
.overall-gauge-grade { font-size: 11px; color: #6b7280; margin-top: 2px; }
.overall-gauge-good { border-color: #10b981; }
.overall-gauge-good .overall-gauge-score { color: #10b981; }
.overall-gauge-average { border-color: #f59e0b; }
.overall-gauge-average .overall-gauge-score { color: #f59e0b; }
.overall-gauge-poor { border-color: #ef4444; }
.overall-gauge-poor .overall-gauge-score { color: #ef4444; }

.category-chips {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.category-chip {
    background: #fff;
    border-radius: 10px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 150px;
}
.chip-score { font-size: 20px; font-weight: 800; min-width: 34px; text-align: center; }
.chip-score.good { color: #10b981; }
.chip-score.average { color: #f59e0b; }
.chip-score.poor { color: #ef4444; }
.chip-score.unknown { color: #9ca3af; }
.chip-label { font-size: 13px; color: #6b7280; font-weight: 600; }

.category-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.category-card-header h2 { margin: 0; }

.check-list { list-style: none; margin-bottom: 10px; }
.check-list:last-child { margin-bottom: 0; }
.check-list li { padding: 8px 0; border-bottom: 1px solid #f5f5f5; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.check-list li:last-child { border-bottom: none; }
.check-icon { font-weight: 700; flex-shrink: 0; }
.check-fail .check-icon { color: #ef4444; }
.check-pass .check-icon { color: #10b981; }

.cta-banner { text-align: center; background: #eff6ff; }
.cta-banner h2 { margin-bottom: 8px; }
.cta-banner p { color: #4b5563; margin-bottom: 16px; font-size: 14px; }
.cta-banner .btn-primary-small { display: inline-block; }

@media (max-width: 700px) {
    .features-inner { grid-template-columns: repeat(2, 1fr); }
    .hero-form { flex-direction: column; }
    .audit-header { flex-direction: column; align-items: flex-start; }
}

/* ---------- Auth form extras (login/register pages load only this stylesheet) ---------- */
.auth-form .check-row { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; font-size: 13px; color: #4b5563; }
.auth-form .check-row input { width: auto; padding: 0; }
.auth-form .field-hint { font-weight: 400; color: #9ca3af; font-size: 12px; }
