/* MOQing Bird — application stylesheet (served as a static file; CSP-safe:
   no inline styles or scripts are used anywhere in the templates). */

:root {
  /* Design direction v1 (approved). Blue means act; yellow means look here; green
     and red are reserved for status. Ported from the design mock, whose palette
     replaces the earlier navy/green scheme. */
  --paper: #f9f7f3;      /* warm canvas — was the cool grey #f6f7fb */
  --surface: #ffffff;    /* cards, inputs, header, tags, notices */
  --ink: #14161a;        /* 16.93:1 on paper */
  --muted: #5f6673;      /*  5.40:1 on paper */
  --line: #e7e3db;
  --line-soft: #f1ede6;

  --blue: #1f5fd7;       /* 5.34:1 on paper; white on blue 5.71:1 */
  --blue-strong: #17479f;
  --blue-wash: #eef3fd;
  --yellow: #ffc72c;     /* fill only: ink #2a2000 on it is 10.31:1 */
  --yellow-soft: #fff6de;
  --yellow-ink: #2a2000;

  --ok: #14713a;         /* 6.08:1 on white, 5.43:1 on --ok-wash (was #15803d at 4.48:1 on the wash) */
  --ok-wash: #e9f5ee;
  --danger: #c0261a;     /* 5.94:1 on white */
  --danger-wash: #fdecea;

  --radius: 10px;
  --radius-sm: 8px;
  --pill: 999px;
  --shadow: 0 1px 2px rgba(20, 22, 26, 0.04), 0 6px 20px rgba(20, 22, 26, 0.05);
  --t: 150ms;

  /* Older names, still referenced by existing rules. They now resolve to the new
     palette rather than the retired green and gold, so no rule silently keeps the
     old scheme. */
  --brand: var(--blue);
  --brand-ink: #ffffff;
  --accent: var(--yellow);
}

* { box-sizing: border-box; }

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

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.nav {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav__brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--brand);
  letter-spacing: 0.02em;
}

.nav__right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.9rem;
}

.nav__user { color: var(--muted); }

.nav form { margin: 0; display: inline; }

button.linklike {
  background: none;
  border: none;
  padding: 0;
  color: var(--brand);
  font: inherit;
  cursor: pointer;
}
button.linklike:hover { text-decoration: underline; }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.messages { list-style: none; padding: 0; }
.message {
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  margin-bottom: 8px;
}
/* Django-messages banners (base.html renders "message message--{{ message.tags }}").
   Same tinted idiom as .notice--*. */
.message--success { border-color: var(--ok); background: var(--ok-wash); color: var(--ok); }
.message--error { border-color: var(--danger); background: var(--danger-wash); color: var(--danger); }
.message--warning { border-color: var(--yellow); background: var(--yellow-soft); color: var(--yellow-ink); }
.message--info { border-color: var(--blue); background: var(--blue-wash); color: var(--blue-strong); }

h1 { font-size: 1.6rem; margin: 0 0 8px; }
h2 { font-size: 1.15rem; margin: 32px 0 12px; }

.muted { color: var(--muted); }
/* The customer's caption for the whole reference-file batch. */
.files-description { margin: 0 0 12px; }

.actions { margin: 20px 0; }

.btn {
  display: inline-block;
  background: var(--brand);
  color: var(--brand-ink);
  border: none;
  border-radius: var(--pill);
  padding: 11px 22px;
  font-size: 0.95rem;
  font-weight: 650;
  cursor: pointer;
}
/* brightness() darkens every variant -- including the yellow "listening" state --
   so no variant needs its own hover rule. */
.btn:hover { filter: brightness(0.94); text-decoration: none; }
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px rgba(31, 95, 215, 0.45);
}
.btn--ghost {
  background: var(--surface);
  color: var(--brand);
  border: 1px solid var(--line);
}
/* a ghost button is already white, so brightness() would only grey it: use the
   mock's hover treatment instead. */
.btn--ghost:hover { filter: none; border-color: var(--blue); background: var(--blue-wash); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

/* Project list */
.project-list { list-style: none; padding: 0; }
.project-list li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.project-list li:hover { border-color: var(--brand); }

.project-meta { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: 0.9rem; }
.project-meta .dot { color: var(--line); }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--pill);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #f0ede8;
  color: var(--muted);
}
/* Status badges — one rule per Project.Status value (see projects/models.py),
   following the palette's semantics: blue means act (the customer's turn),
   the neutral grey means we are working on it and there is nothing for the
   customer to do, and green/red are reserved for status (done vs. stopped).
   Yellow ("look here") is the intake badge a new brief first lands in. */
