/* ATGC submission form — layout and components.
 * Colours come from tokens.css; never hard-code one here.
 * Density over whitespace: this is data entry, often 96 rows on a laptop. */

* { box-sizing: border-box; }

body {
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
  max-width: var(--maxw);
  font: var(--fs-body)/1.5 var(--font-body);
  color: var(--ink);
  background: var(--surface);
}

/* ── masthead ─────────────────────────────────────────────────────────── */
.masthead {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.75rem 0 1.25rem; margin-bottom: .75rem;
  border-bottom: 4px solid var(--navy);
}
.logo { height: 92px; width: auto; }
.masthead-text { flex: 1; }
.masthead h1 {
  margin: 0; font: 700 var(--fs-title)/1.15 var(--font-head);
  color: var(--navy); letter-spacing: -.5px;
}
.sub { margin: .15rem 0 0; color: var(--ink-soft); }
.guidelines {
  color: var(--blue); text-decoration: none; font-size: var(--fs-small);
  white-space: nowrap;
}
.guidelines:hover { text-decoration: underline; }

.flow-note {
  margin: 0 0 1.25rem; padding: .6rem .8rem;
  background: var(--surface-alt); border-left: 3px solid var(--atgc-a);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: var(--fs-small); color: var(--ink-soft);
}

/* ── sections ─────────────────────────────────────────────────────────── */
section { margin-bottom: 1.75rem; }
/* Section heads copy the site's group heading: 14px uppercase Raleway, wide
 * tracking, in the section accent, with a tinted rule running to the right. */
section h2 {
  display: flex; align-items: center; gap: 14px;
  margin: 0 0 13px; padding: 0; border: 0;
  font: 600 var(--fs-section)/1.2 var(--font-head);
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--accent);
}
section h2::after {
  content: ""; flex: 1; height: 2px; border-radius: 2px;
  background: color-mix(in srgb, var(--accent) 28%, #fff);
}

.grid {
  display: grid; gap: .75rem 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

label { display: block; font-size: var(--fs-small); color: var(--ink-soft); }
/* A field's own label is bold; the help beneath it is not, and is a size
 * smaller. That is the whole hierarchy — question, then aside, then answer.
 * The analysis panel and the sign-off were already 600, so this makes the
 * rest of the form match them rather than introducing a new weight.
 * `.field > label` deliberately, NOT every label: a radio option is a value,
 * not a question, and must stay regular weight. */
.field > label, .table-tools > label { font-weight: 600; }
label > span.req { color: var(--error); margin-left: .15rem; }

input, select, textarea {
  width: 100%; margin-top: .2rem; padding: .4rem .5rem;
  font: inherit; color: var(--ink);
  border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--surface);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--blue); outline-offset: -1px; border-color: var(--blue);
}
textarea { min-height: 4.5rem; resize: vertical; }

/* Red means one thing: this blocks export. Warnings are amber. */
.is-error input, .is-error select, .is-error textarea { border-color: var(--error); background: var(--error-bg); }
.is-warn  input, .is-warn  select, .is-warn  textarea { border-color: var(--warn);  background: var(--warn-bg); }

.hint { margin: .25rem 0 0; font-size: var(--fs-small); color: var(--ink-soft); }
/* Explanatory help sits below the shorter field hints: it is a full
 * sentence and should read as an aside, not compete with the label. */
.hint-help { font-size: var(--fs-tiny); }

/* ── quote import — deliberately understated (doc 03) ─────────────────── */
.quote {
  margin-top: 1rem; padding: .6rem .8rem;
  background: var(--surface-alt); border-radius: var(--radius);
}
.quote summary { cursor: pointer; color: var(--navy); font-size: var(--fs-small); }

/* ── sample table ─────────────────────────────────────────────────────── */
.rules {
  margin-bottom: .75rem; padding: .5rem .7rem;
  background: var(--surface-alt); border-radius: var(--radius);
  font-size: var(--fs-small); color: var(--ink-soft);
}
.table-tools {
  display: flex; flex-wrap: wrap; gap: .75rem; align-items: end;
  margin-bottom: .6rem;
}
.table-tools label { font-size: var(--fs-small); }
.table-tools input[type=number] { width: 6rem; }
/* A <label> wrapping a hidden file input is the only way to restyle a file
 * picker, but it then looks like text. Give it the button's own appearance. */
.upload {
  display: inline-block; cursor: pointer;
  padding: .7rem 1.1rem; font-weight: 600;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .15s, color .15s;
}
.upload:hover { border-color: var(--accent); color: var(--accent); }

/* ── the send confirmation ──────────────────────────────────────────────── */
.confirm {
  display: flex; align-items: flex-start; gap: .6rem;
  margin-top: .9rem; padding: .8rem 1rem;
  border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: var(--radius); background: var(--surface-alt);
}
.confirm input { width: auto; margin: .2rem 0 0; flex: none; }
.confirm label { font-size: var(--fs-body); color: var(--ink); font-weight: 600; }
.confirm.is-error { border-color: var(--error); border-left-color: var(--error);
  background: var(--error-bg); }


