/* ─────────────────────────────────────────────────────────────
   Attest AI · Design System
   Stripe Dashboard + Linear 톤 · 전문 B2B SaaS
   ───────────────────────────────────────────────────────────── */

/* ── Tokens ─────────────────────────────────────────────────── */
:root {
  /* Surface */
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --bg-subtle: #f5f5f7;
  --surface-card: #ffffff;
  --surface-raised: #ffffff;
  --border: #e5e5e7;
  --border-strong: #d2d2d7;
  --border-subtle: #f0f0f2;

  /* Text */
  --text: #1d1d1f;
  --text-secondary: #515154;
  --text-muted: #86868b;
  --text-faint: #b8b8bd;

  /* Brand */
  --brand: #0066ff;
  --brand-hover: #0052cc;
  --brand-soft: #e6f0ff;
  --brand-faint: #f5f9ff;

  /* Semantic */
  --success: #1f7a3d;
  --success-soft: #ebf6ee;
  --warning: #b26b00;
  --warning-soft: #fbf4e5;
  --danger: #c4302b;
  --danger-soft: #fbeae9;
  --info: #0066ff;

  /* Shadows (Stripe-like depth) */
  --shadow-xs: 0 1px 1px rgba(0, 0, 0, 0.03);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.04), 0 8px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08), 0 16px 48px rgba(0, 0, 0, 0.06);

  /* Type */
  --font-sans: 'Inter', 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;

  /* Radius */
  --r-sm: 6px;
  --r: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;

  /* Layout */
  --header-h: 64px;
  --sidebar-w: 248px;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01';
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img, svg { display: block; max-width: 100%; }
ul, ol { list-style: none; }

/* ── Typography ─────────────────────────────────────────────── */
.h-display { font-size: 64px; font-weight: 600; line-height: 1.05; letter-spacing: -0.025em; color: var(--text); }
.h-display-sm { font-size: 48px; font-weight: 600; line-height: 1.08; letter-spacing: -0.02em; color: var(--text); }
.h1 { font-size: 36px; font-weight: 600; line-height: 1.15; letter-spacing: -0.018em; color: var(--text); }
.h2 { font-size: 24px; font-weight: 600; line-height: 1.25; letter-spacing: -0.012em; color: var(--text); }
.h3 { font-size: 18px; font-weight: 600; line-height: 1.35; letter-spacing: -0.005em; color: var(--text); }
.h4 { font-size: 16px; font-weight: 600; line-height: 1.4; color: var(--text); }
.body { font-size: 14px; line-height: 1.55; color: var(--text); }
.body-lg { font-size: 16px; line-height: 1.55; color: var(--text); }
.body-sm { font-size: 13px; line-height: 1.5; color: var(--text-secondary); }
.caption { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.mono { font-family: var(--font-mono); font-size: 12px; }
.muted { color: var(--text-muted); }
.secondary { color: var(--text-secondary); }
.brand { color: var(--brand); }

/* ── Layout primitives ──────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
.container-narrow { max-width: 880px; margin: 0 auto; padding: 0 32px; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.gap-4 { gap: 16px; } .gap-5 { gap: 20px; } .gap-6 { gap: 24px; }
.gap-8 { gap: 32px; } .gap-10 { gap: 40px; } .gap-12 { gap: 48px; }
.grid { display: grid; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grow { flex: 1; } .shrink-0 { flex-shrink: 0; }

/* spacing utility */
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; }
.mt-10 { margin-top: 40px; } .mt-12 { margin-top: 48px; } .mt-16 { margin-top: 64px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; } .mb-8 { margin-bottom: 32px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; } .py-4 { padding-top: 16px; padding-bottom: 16px; }
.py-6 { padding-top: 24px; padding-bottom: 24px; } .py-8 { padding-top: 32px; padding-bottom: 32px; }
.py-12 { padding-top: 48px; padding-bottom: 48px; } .py-16 { padding-top: 64px; padding-bottom: 64px; }
.py-20 { padding-top: 80px; padding-bottom: 80px; } .py-24 { padding-top: 96px; padding-bottom: 96px; }

