/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --accent: #f59e0b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg: #fafafa;
    --surface: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1; }

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

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === Navbar === */
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
}

.logo:hover { text-decoration: none; }
.logo-img { height: 36px; width: auto; }
.logo-accent { color: var(--primary); }

.nav-links { display: flex; gap: 24px; }
.nav-links a { color: var(--text-muted); font-size: 0.95rem; }
.nav-links a:hover { color: var(--primary); text-decoration: none; }

/* === Hero === */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    padding: 80px 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 16px;
    font-weight: 800;
}

.hero-subtitle {
    font-size: 1.15rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 32px;
}

/* === Scan Form === */
.scan-form { max-width: 600px; margin: 0 auto; }

.input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.scan-input {
    flex: 1;
    padding: 14px 18px;
    font-size: 1rem;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: var(--radius);
    background: rgba(255,255,255,0.15);
    color: #fff;
    outline: none;
    transition: border-color 0.2s;
}

.scan-input::placeholder { color: rgba(255,255,255,0.6); }
.scan-input:focus { border-color: var(--accent); background: rgba(255,255,255,0.2); }

.scan-input-sm {
    width: 100%;
    padding: 10px 18px;
    font-size: 0.9rem;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: var(--radius);
    background: rgba(255,255,255,0.1);
    color: #fff;
    outline: none;
}

.scan-input-sm::placeholder { color: rgba(255,255,255,0.5); }

.input-row { max-width: 400px; margin: 0 auto; }

/* === Buttons === */
.btn {
    display: inline-block;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: #1a1a2e;
}

.btn-primary:hover {
    background: #e8910a;
    transform: translateY(-1px);
    text-decoration: none;
}

/* === Alert === */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.95rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* === Features === */
.features {
    padding: 60px 0;
}

.features h2 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 40px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s;
}

