/* ClaimlyAI design system — self-contained, no external fonts/CDN. */

:root {
  color-scheme: light dark;

  --bg: #f7f9fb;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --text: #0f172a;
  --text-muted: #5b6675;
  --border: #e2e8f0;

  --primary: #0e7490;
  --primary-dark: #0b5a6c;
  --primary-tint: #e0f2f4;

  --accent: #b45309;
  --accent-tint: #fef3e2;

  --danger: #b91c1c;
  --danger-tint: #fdecec;
  --warn: #b45309;
  --warn-tint: #fef3e2;
  --info: #1d4ed8;
  --info-tint: #eaf0fe;
  --success: #047857;
  --success-tint: #e7f6f0;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
  --radius: 10px;
  --radius-lg: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --surface: #121b2d;
    --surface-raised: #16233a;
    --text: #e8edf5;
    --text-muted: #93a1b7;
    --border: #253249;

    --primary: #2dd4d4;
    --primary-dark: #1fb3b3;
    --primary-tint: #103539;

    --accent: #f3b463;
    --accent-tint: #2e2110;

    --danger: #f87171;
    --danger-tint: #2a1414;
    --warn: #f3b463;
    --warn-tint: #2e2110;
    --info: #7fa8ff;
    --info-tint: #14203f;
    --success: #4ade80;
    --success-tint: #103524;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-narrow {
  max-width: 620px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

@media (max-width: 480px) {
  .container, .container-narrow { padding: 0 1rem; }
  .nav-links { gap: 0.85rem; }
  .btn { padding: 0.55rem 0.9rem; font-size: 0.88rem; }
  .brand { font-size: 1rem; }
}

/* --- Site header / nav --- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.site-header .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}

.brand .mark {
  width: 30px;
  height: 30px;
  object-fit: contain;
  display: inline-block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links a, .nav-links button.linklike {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  padding: 0;
}

.nav-links a:hover, .nav-links button.linklike:hover { color: var(--text); }

.site-footer {
  margin-top: 4rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* --- Buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.05s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

.btn-block { width: 100%; }

/* --- Cards / surfaces --- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.75rem;
}

.auth-shell {
  min-height: calc(100vh - 130px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
}

.auth-card h1 {
  font-size: 1.4rem;
  margin: 0 0 0.25rem;
}

.auth-card .sub {
  color: var(--text-muted);
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
}

.auth-switch {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* --- Forms --- */

.field { margin-bottom: 1.1rem; }

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="file"] {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
}

.field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-tint);
}

.field .help {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.errorlist {
  list-style: none;
  padding: 0;
  margin: 0.3rem 0 0;
  color: var(--danger);
  font-size: 0.85rem;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  background: var(--info-tint);
  color: var(--text);
  border: 1px solid var(--border);
}

/* --- Hero (home page) --- */

.hero {
  padding: 5rem 0 4rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.15;
  margin: 0 0 1.1rem;
  letter-spacing: -0.01em;
}

.hero .tagline-accent { color: var(--primary); }

.hero p.lede {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 2rem;
}

.hero .cta-row {
  display: flex;
  gap: 0.85rem;
  justify-content: center;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--primary-tint);
  color: var(--primary-dark);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin: 3rem 0;
}

.feature-grid .card h3 {
  margin: 0.75rem 0 0.5rem;
  font-size: 1.05rem;
}

.feature-grid .card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0;
}

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.icon-danger { background: var(--danger-tint); }
.icon-accent { background: var(--accent-tint); }
.icon-primary { background: var(--primary-tint); }

/* --- App shell (upload/report pages) --- */

.page-header {
  margin: 2rem 0 1.5rem;
}

.page-header h1 {
  font-size: 1.5rem;
  margin: 0 0 0.3rem;
}

.page-header p {
  color: var(--text-muted);
  margin: 0;
}

/* --- Stat tiles (report page) --- */

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2rem;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}

.stat .value {
  font-size: 1.6rem;
  font-weight: 700;
  display: block;
  letter-spacing: -0.01em;
}

.stat .label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stat.stat-danger .value { color: var(--danger); }
.stat.stat-accent .value { color: var(--accent); }

/* --- Claim cards --- */

.claim-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 0.85rem;
}

.claim-card .claim-title {
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.claim-card .finding {
  padding: 0.6rem 0;
  border-top: 1px solid var(--border);
}
.claim-card .finding:first-of-type { border-top: none; }

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  margin-right: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge.block, .badge.underpaid, .badge.downcode_suspected { background: var(--danger-tint); color: var(--danger); }
.badge.warn { background: var(--warn-tint); color: var(--warn); }
.badge.info { background: var(--info-tint); color: var(--info); }

/* --- Tables --- */

table.data-table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
  font-size: 0.9rem;
}

table.data-table th, table.data-table td {
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--border);
}

table.data-table th {
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 600;
}

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

details.intake-notes {
  margin: 0.5rem 0 1.5rem;
  font-size: 0.88rem;
}
details.intake-notes summary {
  cursor: pointer;
  color: var(--text-muted);
}