/* ── App shell (portal/review) ──────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.shell .sidebar {
  background: var(--bg-soft);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
}
.shell .main { padding: 32px 40px; min-width: 0; }

.brand-mark {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 12px; margin-bottom: 24px;
  font-weight: 600; font-size: 16px; letter-spacing: -0.01em;
  color: var(--text);
}
.brand-mark .dot {
  width: 24px; height: 24px;
  background: var(--text);
  border-radius: 6px;
  display: grid; place-items: center;
  color: white; font-weight: 700; font-size: 14px;
}

.nav-section { margin-top: 4px; }
.nav-section-label {
  padding: 12px 12px 6px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.05em;
  color: var(--text-muted); text-transform: uppercase;
}
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px; border-radius: var(--r-sm);
  color: var(--text-secondary);
  font-size: 13.5px; font-weight: 500;
  transition: background 0.12s, color 0.12s;
}
.nav-link:hover { background: var(--bg-subtle); color: var(--text); }
.nav-link.active { background: var(--text); color: white; }
.nav-link.active:hover { background: var(--text); }
.nav-link .icon { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.85; }
.nav-link.active .icon { opacity: 1; }
.nav-link .badge { margin-left: auto; font-size: 11px; padding: 1px 7px; border-radius: 10px; background: var(--bg-subtle); color: var(--text-secondary); font-weight: 600; }
.nav-link.active .badge { background: rgba(255,255,255,0.18); color: white; }

.user-card {
  margin-top: auto;
  padding: 12px;
  border-radius: var(--r);
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand); color: white;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 600;
}
.user-card .info { flex: 1; min-width: 0; }
.user-card .name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card .role { font-size: 11px; color: var(--text-muted); }

/* ── Top bar ────────────────────────────────────────────────── */
.topbar {
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  display: flex; align-items: center;
  padding: 0 32px;
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: saturate(180%) blur(20px);
  background: rgba(255,255,255,0.85);
}
.topbar .container { display: flex; align-items: center; justify-content: space-between; padding: 0; max-width: 100%; width: 100%; }
.topbar nav { display: flex; gap: 4px; align-items: center; }
.topbar nav a {
  padding: 7px 12px; border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 500; color: var(--text-secondary);
  transition: background 0.1s, color 0.1s;
}
.topbar nav a:hover { background: var(--bg-subtle); color: var(--text); }
.topbar nav a.active { color: var(--text); font-weight: 600; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 500;
  border: 1px solid transparent;
  transition: all 0.12s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--text); color: white; border-color: var(--text); }
.btn-primary:hover { background: #2c2c2e; border-color: #2c2c2e; }
.btn-secondary { background: var(--bg); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-xs); }
.btn-secondary:hover { background: var(--bg-soft); border-color: var(--text-muted); }
.btn-brand { background: var(--brand); color: white; }
.btn-brand:hover { background: var(--brand-hover); }
.btn-ghost { color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-subtle); color: var(--text); }
.btn-lg { padding: 10px 18px; font-size: 14.5px; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 24px;
}
.card.dense { padding: 16px; }
.card-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; }
.card-row + .card-row { border-top: 1px solid var(--border-subtle); }

