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

:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: #1a2235;
    --bg-input: #0d1321;
    --border: #2a3550;
    --border-light: #374365;
    --text-primary: #e8edf5;
    --text-secondary: #9ca3bf;
    --text-muted: #6b7394;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-glow: rgba(59, 130, 246, 0.15);
    --green: #22c55e;
    --green-bg: rgba(34, 197, 94, 0.1);
    --red: #ef4444;
    --red-bg: rgba(239, 68, 68, 0.1);
    --yellow: #eab308;
    --yellow-bg: rgba(234, 179, 8, 0.1);
    --mono: 'JetBrains Mono', monospace;
    --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* === Navbar === */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(10, 14, 23, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-content {
    max-width: 1200px; margin: 0 auto; padding: 0 24px;
    display: flex; align-items: center; justify-content: space-between;
    height: 64px;
}

.logo {
    font-size: 20px; font-weight: 700; text-decoration: none;
    color: var(--text-primary); letter-spacing: -0.5px;
}

.logo-accent { color: var(--accent); }

.nav-links { display: flex; gap: 32px; }

.nav-links a {
    color: var(--text-secondary); text-decoration: none; font-size: 14px;
    font-weight: 500; transition: color 0.2s;
}

.nav-links a:hover { color: var(--text-primary); }

/* === Hero === */
.hero {
    padding: 160px 24px 100px;
    text-align: center;
    background: radial-gradient(ellipse at 50% 0%, var(--accent-glow) 0%, transparent 60%);
}

.hero-content { max-width: 720px; margin: 0 auto; }

.hero h1 {
    font-size: 48px; font-weight: 700; letter-spacing: -1.5px;
    line-height: 1.15; margin-bottom: 20px;
}

.hero-sub {
    font-size: 18px; color: var(--text-secondary); line-height: 1.7;
    margin-bottom: 36px;
}

.cta-button {
    display: inline-block; padding: 14px 32px;
    background: var(--accent); color: #fff; border: none; border-radius: 8px;
    font-size: 16px; font-weight: 600; text-decoration: none;
    cursor: pointer; transition: background 0.2s, transform 0.1s;
}

.cta-button:hover { background: var(--accent-hover); transform: translateY(-1px); }

/* === Sections === */
.section { padding: 80px 0; }
.section-dark { background: var(--bg-secondary); }

.section h2 {
    font-size: 32px; font-weight: 700; letter-spacing: -0.8px;
    margin-bottom: 16px; text-align: center;
}

.section-intro {
    text-align: center; color: var(--text-secondary); font-size: 16px;
    max-width: 640px; margin: 0 auto 48px;
}

/* === Steps Grid === */
.steps-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
    margin-top: 48px;
}

.step-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 12px; padding: 32px;
}

.step-number {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--accent); color: #fff; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; margin-bottom: 16px;
}

.step-card h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.step-card p { color: var(--text-secondary); font-size: 14px; line-height: 1.6; }

/* === Console Layout === */
.console-layout {
    display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
    margin-top: 32px;
}

.input-panel, .output-panel {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 12px; overflow: hidden;
}

.panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.2);
}

.panel-title { font-size: 14px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }

.format-toggle { display: flex; gap: 4px; }

.format-btn {
    padding: 4px 12px; border: 1px solid var(--border); border-radius: 6px;
    background: transparent; color: var(--text-muted); font-size: 12px;
    font-weight: 500; cursor: pointer; transition: all 0.2s;
    font-family: var(--sans);
}

.format-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* === Code Editor === */
.editor-wrapper { padding: 0; }

.code-editor {
    width: 100%; min-height: 240px; padding: 16px 20px;
    background: var(--bg-input); border: none; color: var(--text-primary);
    font-family: var(--mono); font-size: 13px; line-height: 1.6;
    resize: vertical; outline: none;
}

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

/* === Upload === */
.upload-row {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 20px; border-top: 1px solid var(--border);
}

.upload-btn {
    padding: 6px 14px; border: 1px solid var(--border); border-radius: 6px;
    background: transparent; color: var(--text-secondary); font-size: 13px;
    cursor: pointer; transition: all 0.2s; font-family: var(--sans);
}

.upload-btn:hover { border-color: var(--accent); color: var(--accent); }
.upload-info { font-size: 12px; color: var(--text-muted); }

/* === Config === */
.config-section, .criteria-section { padding: 16px 20px; border-top: 1px solid var(--border); }
.config-section h4, .criteria-section h4 { font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.5px; }

.config-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.config-item label { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }

.config-item select {
    width: 100%; padding: 8px 10px; background: var(--bg-input);
    border: 1px solid var(--border); border-radius: 6px;
    color: var(--text-primary); font-size: 13px; font-family: var(--sans);
    outline: none; cursor: pointer;
}

.config-item select:focus { border-color: var(--accent); }

/* === Criteria Checkboxes === */
.criteria-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }

.criteria-check {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; color: var(--text-secondary); cursor: pointer;
    padding: 4px 0;
}

.criteria-check input[type="checkbox"] {
    appearance: none; width: 16px; height: 16px;
    border: 1px solid var(--border); border-radius: 3px;
    background: var(--bg-input); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}

.criteria-check input[type="checkbox"]:checked {
    background: var(--accent); border-color: var(--accent);
}

.criteria-check input[type="checkbox"]:checked::after {
    content: '\2713'; color: #fff; font-size: 11px; font-weight: 700;
}

/* === Run Button === */
.run-button {
    display: block; width: calc(100% - 40px); margin: 16px 20px;
    padding: 14px; background: var(--accent); color: #fff;
    border: none; border-radius: 8px; font-size: 15px;
    font-weight: 600; cursor: pointer; transition: all 0.2s;
    font-family: var(--sans);
}

.run-button:hover { background: var(--accent-hover); }

.run-button:disabled {
    background: var(--border); color: var(--text-muted); cursor: not-allowed;
}

.run-button.running {
    background: var(--yellow); color: #000;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }

/* === Report Area === */
.report-area {
    min-height: 500px; padding: 20px;
    overflow-y: auto; max-height: 80vh;
}

.report-placeholder {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; min-height: 400px; color: var(--text-muted);
}

.placeholder-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.3; }

.download-btn {
    padding: 4px 12px; border: 1px solid var(--border); border-radius: 6px;
    background: transparent; color: var(--text-secondary); font-size: 12px;
    cursor: pointer; transition: all 0.2s; font-family: var(--sans);
}

.download-btn:hover:not(:disabled) { border-color: var(--green); color: var(--green); }
.download-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* === Report Results === */
.report-header {
    text-align: center; padding-bottom: 20px;
    border-bottom: 1px solid var(--border); margin-bottom: 20px;
}

.report-verdict {
    font-size: 24px; font-weight: 700; letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.verdict-pass { color: var(--green); }
.verdict-fail { color: var(--red); }
.verdict-partial { color: var(--yellow); }

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

.criterion-result {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 12px 0; border-bottom: 1px solid rgba(42, 53, 80, 0.5);
}

.criterion-badge {
    flex-shrink: 0; width: 28px; height: 28px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700;
}

.badge-pass { background: var(--green-bg); color: var(--green); }
.badge-fail { background: var(--red-bg); color: var(--red); }

.criterion-info { flex: 1; }
.criterion-name { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.criterion-detail { font-size: 12px; color: var(--text-muted); font-family: var(--mono); }

.report-footer {
    margin-top: 20px; padding-top: 16px;
    border-top: 1px solid var(--border);
}

.audit-hash {
    font-family: var(--mono); font-size: 11px; color: var(--text-muted);
    word-break: break-all; background: var(--bg-input);
    padding: 10px; border-radius: 6px; margin-top: 8px;
}

.audit-label { font-size: 11px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }

/* === Criteria Detail Grid === */
.criteria-detail-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
    margin-top: 48px;
}

.criterion-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 12px; padding: 28px;
}

.criterion-id {
    font-size: 14px; font-weight: 700; color: var(--accent);
    font-family: var(--mono); margin-bottom: 12px;
}

.criterion-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.criterion-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

/* === Footer === */
.footer {
    background: var(--bg-secondary); border-top: 1px solid var(--border);
    padding: 48px 0 24px;
}

.footer-content { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 32px; }
.footer-brand p { color: var(--text-muted); font-size: 14px; margin-top: 8px; }
.footer-links { text-align: right; }
.footer-links p { color: var(--text-secondary); font-size: 14px; margin-bottom: 4px; }
.footer-links a { display: block; color: var(--text-muted); font-size: 13px; text-decoration: none; margin-top: 4px; }
.footer-links a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 16px; }
.footer-bottom p { font-size: 12px; color: var(--text-muted); }

/* === Responsive === */
@media (max-width: 768px) {
    .hero h1 { font-size: 32px; }
    .steps-grid, .criteria-detail-grid { grid-template-columns: 1fr; }
    .console-layout { grid-template-columns: 1fr; }
    .config-grid { grid-template-columns: 1fr; }
    .criteria-grid { grid-template-columns: 1fr; }
    .nav-links { display: none; }
    .footer-content { flex-direction: column; gap: 24px; }
    .footer-links { text-align: left; }
}