.feature-card:hover { box-shadow: var(--shadow-lg); }

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.feature-card h3 {
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* === Scanning === */
.scanning-section {
    padding: 80px 0;
}

.text-center { text-align: center; }

.scanning-animation { margin-bottom: 24px; }

.paw-prints .paw {
    font-size: 3rem;
    display: inline-block;
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.scan-url {
    color: var(--text-muted);
    margin-bottom: 24px;
    word-break: break-all;
}

.progress-bar {
    background: var(--border);
    border-radius: 999px;
    height: 8px;
    max-width: 400px;
    margin: 0 auto 16px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 5%;
    background: var(--primary);
    border-radius: 999px;
    transition: width 0.5s ease;
}

.scan-status { color: var(--text-muted); }

/* === Results === */
.results-section { padding: 40px 0; }

.results-header {
    text-align: center;
    margin-bottom: 40px;
}

.results-header h1 { margin-bottom: 4px; }

.results-header .scan-url {
    margin-bottom: 24px;
}

.score-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-top: 20px;
}

.score-circle {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 5px solid;
}

.score-good { border-color: var(--success); color: var(--success); }
.score-ok { border-color: var(--warning); color: var(--warning); }
.score-bad { border-color: var(--danger); color: var(--danger); }

.score-number { font-size: 2.2rem; font-weight: 800; line-height: 1; }
.score-label { font-size: 0.8rem; opacity: 0.7; }

.score-meta { text-align: left; }
.score-meta p { margin-bottom: 8px; }

.checks-summary { display: flex; gap: 8px; flex-wrap: wrap; }

/* === Badges === */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-pass { background: #d1fae5; color: #065f46; }
.badge-warn { background: #fef3c7; color: #92400e; }
.badge-fail { background: #fee2e2; color: #991b1b; }

/* === Check Items === */
.check-category {
    margin-bottom: 32px;
}

.check-category h2 {
    font-size: 1.3rem;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 16px;
}

.check-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 12px;
    border-left: 4px solid;
}

.check-pass { border-left-color: var(--success); }
.check-warn { border-left-color: var(--warning); }
.check-fail { border-left-color: var(--danger); }

.check-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.check-icon { font-size: 1.2rem; }
.check-pass .check-icon { color: var(--success); }
.check-warn .check-icon { color: var(--warning); }
.check-fail .check-icon { color: var(--danger); }

.check-name { font-weight: 600; flex: 1; }

.check-status-badge {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
}

.check-detail {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 4px;
}

/* === Remediation === */
.remediation {
    margin-top: 8px;
}

.remediation summary {
    cursor: pointer;
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 500;
}

.remediation-content {
    margin-top: 8px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text);
}

/* === Issues Section === */
.issues-section h2 {
    color: var(--danger);
}

.issues-section .remediation[open] .remediation-content {
    border-left: 3px solid var(--primary);
}

/* === Passing Section === */
.passing-toggle {
    cursor: pointer;
    padding: 12px 0;
    color: var(--text-muted);
    list-style: none;
}

.passing-toggle::-webkit-details-marker { display: none; }

.passing-toggle::before {
    content: '+ ';
    font-weight: bold;
    color: var(--success);
}

details[open] > .passing-toggle::before {
    content: '- ';
}

.passing-toggle h2 {
    color: var(--success);
    font-size: 1.3rem;
}

/* === Results Footer === */
.results-footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

/* === Error / Legal === */
.error-section, .legal-section {
    padding: 60px 0;
}

.legal-section h2 {
    margin-top: 32px;
    margin-bottom: 12px;
}

.legal-section p, .legal-section ul {
    margin-bottom: 12px;
    color: var(--text-muted);
}

.legal-section a {
    text-decoration: underline;
}

.legal-section ul { padding-left: 24px; }

/* === Footer === */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 20px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* === Download === */
.download-section { padding: 40px 0; }

.download-header { margin-bottom: 32px; }
.download-header h1 { margin-bottom: 4px; }

.download-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: var(--shadow);
}

.download-actions { margin-top: 28px; }

.btn-download {
    font-size: 1.1rem;
    padding: 16px 36px;
}

.generating-notice {
    padding: 24px;
    background: #f8fafc;
    border-radius: var(--radius);
}

.generating-notice .paw { font-size: 2rem; display: inline-block; animation: bounce 1s ease-in-out infinite; }
.generating-notice p { margin-top: 8px; }

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

/* === Upsell === */
.upsell-section { margin-top: 40px; }

.upsell-card {
    background: var(--surface);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.upsell-card h2 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    color: var(--primary);
}

.upsell-card p { margin-bottom: 16px; color: var(--text-muted); }

.upsell-features {
    list-style: none;
    padding: 0;
    margin: 0 auto 24px;
    max-width: 300px;
    text-align: left;
}

.upsell-features li {
    padding: 6px 0;
    color: var(--text);
    font-size: 0.95rem;
}

/* === Cancelled === */
.cancelled-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
    flex-wrap: wrap;
}

.btn-secondary {
    background: var(--surface);
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: #fff;
    text-decoration: none;
}

/* === Monitor === */
.monitor-section { padding: 40px 0; }

.monitor-header { margin-bottom: 32px; }
.monitor-header h1 { margin-bottom: 4px; }

.monitor-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.monitor-card h2 {
    font-size: 1.3rem;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}

.monitor-details { display: flex; flex-direction: column; gap: 12px; }

.monitor-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.monitor-row:last-child { border-bottom: none; }

.monitor-label {
    font-weight: 600;
    color: var(--text-muted);
}

.monitor-cancel { margin-top: 32px; }

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
    text-decoration: none;
}

/* === Responsive === */
@media (max-width: 640px) {
    .hero h1 { font-size: 1.8rem; }
    .input-group { flex-direction: column; }
    .score-display { flex-direction: column; }
    .score-meta { text-align: center; }
    .feature-grid { grid-template-columns: 1fr; }
}
