/* PolicyCheck — Napier AI */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --brand: #4f46e5; --brand-light: #818cf8; --brand-dark: #312e81;
    --success: #16a34a; --warning: #d97706; --danger: #7c3aed;
    --bg: #f8fafc; --card-bg: #fff; --border: #e2e8f0;
    --text: #0f172a; --text-muted: #64748b; --radius: 10px;
}
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; }

/* NAVBAR */
.navbar { background: var(--brand-dark); padding: 0 24px; display: flex; align-items: center; justify-content: space-between; height: 56px; position: sticky; top: 0; z-index: 100; }
.nav-brand { display: flex; align-items: center; gap: 8px; }
.brand-icon { font-size: 20px; }
.brand-name { color: white; font-size: 18px; font-weight: 700; letter-spacing: -0.3px; }
.brand-tag { color: #c7d2fe; font-size: 12px; background: rgba(255,255,255,0.1); padding: 2px 8px; border-radius: 20px; }
.nav-links { display: flex; gap: 8px; align-items: center; }
.nav-link { color: #c7d2fe; text-decoration: none; padding: 6px 14px; border-radius: 6px; font-size: 14px; transition: background .15s; }
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,0.1); color: white; }
.nav-user { display: flex; align-items: center; gap: 12px; margin-left: 16px; padding-left: 16px; border-left: 1px solid rgba(255,255,255,0.15); }
.nav-user span { color: #c7d2fe; font-size: 13px; }
.btn-logout { color: #c7d2fe; font-size: 13px; text-decoration: none; }
.btn-logout:hover { color: white; }

/* CONTAINER */
.container { max-width: 1100px; margin: 0 auto; padding: 28px 24px 60px; }
.alert { background: #fef3c7; border: 1px solid #fcd34d; color: #92400e; padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; }

/* AUTH */
.auth-wrapper { display: flex; justify-content: center; padding: 60px 16px; }
.auth-card { background: white; border: 1px solid var(--border); border-radius: 16px; padding: 40px; width: 100%; max-width: 440px; box-shadow: 0 4px 24px rgba(0,0,0,0.06); }
.auth-logo { font-size: 22px; font-weight: 800; color: var(--brand); margin-bottom: 24px; }
.auth-title { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.auth-sub { color: var(--text-muted); font-size: 14px; margin-bottom: 28px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 14px; font-weight: 500; }
.form-group input { padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 15px; outline: none; transition: border-color .15s; }
.form-group input:focus { border-color: var(--brand-light); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }
.auth-footer { margin-top: 20px; font-size: 14px; color: var(--text-muted); text-align: center; }
.auth-footer a { color: var(--brand); text-decoration: none; font-weight: 500; }
.optional { font-size: 12px; font-weight: 400; color: var(--text-muted); }
.required { color: var(--danger); }
.form-hint { font-size: 13px; color: var(--text-muted); margin-top: -2px; }

/* BUTTONS */
.btn-primary { background: var(--brand); color: white; border: none; padding: 11px 20px; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; transition: background .15s; }
.btn-primary:hover { background: var(--brand-light); }
.btn-full { width: 100%; text-align: center; }
.btn-sm { padding: 7px 14px; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: none; border: 1px solid transparent; display: inline-block; transition: all .15s; }
.btn-view { background: #eef2ff; color: var(--brand); border-color: #c7d2fe; }
.btn-view:hover { background: var(--brand); color: white; }
.btn-report { background: #f0fdf4; color: var(--success); border-color: #bbf7d0; }
.btn-report:hover { background: var(--success); color: white; }
.btn-delete { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-delete:hover { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.btn-cta { background: var(--brand-dark); color: white; padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 600; text-decoration: none; display: inline-block; margin-top: 12px; }
.btn-cta:hover { background: var(--brand); }
.back-link { color: var(--brand); text-decoration: none; font-size: 14px; font-weight: 500; display: inline-block; margin-bottom: 14px; }
.back-link:hover { text-decoration: underline; }

/* DASHBOARD */
.dashboard-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; gap: 16px; }
.dashboard-title h1 { font-size: 26px; font-weight: 700; }
.dashboard-title p { color: var(--text-muted); font-size: 14px; margin-top: 4px; }
.btn-disabled { opacity: 0.5; pointer-events: none; cursor: not-allowed; }

/* PLAN BAR */
.plan-bar { background: white; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.plan-bar-left { display: flex; align-items: center; gap: 12px; }
.plan-bar-right { display: flex; align-items: center; gap: 12px; }
.plan-badge { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.4px; }
.plan-free { background: #f1f5f9; color: #64748b; }
.plan-pro { background: #eef2ff; color: #4f46e5; }
.plan-teams { background: #0f172a; color: white; }
.plan-usage { font-size: 13px; color: var(--text-muted); }
.plan-progress-track { background: #e2e8f0; border-radius: 4px; height: 6px; width: 120px; }
.plan-progress-fill { background: var(--brand); height: 6px; border-radius: 4px; transition: width .3s; }
.plan-ai-badge { font-size: 11px; font-weight: 600; background: #faf5ff; color: #7c3aed; padding: 3px 10px; border-radius: 20px; }
.plan-upgrade-link { font-size: 13px; font-weight: 600; color: var(--brand); text-decoration: none; }
.plan-upgrade-link:hover { text-decoration: underline; }
.plan-pricing-link { font-size: 12px; color: var(--text-muted); text-decoration: none; }
.plan-pricing-link:hover { color: var(--text); }

/* LIMIT BANNER */
.limit-banner { background: #faf5ff; border: 1px solid #ddd6fe; border-radius: var(--radius); padding: 12px 16px; font-size: 13px; color: #5b21b6; margin-bottom: 20px; }
.limit-banner a { color: #4f46e5; font-weight: 600; text-decoration: none; }
.limit-banner a:hover { text-decoration: underline; }
.limit-warning { background: #fffbeb; border-color: #fcd34d; color: #92400e; }
.limit-warning a { color: #d97706; }

/* CHECK CARDS */
.checks-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 40px; }
.check-card { background: white; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; display: flex; align-items: center; gap: 20px; transition: box-shadow .15s; }
.check-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.07); }
.check-card.card-compliant { border-left: 4px solid var(--success); }
.check-card.card-gaps { border-left: 4px solid var(--brand); }

/* Score ring */
.score-ring { width: 80px; height: 80px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; }
.score-ring.ready { background: #f0fdf4; border: 3px solid var(--success); }
.score-ring.warning { background: #fffbeb; border: 3px solid var(--warning); }
.score-ring.danger { background: #faf5ff; border: 3px solid var(--danger); }
.score-num { font-size: 18px; font-weight: 800; line-height: 1; }
.score-ring.ready .score-num { color: var(--success); }
.score-ring.warning .score-num { color: var(--warning); }
.score-ring.danger .score-num { color: var(--danger); }
.score-label { font-size: 10px; font-weight: 600; color: var(--text-muted); margin-top: 2px; }

.check-body { flex: 1; }
.check-title { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.check-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.meta-item { font-size: 13px; color: var(--text-muted); }
.badge { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
.badge-compliant { background: #dcfce7; color: #15803d; }
.badge-gaps { background: #ede9fe; color: #5b21b6; }
.badge-ai { background: #faf5ff; color: #7c3aed; }
.badge-keyword { background: #f1f5f9; color: var(--text-muted); }
.fw-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.fw-tag { font-size: 12px; background: #eef2ff; color: var(--brand); padding: 2px 8px; border-radius: 12px; }
.check-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; align-items: center; }

/* EMPTY STATE */
.empty-state { text-align: center; padding: 60px 24px; }
.empty-icon { font-size: 52px; margin-bottom: 16px; }
.empty-state h3 { font-size: 22px; font-weight: 600; margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); margin-bottom: 24px; }

/* FW INFO STRIP */
.fw-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 32px; }
.fw-card { background: white; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; gap: 12px; align-items: flex-start; }
.fw-icon { font-size: 24px; flex-shrink: 0; }
.fw-card strong { font-size: 14px; font-weight: 600; display: block; margin-bottom: 2px; }
.fw-card p { font-size: 12px; color: var(--text-muted); }

/* UPLOAD */
.upload-wrapper { display: flex; justify-content: center; padding: 32px 16px; }
.upload-card { background: white; border: 1px solid var(--border); border-radius: 16px; padding: 36px; width: 100%; max-width: 680px; box-shadow: 0 4px 24px rgba(0,0,0,0.06); }
.upload-title { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.upload-sub { color: var(--text-muted); font-size: 14px; margin-bottom: 28px; }
.upload-form { display: flex; flex-direction: column; gap: 20px; }
.file-drop { border: 2px dashed var(--border); border-radius: 12px; padding: 32px; text-align: center; cursor: pointer; transition: all .15s; }
.file-drop:hover, .file-drop.drag-over { border-color: var(--brand-light); background: #eef2ff; }
.file-drop.file-selected { border-color: var(--success); background: #f0fdf4; }
.file-icon { font-size: 36px; margin-bottom: 10px; }
.file-drop p { font-size: 14px; color: var(--text-muted); margin-bottom: 4px; }
.file-drop p:first-of-type { color: var(--text); }
.file-types { font-size: 12px; color: var(--text-muted); }

/* FRAMEWORK CHECKBOXES */
.fw-checkboxes { display: flex; flex-direction: column; gap: 10px; }
.fw-checkbox { cursor: pointer; }
.fw-checkbox input { display: none; }
.fw-checkbox-body { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 2px solid var(--border); border-radius: 10px; transition: all .15s; }
.fw-checkbox:hover .fw-checkbox-body { border-color: var(--brand-light); }
.fw-checkbox input:checked + .fw-checkbox-body { border-color: var(--brand); background: #eef2ff; }
.fw-checkbox-icon { font-size: 22px; flex-shrink: 0; margin-top: 2px; }
.fw-checkbox-body strong { font-size: 14px; font-weight: 600; display: block; margin-bottom: 2px; }
.fw-checkbox-body p { font-size: 13px; color: var(--text-muted); }
.btn-analyse:disabled { opacity: 0.6; cursor: default; }

/* RESULTS */
.results-header { margin-bottom: 24px; }
.results-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.results-title-row h1 { font-size: 26px; font-weight: 700; }
.results-meta { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.mode-ai { color: #7c3aed; font-weight: 600; }
.mode-kw { color: var(--text-muted); }

.verdict-card { border-radius: 14px; padding: 24px 28px; margin-bottom: 32px; display: flex; align-items: flex-start; gap: 24px; flex-wrap: wrap; }
.verdict-compliant { background: #f0fdf4; border: 2px solid var(--success); }
.verdict-gaps { background: #faf5ff; border: 2px solid var(--brand); }
.verdict-score { font-size: 56px; font-weight: 800; min-width: 100px; text-align: center; flex-shrink: 0; }
.verdict-compliant .verdict-score { color: var(--success); }
.verdict-gaps .verdict-score { color: var(--brand); }
.verdict-text h2 { font-size: 21px; font-weight: 700; margin-bottom: 8px; }
.verdict-text p { font-size: 14px; color: #374151; }

.section-heading { font-size: 19px; font-weight: 700; margin: 32px 0 14px; }

/* FW SCORES */
.fw-scores-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-bottom: 32px; }
.fw-score-card { background: white; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: flex; gap: 14px; align-items: flex-start; }
.fw-score-card.status-pass { border-left: 4px solid var(--success); }
.fw-score-card.status-warning { border-left: 4px solid var(--warning); }
.fw-score-card.status-fail { border-left: 4px solid var(--brand); }
.fw-score-icon { font-size: 28px; flex-shrink: 0; }
.fw-score-body { flex: 1; }
.fw-score-body h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.score-bar-wrap { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.score-bar { flex: 1; height: 8px; background: #e2e8f0; border-radius: 4px; }
.score-fill { height: 8px; border-radius: 4px; }
.fill-pass { background: var(--success); }
.fill-warning { background: var(--warning); }
.fill-fail { background: var(--brand); }
.score-pct { font-size: 14px; font-weight: 700; min-width: 36px; }
.fw-counts { display: flex; gap: 10px; font-size: 12px; font-weight: 600; }
.cnt-pass { color: var(--success); }
.cnt-partial { color: var(--warning); }
.cnt-fail { color: var(--brand); }

/* FINDINGS */
.fw-findings { margin-bottom: 32px; }
.fw-findings-title { font-size: 18px; font-weight: 700; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid var(--border); }
.findings-list { display: flex; flex-direction: column; gap: 10px; }
.finding-item { background: white; border-radius: var(--radius); padding: 14px 16px; border-left: 4px solid; }
.status-item-pass { border-color: var(--success); }
.status-item-partial { border-color: var(--warning); }
.status-item-fail { border-color: var(--brand); }
.finding-header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.finding-status { font-size: 16px; flex-shrink: 0; }
.finding-title { font-size: 14px; font-weight: 600; flex: 1; }
.finding-badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 12px; flex-shrink: 0; }
.badge-pass { background: #dcfce7; color: #15803d; }
.badge-partial { background: #fef3c7; color: #b45309; }
.badge-fail { background: #ede9fe; color: #5b21b6; }
.finding-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.finding-fix { font-size: 13px; color: var(--text-muted); background: #f8fafc; padding: 8px 12px; border-radius: 6px; line-height: 1.6; }
.fix-label { font-weight: 600; color: var(--brand-dark); margin-right: 4px; }

.mode-notice { background: #f1f5f9; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; font-size: 13px; color: var(--text-muted); margin-top: 24px; }
.mode-notice strong { color: var(--text); }
.mode-notice a { color: var(--brand); }

@media (max-width: 768px) {
    .fw-strip { grid-template-columns: 1fr 1fr; }
    .fw-scores-grid { grid-template-columns: 1fr; }
    .check-card { flex-wrap: wrap; }
    .verdict-card { flex-direction: column; }
    .results-title-row { flex-direction: column; }
}
@media (max-width: 480px) { .fw-strip { grid-template-columns: 1fr; } }
