/* ─── Auth ──────────────────────────────────────────────────────────────────── */

.auth-container {
  min-height: calc(100vh - 56px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
}

.auth-header { margin-bottom: 2rem; }

.auth-title {
  font-family: 'Fraunces', serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.auth-sub { font-size: 0.9rem; color: var(--fg-muted); }

.auth-form { display: flex; flex-direction: column; gap: 1.25rem; }

.auth-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--fg-muted);
}

.auth-footer a { color: var(--accent); text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }

/* ─── Forms ──────────────────────────────────────────────────────────────────── */

.form-group { display: flex; flex-direction: column; gap: 0.4rem; }

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--fg-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.form-input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: var(--fg);
  font-size: 0.95rem;
  font-family: 'DM Sans', system-ui, sans-serif;
  transition: border-color 0.2s;
  width: 100%;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
}

.form-input-lg { font-size: 1rem; padding: 0.9rem 1rem; }

.form-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: #ef4444;
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}

/* ─── Buttons ───────────────────────────────────────────────────────────────── */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #0f0f0f;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
  font-family: 'DM Sans', system-ui, sans-serif;
  gap: 0.5rem;
}

.btn-primary:hover { opacity: 0.85; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-lg { padding: 1rem 2rem; font-size: 1rem; border-radius: 10px; }
.btn-sm { padding: 0.4rem 1rem; font-size: 0.8rem; }

.nav-link {
  font-size: 0.875rem;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-link:hover { color: var(--fg); }

/* ─── Page container ─────────────────────────────────────────────────────────── */

.page-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

/* ─── Dashboard ──────────────────────────────────────────────────────────────── */

.dashboard-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.dashboard-title {
  font-family: 'Fraunces', serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.02em;
}

.dashboard-sub { font-size: 0.95rem; color: var(--fg-muted); margin-top: 0.5rem; }

.subscription-badge {
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-active { background: rgba(34, 197, 94, 0.15); color: #22c55e; border: 1px solid rgba(34, 197, 94, 0.3); }
.badge-trial  { background: rgba(245, 158, 11, 0.12); color: var(--accent); border: 1px solid rgba(245, 158, 11, 0.3); }

/* ─── Empty state ────────────────────────────────────────────────────────────── */

.empty-state { text-align: center; padding: 4rem 0; }
.empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-title { font-family: 'Fraunces', serif; font-size: 1.5rem; font-weight: 700; color: var(--fg); margin-bottom: 0.75rem; }
.empty-body { font-size: 0.95rem; color: var(--fg-muted); margin-bottom: 2rem; }

/* ─── Audit list ─────────────────────────────────────────────────────────────── */

.audit-list { display: flex; flex-direction: column; gap: 0.75rem; }

.audit-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
  flex-wrap: wrap;
}

.audit-card:hover { border-color: var(--accent); background: var(--surface-2); }

.audit-card-left { min-width: 0; }
.audit-repo { font-size: 0.95rem; font-weight: 600; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 400px; }
.audit-date { font-size: 0.8rem; color: var(--fg-muted); margin-top: 0.25rem; }

.severity-pills { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

.pill {
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.pill-critical { background: rgba(239,68,68,0.15); color: #ef4444; border: 1px solid rgba(239,68,68,0.25); }
.pill-high     { background: rgba(249,115,22,0.15); color: #f97316; border: 1px solid rgba(249,115,22,0.25); }
.pill-medium   { background: rgba(245,158,11,0.12); color: var(--accent); border: 1px solid rgba(245,158,11,0.25); }
.pill-low      { background: rgba(34,197,94,0.10); color: #22c55e; border: 1px solid rgba(34,197,94,0.2); }
.pill-pending  { background: var(--surface-2); color: var(--fg-muted); border: 1px solid var(--border); }
.pill-failed   { background: rgba(239,68,68,0.10); color: #ef4444; }

/* ─── New audit ──────────────────────────────────────────────────────────────── */

.new-audit-header { margin-bottom: 2rem; }

.audit-form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
}

.audit-form { display: flex; flex-direction: column; gap: 1.5rem; }

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem;
  text-align: center;
  color: var(--fg-muted);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Audit result ──────────────────────────────────────────────────────────── */

.result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.result-repo {
  font-family: 'Fraunces', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.02em;
  word-break: break-all;
}

.result-date { font-size: 0.8rem; color: var(--fg-muted); margin-top: 0.25rem; }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
}

.summary-card.summary-critical { border-color: rgba(239,68,68,0.4); background: rgba(239,68,68,0.05); }
.summary-card.summary-high     { border-color: rgba(249,115,22,0.3); background: rgba(249,115,22,0.03); }
.summary-card.summary-medium   { border-color: rgba(245,158,11,0.2); }
.summary-card.summary-low      { border-color: rgba(34,197,94,0.15); }

.summary-num {
  font-family: 'Fraunces', serif;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--fg);
  line-height: 1;
  margin-bottom: 0.35rem;
}

.summary-label { font-size: 0.75rem; color: var(--fg-muted); letter-spacing: 0.08em; text-transform: uppercase; }

.issues-list { display: flex; flex-direction: column; gap: 1rem; }

.issue-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.issue-card.issue-critical { border-color: rgba(239,68,68,0.3); }
.issue-card.issue-high     { border-color: rgba(249,115,22,0.25); }
.issue-card.issue-medium   { border-color: rgba(245,158,11,0.2); }
.issue-card.issue-low      { border-color: rgba(34,197,94,0.15); }

.issue-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; flex-wrap: wrap; }

.issue-severity {
  padding: 0.15rem 0.5rem;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.issue-severity.issue-critical { background: rgba(239,68,68,0.15); color: #ef4444; }
.issue-severity.issue-high     { background: rgba(249,115,22,0.15); color: #f97316; }
.issue-severity.issue-medium   { background: rgba(245,158,11,0.12); color: var(--accent); }
.issue-severity.issue-low      { background: rgba(34,197,94,0.10); color: #22c55e; }

.issue-title { font-size: 1rem; font-weight: 700; color: var(--fg); }
.issue-desc { font-size: 0.9rem; color: var(--fg-muted); line-height: 1.6; margin-bottom: 1rem; }

.issue-dev { margin-top: 0.75rem; }
.issue-dev-badge { font-size: 0.8rem; color: var(--fg-muted); background: var(--surface-2); padding: 0.3rem 0.75rem; border-radius: 6px; display: inline-block; }

.issue-fix { margin-top: 1rem; background: rgba(34,197,94,0.06); border: 1px solid rgba(34,197,94,0.15); border-radius: 8px; padding: 1rem; }
.issue-fix-label { font-size: 0.72rem; font-weight: 700; color: #22c55e; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.4rem; }
.issue-fix-body { font-size: 0.875rem; color: var(--fg-muted); line-height: 1.65; }

/* ─── Success page ──────────────────────────────────────────────────────────── */

.success-card { text-align: center; padding: 3rem 0; max-width: 480px; margin: 0 auto; }
.success-icon { font-size: 3.5rem; margin-bottom: 1.5rem; }
.success-title { font-family: 'Fraunces', serif; font-size: 2rem; font-weight: 700; color: var(--fg); letter-spacing: -0.02em; margin-bottom: 1rem; }
.success-body { font-size: 0.95rem; color: var(--fg-muted); margin-bottom: 2rem; line-height: 1.65; }

/* ─── Responsive ─────────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .audit-repo { max-width: 200px; }
  .page-container { padding: 2rem 1rem; }
}

@media (max-width: 480px) {
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .audit-card { flex-direction: column; align-items: flex-start; }
}