/* KPI */
.kpi {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px;
  display: flex; flex-direction: column; gap: 6px;
}
.kpi .label { font-size: 12px; font-weight: 500; color: var(--text-muted); letter-spacing: 0.02em; }
.kpi .value { font-size: 28px; font-weight: 600; line-height: 1.1; letter-spacing: -0.018em; color: var(--text); font-feature-settings: 'tnum'; }
.kpi .delta { font-size: 12px; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.kpi .delta.up { color: var(--success); }
.kpi .delta.down { color: var(--danger); }
.kpi .delta.flat { color: var(--text-muted); }

/* ── Pills / Badges ─────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 20px;
  font-size: 11.5px; font-weight: 500;
  white-space: nowrap;
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.pill.pass { background: var(--success-soft); color: var(--success); }
.pill.pass::before { background: var(--success); }
.pill.warn { background: var(--warning-soft); color: var(--warning); }
.pill.warn::before { background: var(--warning); }
.pill.fail { background: var(--danger-soft); color: var(--danger); }
.pill.fail::before { background: var(--danger); }
.pill.info { background: var(--brand-soft); color: var(--brand); }
.pill.info::before { background: var(--brand); }
.pill.ghost { background: var(--bg-subtle); color: var(--text-secondary); }
.pill.ghost::before { background: var(--text-faint); }

.tag {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 500;
  background: var(--bg-subtle); color: var(--text-secondary);
}

/* ── Table ──────────────────────────────────────────────────── */
.table-wrap { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table thead th {
  text-align: left; padding: 10px 16px;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--text-muted);
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}
.table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--bg-soft); }
.table .num { text-align: right; font-feature-settings: 'tnum'; font-variant-numeric: tabular-nums; }
.table .center { text-align: center; }

/* ── Score bar ──────────────────────────────────────────────── */
.bar { display: inline-block; height: 6px; background: var(--bg-subtle); border-radius: 3px; overflow: hidden; vertical-align: middle; min-width: 80px; }
.bar > i { display: block; height: 100%; background: var(--text); border-radius: 3px; }
.bar.pass > i { background: var(--success); }
.bar.warn > i { background: var(--warning); }
.bar.fail > i { background: var(--danger); }

/* ── Form ───────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 500; color: var(--text-secondary); }
.input, .textarea, .select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--bg);
  color: var(--text);
  font-family: inherit; font-size: 14px;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-faint); }
.textarea { resize: vertical; min-height: 80px; line-height: 1.5; }

/* ── Hero (landing) ─────────────────────────────────────────── */
.hero {
  padding: 96px 0 80px;
  text-align: left;
  background: linear-gradient(180deg, #fafafa 0%, #ffffff 60%);
  border-bottom: 1px solid var(--border-subtle);
}
.hero h1 { font-size: 64px; font-weight: 600; line-height: 1.04; letter-spacing: -0.028em; max-width: 14ch; }
.hero .lead { font-size: 18px; line-height: 1.55; color: var(--text-secondary); margin-top: 24px; max-width: 56ch; }
.hero .cta-row { display: flex; gap: 12px; margin-top: 36px; }

/* Marketing section */
.section-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; color: var(--brand); text-transform: uppercase; }
.section-title { font-size: 40px; font-weight: 600; line-height: 1.12; letter-spacing: -0.022em; margin-top: 12px; max-width: 22ch; }
.section-lead { font-size: 16px; color: var(--text-secondary); margin-top: 16px; max-width: 60ch; }

/* Feature card (landing) */
.feature {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg);
  transition: border-color 0.15s;
}
.feature:hover { border-color: var(--text-muted); }
.feature .icon-box {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center;
  font-size: 18px; font-weight: 600;
  margin-bottom: 16px;
}
.feature h3 { font-size: 18px; font-weight: 600; }
.feature p { color: var(--text-secondary); margin-top: 8px; line-height: 1.55; }

/* Step cards (4-step flow) */
.step-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; counter-reset: step; }
.step {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg);
  position: relative;
}
.step .num {
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 600;
  color: var(--brand);
  letter-spacing: 0.08em;
}
.step h4 { font-size: 16px; font-weight: 600; margin-top: 8px; }
.step p { font-size: 13px; color: var(--text-secondary); margin-top: 8px; line-height: 1.55; }

