/* Dashboard Styles */

/* Auth */
.auth-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg-subtle); }
.auth-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 40px 36px; width: 100%; max-width: 400px; }
.auth-brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; margin-bottom: 28px; justify-content: center; text-decoration: none; color: inherit; }
.auth-card h2 { font-size: 20px; margin-bottom: 20px; }
.auth-card label { display: block; font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 16px; }
.auth-card input { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; }
.auth-card input:focus { outline: none; border-color: var(--accent); }
.auth-card .btn { margin-top: 8px; }
.auth-toggle { font-size: 13px; color: var(--text-secondary); text-align: center; margin-top: 16px; }
.auth-toggle a { color: var(--accent); text-decoration: none; }
.auth-error { background: var(--critical-bg); color: var(--critical); padding: 10px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 16px; }

/* Dashboard layout */
.dash-container { max-width: 960px; margin: 0 auto; padding: 32px 24px; }
.plan-badge { font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: var(--radius); background: var(--accent-light); color: var(--accent); text-transform: capitalize; }
.scan-count { font-size: 13px; color: var(--text-muted); }
.nav-user { font-size: 13px; font-weight: 500; }

/* Upload */
.upload-area { margin-bottom: 32px; }
.upload-inner {
  border: 2px dashed var(--border); border-radius: var(--radius-lg);
  padding: 48px 24px; text-align: center; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.upload-inner:hover, .upload-inner.drag-over { border-color: var(--accent); background: var(--accent-light); }
.upload-icon { color: var(--text-muted); margin-bottom: 12px; }
.upload-inner h3 { font-size: 16px; margin-bottom: 6px; }
.upload-inner p { font-size: 14px; color: var(--text-secondary); margin-bottom: 16px; }

/* Progress */
.scan-progress { margin-bottom: 32px; }
.progress-inner { text-align: center; padding: 48px 24px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-subtle); }
.progress-inner h3 { font-size: 16px; margin-bottom: 6px; }
.progress-inner p { font-size: 14px; color: var(--text-secondary); }
.spinner {
  width: 36px; height: 36px; border: 3px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Results */
.results-panel { margin-bottom: 32px; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.results-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.results-header h3 { font-size: 15px; }
.result-meta { font-size: 12px; color: var(--text-muted); }
.results-actions { display: flex; gap: 8px; }

.risk-banner { padding: 16px 20px; display: flex; align-items: center; gap: 12px; }
.risk-banner.high { background: var(--critical-bg); }
.risk-banner.medium { background: var(--warning-bg); }
.risk-banner.low { background: var(--success-bg); }
.risk-level { font-size: 20px; font-weight: 700; text-transform: capitalize; }
.risk-banner.high .risk-level { color: var(--critical); }
.risk-banner.medium .risk-level { color: var(--warning); }
.risk-banner.low .risk-level { color: var(--success); }
.risk-summary { font-size: 13px; color: var(--text-secondary); }

/* Short results disclaimer — always visible at the top of results */
.scan-disclaimer-short {
  margin: 0; padding: 12px 20px; background: var(--warning-bg);
  border-bottom: 1px solid var(--border);
  font-size: 12px; line-height: 1.5; color: var(--text-secondary);
}

.jurisdiction-notice {
  margin: 0; padding: 14px 20px; background: var(--info-bg); border-bottom: 1px solid var(--border);
}
.jurisdiction-notice strong { font-size: 13px; color: var(--info); }
.jurisdiction-notice p { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.jurisdiction-notice a { color: var(--accent); font-weight: 500; }

.truncation-notice {
  margin: 0; padding: 14px 20px; background: var(--warning-bg); border-bottom: 1px solid var(--border);
}
.truncation-notice strong { font-size: 13px; color: var(--warning); }
.truncation-notice p { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.truncation-notice a { color: var(--accent); font-weight: 500; }

.issues-list { padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; }

.issue-card { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); }
.issue-card.critical { border-left: 3px solid var(--critical); }
.issue-card.warning { border-left: 3px solid var(--warning); }
.issue-card.info { border-left: 3px solid var(--info); }

.issue-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.issue-severity {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  padding: 2px 6px; border-radius: 3px;
}
.issue-severity.critical { background: var(--critical-bg); color: var(--critical); }
.issue-severity.warning { background: var(--warning-bg); color: #854F0B; }
.issue-severity.info { background: var(--info-bg); color: #0C447C; }
.issue-title { font-size: 13px; font-weight: 600; }
.issue-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.issue-excerpt { font-size: 12px; background: var(--bg-subtle); padding: 8px 10px; border-radius: 4px; margin-top: 8px; font-style: italic; color: var(--text-secondary); }
.issue-suggestion { font-size: 12px; color: var(--accent); margin-top: 6px; }
.issue-suggestion strong { font-weight: 600; }
.issue-language { font-size: 12px; background: var(--success-bg); border-left: 3px solid var(--success); padding: 8px 10px; margin-top: 8px; color: var(--text); }
.issue-language-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 10px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--success); margin-bottom: 4px; }
.copy-lang-btn {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px;
  font-size: 10px; font-weight: 600; font-family: inherit; letter-spacing: 0.02em;
  color: var(--success); background: none; border: 1px solid var(--success);
  border-radius: 4px; cursor: pointer; text-transform: none;
}
.copy-lang-btn:hover { background: var(--success); color: #fff; }
.copy-lang-btn.copied { background: var(--success); color: #fff; }

/* History */
.history-section { margin-bottom: 32px; }
.history-section h3 { font-size: 16px; margin-bottom: 12px; }
.history-list { display: flex; flex-direction: column; gap: 8px; }
.empty-state { font-size: 14px; color: var(--text-muted); padding: 24px; text-align: center; border: 1px dashed var(--border); border-radius: var(--radius); }

.history-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer;
  transition: background 0.1s;
}
.history-item:hover { background: var(--bg-subtle); }
.history-item-name { font-size: 14px; font-weight: 500; }
.history-item-meta { font-size: 12px; color: var(--text-muted); }
.history-risk { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: var(--radius); text-transform: capitalize; }
.history-risk.high { background: var(--critical-bg); color: var(--critical); }
.history-risk.medium { background: var(--warning-bg); color: #854F0B; }
.history-risk.low { background: var(--success-bg); color: var(--success); }
.history-risk.pending { background: var(--bg-subtle); color: var(--text-muted); }

/* Upgrade banner */
.upgrade-banner {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px; background: var(--accent-light); border-radius: var(--radius-lg);
}
.upgrade-banner strong { font-size: 15px; }
.upgrade-banner p { font-size: 13px; color: var(--accent); margin-top: 4px; }

/* Dark mode */
[data-theme="dark"] .auth-screen { background: var(--bg); }
[data-theme="dark"] .auth-card { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .auth-card input { background: #0f172a; color: var(--text); border-color: #334155; }
[data-theme="dark"] .auth-card input:focus { border-color: var(--accent); }

[data-theme="dark"] .upload-inner { border-color: #334155; }
[data-theme="dark"] .upload-inner:hover,
[data-theme="dark"] .upload-inner.drag-over { border-color: var(--accent); background: rgba(59,130,246,0.08); }

[data-theme="dark"] .progress-inner { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .spinner { border-color: #334155; border-top-color: var(--accent); }

[data-theme="dark"] .results-panel { border-color: #334155; }
[data-theme="dark"] .results-header { border-bottom-color: #334155; }
[data-theme="dark"] .issue-card { border-color: #334155; }
[data-theme="dark"] .issue-excerpt { background: #1e293b; }
[data-theme="dark"] .issue-language { background: rgba(34,197,94,0.08); }
[data-theme="dark"] .scan-disclaimer-short { background: rgba(217,119,6,0.08); border-bottom-color: #334155; }
[data-theme="dark"] .jurisdiction-notice { background: rgba(96,165,250,0.08); border-bottom-color: #334155; }
[data-theme="dark"] .truncation-notice { background: rgba(217,119,6,0.08); border-bottom-color: #334155; }

[data-theme="dark"] .history-item { border-color: #334155; }
[data-theme="dark"] .history-item:hover { background: #1e293b; }
[data-theme="dark"] .history-risk.pending { background: #1e293b; }

[data-theme="dark"] .upgrade-banner { background: rgba(59,130,246,0.1); }
[data-theme="dark"] .plan-badge { background: rgba(59,130,246,0.15); }

[data-theme="dark"] .empty-state { border-color: #334155; }

@media (max-width: 768px) {
  .dash-container { padding: 20px 16px; }
  .results-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .upgrade-banner { flex-direction: column; gap: 12px; text-align: center; }
  .auth-card { padding: 28px 20px; margin: 0 16px; }
  .upload-inner { padding: 32px 16px; }
  .upload-inner h3 { font-size: 14px; }
  .issues-list { padding: 12px 14px; }
  .issue-header { flex-wrap: wrap; }
  .issue-title { font-size: 12px; }
  .history-item { flex-direction: column; align-items: flex-start; gap: 6px; }
  .risk-level { font-size: 16px; }
  .risk-banner { flex-direction: column; align-items: flex-start; gap: 4px; }
  .nav-user { display: none; }
}

.issue-language-note { display: block; font-size: 11px; color: var(--text-muted); font-style: italic; margin-top: 6px; }
