/*
  Treeline Bamboo brand styling.

  Colors and typography are the same ones the call sheet PDF template
  uses (see assets/call_sheet_template.html and the shared
  TLB-Brand-Assets folder), so the app and the documents it produces
  look like they come from the same company:
    Dark Forest Green #19322f  -- dominant
    Bamboo Green      #789c4a  -- accent
    Treeline Sky Blue #c5d9e7  -- light accent, used sparingly
  DM Sans is TLB's designated substitute for the paid brand font
  (Larsseit); it's served from /brand/fonts, the same files weasyprint
  embeds in the PDFs.
*/
@font-face {
  font-family: 'DM Sans';
  src: url('/brand/fonts/DMSans-Regular.ttf') format('truetype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: url('/brand/fonts/DMSans-Medium.ttf') format('truetype');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: url('/brand/fonts/DMSans-Bold.ttf') format('truetype');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: url('/brand/fonts/DMSans-Italic.ttf') format('truetype');
  font-weight: 400; font-style: italic; font-display: swap;
}

:root {
  --forest: #19322f;
  --bamboo: #789c4a;
  --sky: #c5d9e7;
  --ink: #1f2b21;
  --muted: #5c6b5f;
  --page: #f4f7f3;
  --line: #e2e8de;
}

* { box-sizing: border-box; }

body {
  font-family: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}

/* --- Header ---
   Forest green bar. The logo file carries its own bamboo-green field, so
   against forest green it reads as a distinct badge rather than blending
   away (which is what happened when the bar matched the logo's green). */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--forest);
  border-bottom: 3px solid var(--forest);
  padding: 12px 28px;
  gap: 16px;
}
.topbar .brand-lockup { display: flex; align-items: center; gap: 16px; min-width: 0; }
.topbar .brand-logo { height: 42px; width: auto; display: block; }
.topbar .brand-divider {
  width: 1px; align-self: stretch; background: rgba(255,255,255,0.45);
}
.topbar .brand-title {
  font-weight: 700; color: #fff; font-size: 15px;
  letter-spacing: 0.3px; white-space: nowrap;
}
.topbar .user { color: rgba(255,255,255,0.9); font-size: 13px; }
.topbar .user a { color: #fff; font-weight: 700; }

main { max-width: 760px; margin: 32px auto 64px; padding: 0 20px; }

/* --- Cards --- */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 4px solid var(--bamboo);
  border-radius: 8px;
  padding: 28px 32px;
  box-shadow: 0 1px 3px rgba(25,50,47,0.06);
}
.card.centered { text-align: center; }
.card.stacked { margin-top: 22px; }
.nowrap { white-space: nowrap; }
.center-block { text-align: center; }
.stacked-heading { margin-top: 26px; }
.plain-list { margin: 8px 0 0; padding-left: 20px; font-size: 14px; color: #3d4a3f; line-height: 1.7; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 16px; }

h1 { font-size: 26px; color: var(--forest); margin: 0 0 4px; letter-spacing: -0.2px; }
h2 { font-size: 18px; color: var(--forest); }

/* --- Forms --- */
label { display: block; margin-top: 18px; font-weight: 700; font-size: 14px; color: var(--forest); }
input[type=text], input[type=url], input[type=file], select, textarea {
  width: 100%; padding: 10px 12px; margin-top: 6px;
  border: 1px solid #ccd6cc; border-radius: 6px;
  font-family: inherit; font-size: 14px; color: var(--ink);
  background: #fff;
}
input[type=text]:focus, input[type=url]:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--bamboo);
  box-shadow: 0 0 0 3px rgba(120,156,74,0.18);
}
fieldset {
  margin-top: 20px; border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 18px 18px;
  background: #fbfdfa;
}
legend { font-weight: 700; color: var(--forest); font-size: 14px; padding: 0 6px; }
fieldset label { font-weight: 500; }

.hint { color: var(--muted); font-size: 13px; margin: 8px 0 0; }

.notice { padding: 12px 16px; border-radius: 6px; margin-bottom: 18px; font-size: 14px; }
.notice.error { background: #fdecea; border: 1px solid #f3b3ac; color: #7a2b22; }

.button {
  display: inline-block; background: var(--forest); color: #fff !important;
  padding: 11px 20px; border-radius: 6px; text-decoration: none;
  border: none; cursor: pointer; margin-top: 20px;
  font-family: inherit; font-size: 14px; font-weight: 700; letter-spacing: 0.2px;
}
.button:hover { background: #122523; }
.button.secondary {
  background: #fff; color: var(--forest) !important;
  border: 1px solid var(--forest); margin-top: 6px; white-space: nowrap; font-weight: 500;
}
.button.secondary:hover { background: #f0f5ee; }

/* --- Tables --- */
table.list { width: 100%; border-collapse: collapse; margin-top: 18px; font-size: 14px; }
table.list th {
  text-align: left; padding: 9px 10px; background: var(--forest); color: #fff;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700;
}
table.list th:first-child { border-top-left-radius: 6px; }
table.list th:last-child { border-top-right-radius: 6px; }
table.list td { padding: 10px; border-bottom: 1px solid var(--line); }
table.list tr:nth-child(even) td { background: #fafcf9; }
table.list a { color: var(--bamboo); font-weight: 500; }

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

.picker-row { display: flex; gap: 10px; align-items: flex-start; }
.picker-row input { flex: 1; }
.question { margin-bottom: 14px; }
.other-answer { margin-top: 8px; }

/* --- Submit overlay --- */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(25,50,47,0.85);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.overlay-card {
  background: #fff; border-radius: 10px; padding: 30px 34px;
  border-top: 4px solid var(--bamboo);
  max-width: 480px; text-align: center; box-shadow: 0 10px 34px rgba(0,0,0,0.3);
}
.overlay-card h2 { margin: 14px 0 4px; font-size: 20px; }
.overlay-elapsed { font-weight: 700; color: var(--forest); margin: 4px 0 14px; }
.spinner {
  width: 38px; height: 38px; margin: 0 auto;
  border: 4px solid #e4ebe1; border-top-color: var(--bamboo);
  border-radius: 50%; animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.stage-list {
  text-align: left; display: inline-block; margin: 10px auto 14px;
  padding-left: 20px; color: #3d4a3f; font-size: 13px; line-height: 1.7;
}