.badge--intake { background: var(--yellow-soft); color: var(--yellow-ink); }
/* Act: the customer can, or should, do something. */
.badge--mode_selection,
.badge--details_gathering,
.badge--quotes_ready,
.badge--customer_review,
.badge--customer_direct { background: var(--blue-wash); color: var(--blue-strong); }
/* Done. */
.badge--details_complete,
.badge--shipped,
.badge--completed { background: var(--ok-wash); color: var(--ok); }
/* Stopped. */
.badge--declined,
.badge--round_exhausted,
.badge--cancelled { background: var(--danger-wash); color: var(--danger); }
/* Working on it — nothing for the customer to do. The DB stores two of these
   as producer_outreach / producer_selected, so the class names follow the
   stored values exactly. Archived is inactive but not an error, so it stays
   neutral grey too. */
.badge--producer_outreach,
.badge--awaiting_quotes,
.badge--additional_round,
.badge--producer_selected,
.badge--confirming,
.badge--in_production,
.badge--qa,
.badge--archived { background: var(--line-soft); color: var(--muted); }

/* Forms */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 0.9rem; }
.field input[type="text"],
.field input[type="number"],
.field input[type="email"],
.field input[type="password"],
.field select {
  width: 100%;
  max-width: 480px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--surface);
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31, 95, 215, 0.18);
}
.field input[type="checkbox"] { width: auto; }

/* The brief's free-text description (a textarea, not an input). */
.field textarea {
  width: 100%;
  max-width: 640px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--surface);
}
.field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31, 95, 215, 0.18);
}

/* Dictation control (browser speech-to-text; client-side only). */
.dictation { display: flex; align-items: center; gap: 10px; margin: 4px 0 8px; }
.btn--dictate { padding: 8px 14px; font-size: 0.9rem; }
.btn--dictate.is-listening { background: var(--accent); color: var(--yellow-ink); }
.dictation-status { color: var(--muted); font-size: 0.85rem; }

/* The field label for groups that have no single input to point `for` at
   (e.g. the brief-intent radio group). */
.field-label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 0.9rem; }
/* The brief-intent radio group is a <fieldset> for its semantics; strip the
   browser's default border/padding so it lines up with every other field. */
fieldset.field { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }

/* Radio choices (the brief-intent question: exactly two options). */
.field .choices label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  margin-right: 20px;
}
.field .choices input[type="radio"] { width: auto; }

.help { color: var(--muted); font-size: 0.82rem; }
.errorlist { color: var(--danger); list-style: none; padding: 0; margin: 4px 0; font-size: 0.85rem; }

.formset { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; background: var(--surface); }
.formset__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.formset__row:first-of-type { border-top: none; }

.service-mode {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--brand);
  font-weight: 600;
}

/* Service-choice cards (the step before the brief: pick a service).

   The bird carries the choice. A radio cannot be drawn as a bird, so it stays in
   the DOM — still a real, focusable form control for keyboard and screen-reader
   users — and is made visually absent. Both states are the same markup: the icon
   span holds two SVGs, and only the visible one and the colour change, which is
   what turns an outline into a filled mark on the chosen option. The card's own
   :hover and :focus-within rules below still show focus, so a keyboard user can
   see which option they are on. */
.mode-choice__option input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;           /* invisible, but still focusable and announced */
  pointer-events: none; /* the whole card is the click target, not the dot */
}
.mode-choice__bird {
  display: block;
  width: 34px;
  height: 34px;
  margin: 0 auto 4px;   /* centred above the title, where the radio dot used to be */
  color: var(--muted);  /* unselected: a muted outline */
}
.mode-choice__bird svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;   /* the icon carries no colour of its own */
}
/* Outline until chosen, then the icon set's matching solid variant — so the eye
   and the wing survive instead of filling in solid.

   The repeated `svg.mode-choice__bird-*` in these selectors is load-bearing, not
   noise. The rule above that makes both icons block-level is ".mode-choice__bird
   svg", which scores higher than a bare class: a plain ".mode-choice__bird-solid
   { display: none }" loses to it, so the solid bird stayed visible on unselected
   cards and every card showed two birds. Matching the element as well puts these
   rules back in front. Do not "tidy" the extra class away. */
.mode-choice__bird svg.mode-choice__bird-solid { display: none; }
.mode-choice__option input[type="radio"]:checked ~ .mode-choice__bird { color: var(--blue); }
.mode-choice__option input[type="radio"]:checked ~ .mode-choice__bird svg.mode-choice__bird-outline { display: none; }
.mode-choice__option input[type="radio"]:checked ~ .mode-choice__bird svg.mode-choice__bird-solid { display: block; }
.mode-choice {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin: 16px 0;
}
.mode-choice__option {
  position: relative;   /* contains the visually-hidden radio */
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.mode-choice__option:hover { border-color: var(--brand); }
.mode-choice__option:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31, 95, 215, 0.18);
}
.mode-choice__name { font-weight: 700; }
.mode-choice__blurb { color: var(--muted); font-size: 0.9rem; }

