/* ===========================================================
   Krasikov.uk Client Portal — shared styles
   Drop this file alongside index.html and the doc pages.
   =========================================================== */

:root {
  --bg: #f7f5f0;
  --card: #ffffff;
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --line: #e6e2da;
  --accent: #c2410c;
  --accent-soft: #fff1ea;
  --good: #15803d;
  --good-soft: #dcfce7;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --info: #1e40af;
  --info-soft: #dbeafe;
  --bad: #b91c1c;
  --bad-soft: #fee2e2;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Top bar (consistent across all pages) ---------- */
.topbar {
  background: white;
  border-bottom: 1px solid var(--line);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar .brand {
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink);
}
.topbar .brand span { color: var(--accent); }
.topbar .client {
  font-size: 13px;
  color: var(--muted);
}
.topbar .back {
  font-size: 13px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.topbar .back:hover { color: var(--accent); text-decoration: none; }

/* ---------- Layout ---------- */
.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}
.wrap.narrow { max-width: 820px; }

/* ---------- Hero ---------- */
.hero {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}
.hero .eyebrow {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 8px;
}
.hero h1 {
  font-size: 30px;
  line-height: 1.15;
  margin: 0 0 10px;
  letter-spacing: -.01em;
}
.hero .sub {
  color: var(--muted);
  font-size: 15px;
  max-width: 680px;
}
.hero .status-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
}
.hero .status-row b { color: var(--ink); font-weight: 600; }

/* ---------- Section header ---------- */
.section-title {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  margin: 22px 4px 12px;
}

/* ---------- Document cards ---------- */
.doc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 720px) {
  .doc-grid { grid-template-columns: 1fr; }
}
.doc {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
  transition: transform .12s ease, border-color .12s ease;
}
.doc:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  text-decoration: none;
}
.doc.disabled {
  opacity: .55;
  pointer-events: none;
  background: #fafaf6;
}
.doc-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.doc-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.doc-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -.005em;
}
.doc-desc {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0;
}
.doc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- Status pills ---------- */
.pill {
  display: inline-block;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.pill.draft     { background: var(--warn-soft); color: var(--warn); }
.pill.sent      { background: var(--info-soft); color: var(--info); }
.pill.awaiting  { background: #e5e7eb; color: #4b5563; }
.pill.approved  { background: var(--good-soft); color: var(--good); }
.pill.alert     { background: var(--bad-soft); color: var(--bad); }
.pill.accent    { background: var(--accent-soft); color: var(--accent); }

/* ---------- Generic content card ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.card h2 {
  font-size: 21px;
  margin: 0 0 6px;
  letter-spacing: -.005em;
}
.card .lede {
  color: var(--muted);
  font-size: 14.5px;
  margin: 0 0 14px;
}
.card h3 {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--accent);
  margin: 22px 0 10px;
}
.card h4 {
  font-size: 15px;
  margin: 18px 0 8px;
}
.card p { margin: 8px 0; }
.card ul, .card ol { padding-left: 20px; margin: 6px 0 12px; }
.card li { margin: 5px 0; }
.card hr { border: none; border-top: 1px solid var(--line); margin: 22px 0; }
.card blockquote {
  border-left: 3px solid var(--accent);
  background: #faf7f1;
  padding: 10px 14px;
  margin: 14px 0;
  border-radius: 0 8px 8px 0;
  color: var(--ink);
  font-style: italic;
}
.card code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  background: #faf7f1;
  border: 1px solid var(--line);
  padding: 1px 5px;
  border-radius: 4px;
}
.card pre {
  background: #faf7f1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  overflow-x: auto;
  font-size: 13px;
}

/* ---------- Doc page header (the strip under the topbar) ---------- */
.doc-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.doc-header h1 {
  font-size: 26px;
  margin: 0;
  letter-spacing: -.01em;
}
.doc-header .meta {
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: white;
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.btn:hover { background: var(--accent-soft); border-color: var(--accent); }
.btn.primary { background: var(--accent); color: white; border-color: var(--accent); }
.btn.primary:hover { background: #9a330a; }

/* ---------- Footer ---------- */
.foot {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 28px;
}
.foot a { color: var(--muted); border-bottom: 1px dotted var(--muted); }

/* ---------- Print ---------- */
@media print {
  body { background: white; }
  .topbar { position: static; }
  .card, .hero, .doc { box-shadow: none; page-break-inside: avoid; }
}
