/* SusanApp · Lighthouse Family Law — shared look.
   Colours are taken from the firm logo; see the "Susan — App Redesign" canvas.
   Font: the firm's font, Helvetica. Where Helvetica is installed it's used
   as is; everywhere else (most Windows PCs) SusanApp serves TeX Gyre Heros,
   a free Helvetica twin, from /static/fonts (GUST Font License). */

@font-face {
  font-family: 'Firm Helvetica';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local('Helvetica'), url(../fonts/texgyreheros-regular.woff2) format('woff2');
}
@font-face {
  font-family: 'Firm Helvetica';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: local('Helvetica Bold'), local('Helvetica-Bold'), url(../fonts/texgyreheros-bold.woff2) format('woff2');
}

:root {
  /* Brand */
  --ink: #162126;          /* text, main buttons, dark panels */
  --copper: #B26B47;       /* the lighthouse beam, accents */
  --copper-light: #C27A55; /* beam on dark backgrounds */
  --copper-deep: #9A5636;  /* download and generate buttons (white text) */
  --copper-text: #8A4B2D;  /* links on white */
  --copper-dark: #7A3F22;  /* text on copper tint */
  --copper-tint: #F6ECE5;  /* needs-review and due-date panels */
  --copper-wash: #FBF6F2;  /* a highlighted row */
  --copper-line: #E3CBBD;  /* borders on copper panels */
  --mist: #F4F6F8;         /* page background */
  --sea: #1F7A6D;          /* done / connected */
  --sea-text: #1A5C52;
  --sea-tint: #E3F2EF;
  --danger: #B3261E;
  --danger-tint: #FBEAE8;

  /* Neutrals */
  --white: #FFFFFF;
  --text-2: #3E4C5C;       /* secondary text */
  --muted: #5A6878;        /* labels, captions */
  --faint: #A8B3BF;        /* disabled */
  --line: #D9DFE6;         /* card borders */
  --line-soft: #E6EAEF;    /* dividers inside cards */
  --line-strong: #C5CED8;  /* field borders, dashed boxes */
  --nav-current: #ECEEEE;
  --on-dark-muted: #C9D1D3;

  --sans: 'Firm Helvetica', Helvetica, Arial, sans-serif;
  --heading: var(--sans);  /* headings: the same font, bold */
  --radius-card: 16px;
  --radius-control: 10px;
  --page-width: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--mist);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--copper-text); }
a:hover { color: var(--ink); }

:focus-visible { outline: 3px solid var(--copper); outline-offset: 2px; }

h1, h2, h3 { margin: 0; }
p { margin: 0; }

.num, .money { font-variant-numeric: tabular-nums; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: var(--radius-control);
  background: var(--ink);
  color: var(--white);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; color: var(--white); }

/* ───────────── Header ───────────── */