/* Stat strip */
.stat-strip {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stat-strip .stat {
  padding: 32px 24px;
  border-right: 1px solid var(--border-subtle);
}
.stat-strip .stat:last-child { border-right: none; }
.stat-strip .stat .v { font-size: 32px; font-weight: 600; letter-spacing: -0.018em; font-feature-settings: 'tnum'; }
.stat-strip .stat .k { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ── Page header (portal/review) ────────────────────────────── */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; gap: 24px; }
.page-head .titles h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.012em; }
.page-head .titles p { color: var(--text-secondary); font-size: 14px; margin-top: 4px; }
.page-head .actions { display: flex; gap: 8px; }

/* Section breadcrumb */
.crumbs { font-size: 12px; color: var(--text-muted); display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.crumbs span { color: var(--text-faint); }

/* ── Reviewer specific ──────────────────────────────────────── */
.review-shell { display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: flex-start; }
.review-sample {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 24px;
}
.review-sample .sample-text {
  background: var(--bg-soft);
  border-left: 3px solid var(--brand);
  padding: 16px 20px;
  border-radius: var(--r-sm);
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text);
  margin-top: 12px;
}
.review-criteria {
  display: grid; grid-template-columns: 1fr; gap: 12px;
  margin-top: 20px;
}
.review-row {
  display: grid;
  grid-template-columns: 140px 1fr 80px 56px;
  gap: 16px;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}
.review-row .label { font-weight: 500; font-size: 13.5px; }
.review-row .reason { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; }
.review-row .score { font-feature-settings: 'tnum'; font-weight: 600; text-align: right; }

.review-form {
  position: sticky; top: calc(var(--header-h) + 24px);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
}
.review-form h4 { font-size: 14px; font-weight: 600; }

.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choice {
  padding: 10px 8px; text-align: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  font-size: 12.5px; font-weight: 500;
  background: var(--bg);
  cursor: pointer;
  transition: all 0.12s;
  user-select: none;
}
.choice:hover { background: var(--bg-soft); }
.choice.selected.agree { background: var(--success-soft); color: var(--success); border-color: var(--success); }
.choice.selected.disagree { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.choice.selected.neutral { background: var(--bg-subtle); color: var(--text); border-color: var(--text-muted); }

.score-radio { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.score-radio button {
  padding: 8px 0; border-radius: var(--r-sm);
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  border: 1px solid var(--border-strong);
  background: var(--bg); color: var(--text-secondary);
  transition: all 0.12s;
}
.score-radio button:hover { background: var(--bg-soft); }
.score-radio button.active { background: var(--text); color: white; border-color: var(--text); }

/* ── Footer ─────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 48px 0;
  background: var(--bg);
  margin-top: 64px;
}
.footer .container { display: flex; align-items: center; justify-content: space-between; }
.footer .copy { font-size: 12.5px; color: var(--text-muted); }
.footer nav { display: flex; gap: 24px; }
.footer nav a { font-size: 12.5px; color: var(--text-secondary); }
.footer nav a:hover { color: var(--text); }

/* ── Misc ───────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 24px 0; }
.code-snippet {
  background: #0f0f10;
  color: #e6e6e8;
  padding: 16px 20px;
  border-radius: var(--r-md);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
  overflow-x: auto;
}
.code-snippet .k { color: #c792ea; }
.code-snippet .s { color: #c3e88d; }
.code-snippet .n { color: #f78c6c; }
.code-snippet .c { color: #5f5f6e; font-style: italic; }

/* highlight band */
.band {
  background: var(--bg-soft);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

/* timeline (history) */
.timeline-row {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
  align-items: center;
}
.timeline-row .when { font-size: 12px; color: var(--text-muted); font-feature-settings: 'tnum'; }
.timeline-row .what { font-size: 13.5px; }
.timeline-row .who { font-size: 12px; color: var(--text-muted); }

/* Avatar group */
.avatars { display: inline-flex; }
.avatars .av {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600;
  border: 2px solid var(--bg);
  margin-left: -6px;
}
.avatars .av:first-child { margin-left: 0; }