/* Wide tables scroll inside their own box; the page never scrolls sideways. */
.table-scroll { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: var(--fs-small); }
th {
  position: sticky; top: 0; z-index: 1;
  background: var(--navy); color: #fff; font-weight: 600;
  text-align: left; padding: .4rem .5rem; white-space: nowrap;
}
td { padding: 0; border-top: 1px solid var(--rule); }
td input, td select { border: 0; border-radius: 0; margin: 0; background: transparent; }
tbody tr:nth-child(even) { background: var(--surface-alt); }
td.rownum { padding: 0 .5rem; color: var(--ink-soft); text-align: right; }

/* One block per instrument on the Q/Q form: a heading, its own count, its own
 * table. Spaced apart so two tables never read as one long one. */
.sample-block { margin-top: 1.25rem; }
.sample-block:first-of-type { margin-top: .25rem; }
.sample-block h3 {
  margin: 0 0 .5rem;
  font: 600 var(--fs-body) var(--font-head); color: var(--navy);
}

/* ── bioinformatics ───────────────────────────────────────────────────── */
.consult {
  margin: 0 0 .9rem; padding: .7rem .9rem;
  border-left: 3px solid var(--atgc-t); background: var(--warn-bg);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.consult.quiet { background: var(--surface-alt); border-left-color: var(--rule); }
.consult p { margin: 0 0 .35rem; }
.consult p:last-child { margin: 0; font-size: var(--fs-small); color: var(--ink-soft); }

#analysis-panel { margin-top: 1rem; }

/* ── messages ─────────────────────────────────────────────────────────── */
.msg { margin: .6rem 0; padding: .55rem .8rem; border-radius: var(--radius); font-size: var(--fs-small); }
.msg.err  { background: var(--error-bg); border-left: 3px solid var(--error); }
.msg.warn { background: var(--warn-bg);  border-left: 3px solid var(--warn); }
.msg.ok   { background: #F1F8F8;         border-left: 3px solid var(--ok); }

.restore {
  margin: 1rem 0; padding: .6rem .8rem;
  background: var(--surface-alt); border-left: 3px solid var(--atgc-a);
  border-radius: 0 var(--radius) var(--radius) 0; font-size: var(--fs-small);
}
.restore button { margin-left: .5rem; }

.problems { background: var(--error-bg); border-left: 3px solid var(--error);
  padding: .7rem .9rem; border-radius: 0 var(--radius) var(--radius) 0; }
.problems h3 { margin: 0 0 .4rem; font: 600 1rem var(--font-head); color: var(--error); }
.problems ul { margin: 0; padding-left: 1.1rem; }

/* ── actions ──────────────────────────────────────────────────────────── */
.actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: 1.25rem; }
button {
  padding: .7rem 1.1rem; font: inherit; font-weight: 600; cursor: pointer;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .15s, color .15s, background .15s;
}
button:hover { border-color: var(--accent); color: var(--accent); }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
button.primary:hover { filter: brightness(1.08); color: #fff; }
button:disabled { opacity: .5; cursor: not-allowed; }
/* ── where to send it ─────────────────────────────────────────────────────
 * Addresses, not a button. The mailto button was removed: a mailto cannot
 * attach the file, and on a machine with no desktop mail client it does
 * nothing at all. */
#send-to .send-lead { margin: 0 0 .6rem; }
.send-row {
  margin: 0 0 .35rem; padding: .55rem .8rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); font-weight: 600;
  overflow-wrap: anywhere;
}
.send-row a { color: var(--accent); text-decoration: none; }
.send-row a:hover { text-decoration: underline; }
.send-row .sep { color: var(--muted); font-weight: 400; }
.send-lab {
  display: block; font-weight: 700; color: var(--ink);
  font-size: .85rem; text-transform: uppercase; letter-spacing: .04em;
  margin-bottom: .2rem;
}
.send-note { margin: .6rem 0 0; font-size: .9rem; color: var(--muted); }

/* ── landing page ─────────────────────────────────────────────────────── */
.app-list { list-style: none; margin: 0; padding: 0;
  display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.app-list a {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 74px; padding: 14px 18px 14px 24px;
  background: #fff; color: var(--ink); text-decoration: none;
  border: 1px solid var(--line); border-radius: var(--radius);
  font-weight: 600;
  transition: border-color .15s, box-shadow .15s;
}
.app-list a::before {
  content: ""; position: absolute; left: 0; top: 12px; bottom: 12px;
  width: 4px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.app-list a:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.app-list a::after { content: "\2192"; color: var(--accent); font-size: 1.1rem; }
.app-list { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }

/* ── footer ───────────────────────────────────────────────────────────── */
footer {
  margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--rule);
  display: flex; align-items: center; gap: 1rem;
  font-size: var(--fs-small); color: var(--ink-soft);
}
.tech-logo { height: 34px; width: auto; }

@media print {
  .actions, .table-tools, .quote, .restore, .flow-note { display: none; }
  body { max-width: none; }
}

/* ── bioinformatics fields ────────────────────────────────────────────────
 * Full width, stacked. These are paragraphs of biology, not short values, so
 * a grid of narrow boxes fights the content. Each opens from a triangle so a
 * long set stays readable. */
.stack { display: block; }
.field.wide { width: 100%; margin-bottom: .85rem; }
.field.wide label { font-size: var(--fs-body); color: var(--ink); font-weight: 600; }
.field.wide textarea { min-height: 5.5rem; }

details.fieldgroup > summary {
  cursor: pointer; padding: .35rem 0; color: var(--navy);
  font-weight: 600; list-style: revert;
}
details.fieldgroup { border-bottom: 1px solid var(--rule); padding-bottom: .4rem; }

/* ── landing, grouped like the website ────────────────────────────────────── */
.group { margin: 0 0 30px; }
.group h2 { margin-bottom: 13px; }
.group-transcriptomics { --accent: var(--grp-transcriptomics); }
.group-genomics        { --accent: var(--grp-genomics); }
.group-epigenomics     { --accent: var(--grp-epigenomics); }
.group-additional      { --accent: var(--grp-additional); }

/* Accent-tinted furniture, so a form reads as part of its section. */
.flow-note { border-left-color: var(--accent); }
.restore   { border-left-color: var(--accent); }
th         { background: var(--navy); }
.masthead  { border-bottom-color: var(--accent); }
.guidelines { color: var(--accent); }

/* ── shipping address ─────────────────────────────────────────────────────── */
.address {
  padding: .8rem 1rem; margin-bottom: .6rem;
  border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: var(--radius); background: var(--surface-alt);
}
.address p { margin: 0; line-height: 1.55; }
.address-lab {
  font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: 1px;
  font-size: var(--fs-small); margin-bottom: .3rem !important;
}

/* The optional request reads as an offer, not another hurdle: no accent bar,
 * lighter weight, and it never turns red because it never blocks. */
.confirm .note {
  display: block; margin-top: .2rem;
  font-size: var(--fs-small); color: var(--muted);
}

.address-phone { margin-top: .45rem !important; font-weight: 600; }
.address-phone a { color: var(--accent); text-decoration: none; }
.address-phone a:hover { text-decoration: underline; }

/* ── a small set of exclusive options ─────────────────────────────────────── */
/* The radio/checkbox equivalent of a field label — same weight as one. */
.grouplabel { display: block; font-size: var(--fs-small); color: var(--muted);
  font-weight: 600; }
.radios { display: flex; gap: 1rem; margin-top: .35rem; flex-wrap: wrap; }
.radio {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: var(--fs-body); color: var(--ink); cursor: pointer;
}
.radio input { width: auto; margin: 0; flex: none; }
.is-error .radios { outline: 1px solid var(--error); border-radius: var(--radius);
  padding: .25rem .4rem; background: var(--error-bg); }

/* ── help ─────────────────────────────────────────────────────────────────── */
.masthead-links { display: flex; flex-direction: column; align-items: flex-end; gap: .4rem; }
.help-btn {
  padding: .45rem .8rem; font-weight: 700; white-space: nowrap;
  color: #fff; background: var(--accent); border: 0; border-radius: var(--radius);
}
.help-btn:hover { filter: brightness(1.08); color: #fff; }

.help-panel {
  position: relative;
  margin: 0 0 1.25rem; padding: 1.2rem 1.5rem;
  border: 1px solid var(--line); border-top: 4px solid var(--accent);
  border-radius: var(--radius); background: var(--surface-alt);
}
.help-panel h2 {
  margin: 0 0 .6rem; padding: 0; border: 0; display: block;
  font: 700 1.4rem var(--font-head); color: var(--navy);
  text-transform: none; letter-spacing: 0;
}
.help-panel h2::after { content: none; }
.help-panel h3 {
  margin: 1.1rem 0 .3rem;
  font: 600 1rem var(--font-head); color: var(--accent);
}
.help-panel p, .help-panel li { margin: .3rem 0; }
.help-panel ol, .help-panel ul { margin: .3rem 0; padding-left: 1.3rem; }
.help-lead { font-size: 1.05rem; }
.help-note { font-size: var(--fs-small); color: var(--muted); }
.help-close {
  position: absolute; top: .6rem; right: .8rem;
  width: 2rem; height: 2rem; padding: 0; line-height: 1;
  font-size: 1.4rem; border: 0; background: transparent; color: var(--muted);
}
.help-close:hover { color: var(--error); border: 0; background: transparent; }

@media (max-width: 700px) {
  .masthead { flex-wrap: wrap; }
  .masthead-links { align-items: flex-start; width: 100%; }
}

/* ── the quality-and-quantity panel ───────────────────────────────────────── */
.qc-panel { margin-top: .5rem; }
.qc-panel .field { max-width: 26rem; margin-bottom: .6rem; }
.qc-panel .field.wide { max-width: 34rem; }
.qc-panel .msg.warn { font-weight: 600; }