.app-header { background: var(--white); border-bottom: 1px solid var(--line); }
.app-header-inner {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}
.brand-lockup:hover { color: var(--ink); }
.brand-lockup svg { display: block; flex-shrink: 0; }
.brand-words { display: flex; flex-direction: column; line-height: 1; }
.brand-name {
  font-family: var(--heading);
  font-weight: 500;
  font-size: 30px;
  letter-spacing: -0.01em;
}
.brand-firm {
  margin-top: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.app-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.app-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.app-nav a:hover { background: var(--mist); color: var(--ink); }
.app-nav a[aria-current="page"] { background: var(--nav-current); }

.account { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.settings-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  color: var(--text-2);
}
.settings-link:hover, .settings-link[aria-current="page"] { background: var(--nav-current); color: var(--ink); }
.account form { margin: 0; }
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.account-who { display: flex; flex-direction: column; line-height: 1.25; font-size: 14px; }
.account-who b { font-weight: 600; }
.account-who span { font-size: 13px; color: var(--muted); }
.link-button {
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--copper-text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.link-button:hover { color: var(--ink); }

/* Seven tools don't fit beside the brand and the account on a laptop screen,
   so below 1400px the nav takes a row of its own under them. */
@media (max-width: 1400px) {
  .app-nav { order: 3; width: 100%; margin: -4px -8px 0; }
  .app-nav a { padding: 0 12px; min-height: 40px; }
}
@media (max-width: 720px) {
  .app-header-inner { padding: 12px 16px; }
  .app-nav a { padding: 0 10px; }
  .account-who { display: none; }
}

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

.page {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 40px 24px 72px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
@media (max-width: 720px) { .page { padding: 28px 16px 56px; } }

.page-title {
  font-family: var(--heading);
  font-weight: 600;
  font-size: 40px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.page-lede { margin-top: 10px; color: var(--text-2); max-width: 70ch; }
@media (max-width: 720px) { .page-title { font-size: 32px; } }

.eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 24px;
}
.card-dark {
  background: var(--ink);
  color: var(--white);
  border-radius: var(--radius-card);
  padding: 24px;
}
.card-dark p, .card-dark .muted { color: var(--on-dark-muted); }
.card-tint {
  background: var(--copper-tint);
  color: #4E2A18;
  border-radius: var(--radius-card);
  padding: 24px;
}

.section-title {
  font-family: var(--heading);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.25;
}
.section-title-lg { font-family: var(--heading); font-weight: 600; font-size: 22px; line-height: 1.25; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.two-col { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.two-col > .main-col { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.two-col > .side-col { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

/* ───────────── Controls ───────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-control);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn svg { flex-shrink: 0; }
.btn:disabled, .btn[aria-disabled="true"] { cursor: not-allowed; opacity: 0.5; }
.btn-primary { background: var(--ink); color: var(--white); }
.btn-primary:hover:not(:disabled) { background: #22343B; color: var(--white); }
.btn-copper { background: var(--copper-deep); color: var(--white); font-weight: 700; }
.btn-copper:hover:not(:disabled) { background: #85492D; color: var(--white); }
.btn-secondary { background: var(--white); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover:not(:disabled) { border-color: var(--ink); color: var(--ink); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--ink); font-weight: 700; }
.btn-outline:hover:not(:disabled) { background: var(--mist); color: var(--ink); }
.btn-lg { min-height: 52px; border-radius: 12px; font-size: 17px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}
.icon-btn:hover:not(:disabled) { background: var(--mist); color: var(--ink); }
.icon-btn:disabled { color: var(--faint); cursor: default; }
.icon-btn.danger { color: var(--danger); }
@media (pointer: coarse) { .icon-btn { width: 44px; height: 44px; } }

.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.input, .select, .textarea {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 400;
}
.textarea { padding: 10px 12px; min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); outline: 2px solid var(--copper); outline-offset: 1px; }

.segmented {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  background: var(--mist);
  border-radius: 12px;
}
.segmented button {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.segmented button[aria-selected="true"], .segmented button.active {
  background: var(--white);
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(16, 35, 58, 0.12);
}

/* Upload area */
.drop-area {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 24px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--white);
  text-align: center;
  color: var(--text-2);
  transition: border-color 0.15s, background 0.15s;
}
.drop-area:hover, .drop-area.dragover, .drop-area.drag-over { border-color: var(--copper); background: var(--copper-wash); }
.drop-area:focus-within { border-color: var(--copper); outline: 3px solid var(--copper); outline-offset: 2px; }

/* Status */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.status-ok { color: var(--sea-text); }
.status-wait { color: var(--muted); }
.status-warn { color: var(--copper-dark); }
.status-bad { color: var(--danger); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

.notice {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--copper-tint);
  border: 1px solid var(--copper-line);
  color: #4E2A18;
  font-size: 15px;
}
.notice-ok { background: var(--sea-tint); border-color: #B9DDD6; color: var(--sea-text); }
.notice-bad { background: var(--danger-tint); border-color: #F0C3BE; color: #7D1A14; }
.notice-plain { background: var(--mist); border-color: var(--line); color: var(--text-2); }

/* Tables */
/* position: relative keeps visually-hidden labels inside the scroll box */
.table-wrap { position: relative; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th {
  padding: 12px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.table td { padding: 10px 12px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody th { padding: 10px 12px; border-top: 1px solid var(--line-soft); font-size: 15px; font-weight: 600; letter-spacing: normal; text-transform: none; color: var(--ink); }
.table th:first-child, .table td:first-child { padding-left: 24px; }
.table th:last-child, .table td:last-child { padding-right: 24px; }
.table .right { text-align: right; }
.table tfoot td, .table tfoot th { border-top: 2px solid var(--ink); padding-top: 16px; padding-bottom: 16px; }

/* ───────────── Footer ───────────── */

.app-footer { background: var(--white); border-top: 1px solid var(--line); }
.app-footer-inner {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  color: var(--muted);
}
@media (max-width: 720px) { .app-footer-inner { padding: 16px; } }