/* Tables — the customer quotes table and the staff queue share one idiom. */
table.quotes, table.staff-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}
table.quotes th, table.quotes td,
table.staff-table th, table.staff-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
table.quotes th, table.staff-table th {
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

/* Money columns: figures render in a system monospace (no webfont — the CSP's
   font-src allows only 'self') with tabular numerals so prices line up, and
   the amount column is right-aligned. The currency code stays visible beside
   it — a deliberate product decision, never drop it. */
table.quotes .amount {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.currency {
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.asset-list { list-style: none; padding: 0; }
.asset-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }

/* Milestone timeline (pure HTML/CSS, no JS) */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 0;
  counter-reset: none;
}
.timeline__step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 18px;
  position: relative;
  font-size: 0.82rem;
  color: var(--muted);
}
.timeline__dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--surface);
  flex: 0 0 auto;
}
/* The step's text. It carries no colour of its own — it inherits the step's
   colour (muted by default, green when done, ink when active) — but it has a
   class so the markup's class contract is explicit. */
.timeline__label { font-size: inherit; color: inherit; }
.timeline__step--done .timeline__dot {
  background: var(--ok);
  border-color: var(--ok);
}
.timeline__step--active .timeline__dot {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 199, 44, 0.35);
}
.timeline__step--done { color: var(--ok); }
.timeline__step--active { color: var(--ink); font-weight: 700; }
/* The pending state is the default look; it has a rule of its own so the
   timeline__step--{{ step.state }} suffix always resolves to a selector. */
.timeline__step--pending { color: var(--muted); }
.timeline__step::after {
  content: "";
  flex: 0 0 auto;
  width: 18px;
  height: 2px;
  background: var(--line);
}
.timeline__step:last-child::after { display: none; }
.timeline__step--done::after { background: var(--ok); }

/* Tag lists (materials / colors / hardware) */
.tag-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--pill);
  padding: 4px 12px;
  font-size: 0.85rem;
}
.tag--alternative { border-style: dashed; }
.tag__role { color: var(--muted); font-size: 0.75rem; margin-left: 4px; }
.tag__pantone { font-weight: 600; margin-right: 6px; }

/* Notices */
.notice {
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  margin-bottom: 12px;
}
.notice--ok { border-color: var(--ok); background: var(--ok-wash); color: var(--ok); }
/* A warning: yellow means "look here", never an error. Same tinted idiom as
   .notice--ok, but with the warning tokens; the ink stays dark on the yellow
   wash (never white text on yellow). */
.notice--warn { border-color: var(--yellow); background: var(--yellow-soft); color: var(--yellow-ink); }

.summary-timeframe { margin-top: 8px; }

/* Quotes table (scrolls horizontally on small screens) */
.table-scroll { overflow-x: auto; }
table.quotes td.commentary { min-width: 180px; max-width: 320px; white-space: normal; }
tr.row--selected { background: var(--blue-wash); }
.alias { font-weight: 600; }
.badge--selected { background: var(--blue-wash); color: var(--blue-strong); margin-left: 6px; }
.btn--select { padding: 6px 14px; font-size: 0.85rem; }

/* The brief's free-text description (rendered with linebreaks into <p> tags).
   Comfortable reading rhythm; no box of its own so it reads as part of the
   card it sits in. */
.brief { line-height: 1.6; }
.brief p { margin: 0 0 0.75em; }
.brief p:last-child { margin-bottom: 0; }

/* The supplier's identity under their alias in the quotes table — revealed
   only after the reveal fee is settled. The name stands out; company and
   contact person read as secondary detail. */
.supplier-identity { margin-top: 6px; font-size: 0.85rem; color: var(--muted); }
.supplier-identity strong { color: var(--ink); }

/* The contact column in the quotes table (email / WhatsApp / preference). */
.contact { font-size: 0.85rem; color: var(--muted); }
.contact div { margin: 2px 0; }

/* Tactile motion (CSS-only, var(--t) = 150ms). Controls that react to the
   pointer or keyboard transition smoothly; nothing animates on its own and no
   scripts are used. Users who ask for reduced motion get none at all. */
a, .btn, button.linklike,
.field input, .field select, .field textarea {
  transition:
    color var(--t) ease,
    background-color var(--t) ease,
    border-color var(--t) ease,
    box-shadow var(--t) ease,
    filter var(--t) ease;
}
@media (prefers-reduced-motion: reduce) {
  a, .btn, button.linklike,
  .field input, .field select, .field textarea {
    transition: none;
  }
}
