/*
 * HrIntro — the HR app.
 *
 * Desktop first: HR sits at a computer, with a real screen for a list of
 * candidates and a keyboard for typing notes. It reflows to a phone because
 * the notification arrives there, but the phone is the second place it is
 * used, not the first.
 */

:root {
  --ink: #12191f;
  --ink-soft: #55636e;
  --line: #dde3e8;
  --bg: #f4f6f8;
  --card: #ffffff;
  --brand: #0b5d8f;
  --brand-dark: #08476d;
  --brand-wash: #e7f1f8;
  --danger: #b3261e;
  --danger-wash: #fdecea;
  --ok: #1a7f4b;
  --ok-wash: #e6f4ec;
  --warn: #8a5a00;
  --warn-wash: #fdf3e0;
  --radius: 12px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

/* ------------------------------------------------------------------ frame */

.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.logo {
  font-weight: 700;
  font-size: 17px;
  color: var(--brand);
  letter-spacing: 0.01em;
}
.topbar .spacer { flex: 1; }
.topbar .who { color: var(--ink-soft); font-size: 14px; }

.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}
.page.narrow { max-width: 520px; }

h1 { font-size: 24px; margin: 0 0 6px; }
h2 { font-size: 18px; margin: 28px 0 10px; }
p  { margin: 0 0 14px; }
.muted { color: var(--ink-soft); }
.small { font-size: 13.5px; }

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

/* ---------------------------------------------------------------- controls */

button {
  font: inherit;
  font-weight: 600;
  border-radius: 9px;
  border: 1px solid transparent;
  padding: 10px 18px;
  min-height: 42px;
  cursor: pointer;
}
button:disabled { opacity: 0.5; cursor: default; }

.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn-secondary { background: #fff; color: var(--brand-dark); border-color: var(--brand); }
.btn-quiet { background: transparent; color: var(--ink-soft); border-color: var(--line); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-wide { width: 100%; }

input[type="text"], input[type="email"], select, textarea {
  font: inherit;
  width: 100%;
  padding: 10px 12px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: 3px solid rgba(11, 93, 143, 0.3);
  border-color: var(--brand);
}

label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: 14px; }

.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 0; }
.row.tight > * { flex: 0 0 auto; }

/* ------------------------------------------------------------------- lists */

.job-row, .cand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.job-row:first-of-type, .cand-row:first-of-type { border-top: none; }
.grow { flex: 1; min-width: 0; }
.title { font-weight: 600; }

.pill {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}
.pill.new    { background: var(--brand-wash); color: var(--brand-dark); }
.pill.wait   { background: var(--warn-wash);  color: var(--warn); }
.pill.done   { background: var(--ok-wash);    color: var(--ok); }
.pill.gone   { background: #eef1f4;           color: var(--ink-soft); }
.pill.live   { background: var(--danger-wash); color: var(--danger); }

.empty {
  text-align: center;
  color: var(--ink-soft);
  padding: 30px 10px;
}

/* ------------------------------------------------------------ notices */

.notice {
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
  border: 1px solid;
}
.notice.warn   { background: var(--warn-wash);   border-color: #e5c98f; color: #5d3d00; }
.notice.danger { background: var(--danger-wash); border-color: #efb9b4; color: #7a1a15; }
.notice.ok     { background: var(--ok-wash);     border-color: #a9d6bd; color: #14603a; }
.notice p:last-child { margin-bottom: 0; }

/* --------------------------------------------------------- recovery key */

.keybox {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 17px;
  letter-spacing: 0.04em;
  background: #0f1720;
  color: #eaf2f8;
  padding: 16px;
  border-radius: var(--radius);
  word-break: break-all;
  margin: 12px 0;
}

/* ----------------------------------------------------------- the viewer */

.viewer-stage {
  background: #0b0f13;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
}
.viewer-stage video {
  width: 100%;
  max-height: 62vh;
  display: block;
}
.viewer-stage .loading { color: #9fb2c2; padding: 60px 20px; text-align: center; }

.session-clock {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--danger);
}

/* A file input is unstyleable, so the label carries the button's look. */
.filebtn { margin: 0; font-weight: inherit; }
.faux {
  display: inline-block;
  border-radius: 9px;
  padding: 11px 18px;
  cursor: pointer;
  font-weight: 600;
}
.faux:hover { background: var(--brand-dark); }

/* What we read out of HR's spreadsheet, before anything is created. */
.preview {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  margin: 10px 0;
}
.preview-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.preview-row:first-child { border-top: none; }
.preview-row .phone { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.preview-row.dup { background: var(--warn-wash); }

/* WhatsApp green, because HR is looking for it by colour, not by reading. */
.btn-wa {
  background: #1faa53;
  color: #fff;
  white-space: nowrap;
}
.btn-wa:hover { background: #17843f; }
.btn-wa.again { background: #fff; color: #17843f; border-color: #1faa53; }

/* The one place a link is shown for copying. */
.linkbox {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin: 10px 0;
}
.linkbox input {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
}

@media (max-width: 620px) {
  .page { padding: 16px 14px 50px; }
  .row { flex-direction: column; }
}

/* ------------------------------------------------- choosing the questions */

.qpick { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 18px; }
.qpick h2 { margin: 0 0 6px; font-size: 17px; }

.qpick-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--line);
  line-height: 1.45;
  cursor: pointer;
}
.qpick-row input { width: auto; min-height: 0; margin-top: 3px; }
/* A greyed row still reads: HR can see what they are not taking. */
.qpick-row input:disabled + span { color: var(--ink-soft); }
.qpick-row.custom { cursor: default; background: var(--brand-wash); padding-left: 10px; }
.qpick-row.custom span { flex: 1; }

/* ------------------------------------------------------ jumping to an answer */

.chapters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.btn-chapter {
  width: auto;
  min-height: 0;
  padding: 7px 12px;
  font-size: 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.btn-chapter:hover { border-color: var(--brand); color: var(--brand); }

/* A viewer's note, under the candidate. The seat leads so the reader knows
   whose judgement it is before reading it. */
.note-line { margin-top: 4px; color: var(--ink); line-height: 1.45; }
.note-line b { font-weight: 600; color: var(--ink-soft); }
