/*
 * What the platform's own pages add to the First Due Education look.
 *
 * Every page loads fde.css first: the tokens, the typefaces, the buttons,
 * the tags, the cards and the sidebar are there, and this file uses them
 * and defines no color of its own. Here is only what these pages need on
 * top of it:
 *
 *   - the page with no sidebar (body.fde.plain): the green bar with the
 *     mark, and one centered column. Sign-in, an invite, "Your programs",
 *     the owner console, and the small pages a link can land on (a class
 *     that has ended or was cancelled, a link that is not active, an
 *     instructor's answer to a confirmation request);
 *   - Staff and permissions (/staff), which sits in the sidebar's frame.
 *
 * The color roles are fde.css's and are strict. Gold fills the one primary
 * action of a page (Sign in, Create account, Invite staff member, Confirm)
 * and nothing else here; red is the confirmation of taking someone off the
 * staff, and a refusal's words.
 */

/* ---------- a page with no sidebar ---------- */
body.fde.plain { min-height: 100vh; }
/* A name is as long as its owner made it. On these pages a long one wraps, anywhere it has to; it never pushes the page wide. */
main.plain, .staff-layout, .fde-dialog.staff-dialog { overflow-wrap: anywhere; }
main.plain { width: 100%; max-width: 860px; margin: 0 auto; padding: 32px 24px 56px; display: flex; flex-direction: column; gap: 20px; }
main.plain.narrow { max-width: 460px; }
main.plain.medium { max-width: 600px; }
/* What the green bar carries beside the mark and the title (and, under the title, who is signed in): a way out. */
.fde-top .top-action { flex: none; display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap); padding: 0 12px; border: 1px solid var(--green-mid); border-radius: 6px; background: transparent; color: #fff; font: 500 14px var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap; }
.fde-top .top-action:hover { background: var(--green-mid); color: #fff; }
.fde-top .top-action:focus-visible { outline-color: #fff; }

.fde h4 { font: 700 15px/1.3 var(--head); color: var(--green); margin: 0; }
.lead { color: var(--muted); max-width: 70ch; }
/* Things one under the other with the same gap: a form's fields, a card's parts. */
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack.tight { gap: 8px; }
.grow { flex: 1 1 auto; min-width: 0; }
/* A card inside a card is a flat panel: a line around it, no shadow of its own. */
.card .card { box-shadow: none; border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.cardhead { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; }
.cardhead > :first-child { flex: 1 1 220px; min-width: 0; }
.cardhead h2, .cardhead h3 { overflow-wrap: anywhere; }

/* ---------- forms ---------- */
.field input, .field select { width: 100%; }
/* Fields side by side while there is room, then one under the other. A button in the row sits on the fields' baseline. */
.formrow { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.formrow > .field { flex: 1 1 200px; min-width: 0; }
.formrow > .btn { flex: none; }
.fde .msg:empty { display: none; }
.fde .msg { margin: 0; }
/* A one-time link, shown for the person to send by hand. It is long: it breaks anywhere. */
.linkbox { font: 13px/1.5 var(--mono); overflow-wrap: anywhere; word-break: break-all; background: var(--bg); border: 1px dashed var(--input); border-radius: 6px; padding: 10px 12px; user-select: all; }

/* ---------- lists inside a card: a program's admins ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-height: var(--tap); padding: 6px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list .grow { overflow-wrap: anywhere; }

/* ---------- Your programs (/home) ---------- */
.modules { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.modules .module-name { font-weight: 500; }

/* ---------- the owner console ---------- */
.institution { display: flex; flex-direction: column; gap: 16px; }
.institution + .institution, #owner + form { margin-top: 12px; }
#owner { display: flex; flex-direction: column; gap: 20px; }
#owner:empty { display: none; }

/* ---------- the small pages a link can land on ---------- */
.bootmsg { display: flex; flex-direction: column; gap: 10px; }
.fde .bootmsg h2 { font-size: 20px; overflow-wrap: anywhere; }
.answerfacts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 6px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 12px 0; }
.answerfacts dt { font: 700 12px/1.9 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.answerfacts dd { margin: 0; overflow-wrap: anywhere; }
.answernote { color: var(--muted); font-size: 13px; }
.answernote:empty { display: none; }

/* ---------- Staff and permissions (/staff; design/mockups/Permissions.dc.html) ---------- */
.staff-layout { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
/* The people, one row each. */
.staff-list { flex: 1 1 260px; max-width: 320px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.fde .staff-row { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: var(--tap); padding: 12px 14px; border-radius: 8px; text-decoration: none; color: var(--ink); min-width: 0; }
.fde .staff-row:hover { background: rgba(10, 52, 34, .05); color: var(--ink); }
.staff-row strong { max-width: 100%; }
.staff-row .title { font-size: 14px; color: var(--muted); max-width: 100%; }
.staff-row .level { font: 400 12px/1.5 var(--mono); letter-spacing: .02em; text-transform: uppercase; color: var(--green); }
.staff-row .tag { margin-top: 4px; }
/* The person whose card is open: a white card with a gold left edge. */
.fde .staff-row[aria-current="true"] { background: var(--card); box-shadow: inset 3px 0 0 var(--gold), 0 1px 3px rgba(10, 52, 34, .12); }
/* One person: who they are, what they are called, their level, and what they may do. */
.staff-side { flex: 2 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.staff-editor { padding: 24px; display: flex; flex-direction: column; gap: 18px; scroll-margin-top: 76px; }
.staff-editor .who-row { display: flex; flex-wrap: wrap; gap: 16px; }
.staff-editor .who-row > .field { flex: 0 1 260px; min-width: 0; }
/* The title's label is a long one: when it does not fit beside the name, the title goes under it. */
.staff-editor .who-row > .field.wide { flex: 1 1 340px; }
.staff-editor .who-row > .field.wide input { max-width: 360px; }
/* The name is not a field: an account's name is its owner's to change. It lines up with the field beside it. */
.staff-name { min-height: var(--tap); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-weight: 700; overflow-wrap: anywhere; }
.staff-email { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.staff-editor .label { font-size: 11px; }
/* Level: three choices, each a card. The chosen one has a 2px green edge. */
.levels { display: flex; flex-wrap: wrap; gap: 10px; min-width: 0; }
.level-card { flex: 1 1 180px; display: flex; gap: 10px; align-items: flex-start; min-height: var(--tap); padding: 12px; border: 1px solid var(--input); border-radius: 8px; background: #fff; cursor: pointer; }
.level-card input { margin-top: 3px; }
.level-card.chosen { border: 2px solid var(--green); padding: 11px; }
.level-card .what { display: block; font-size: 13px; color: var(--muted); }
/* Permissions: one row each. What the level gives is ticked and cannot be changed here. */
.perms { display: flex; flex-direction: column; }
.perms > .label { padding-bottom: 6px; }
.perm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-height: 44px; padding: 6px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.perm-row.given { cursor: default; }
.perm-row .name { flex: 1 1 220px; min-width: 0; }
.perm-row .note { font-size: 13px; color: var(--muted); }
.perm-row .note:empty { display: none; }
/* The foot: what the last change came to, then the two buttons. */
.staff-editor .foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: flex-end; }
.staff-editor .foot .msg { flex: 1 1 220px; min-width: 0; }
.staff-empty { color: var(--muted); }
/* The two dialogs: inviting someone, and the confirmation of taking someone off the staff. */
.fde-dialog.staff-dialog { width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; }
.staff-dialog .btnrow { justify-content: flex-end; }

/* ---------- phone rules (design spec section 5) ---------- */
@media (max-width: 860px) {
  main.plain { padding: 20px 16px 40px; gap: 16px; }
  .formrow > .btn { flex: 1 1 100%; }
  /* The list is the full width of the page, and the person's card comes under it. */
  .staff-list { max-width: none; flex-basis: 100%; }
  .staff-side { flex-basis: 100%; }
  .staff-editor { padding: 16px; }
  .staff-editor .who-row > .field { flex: 1 1 100%; }
  .staff-editor .foot .btn { flex: 1 1 auto; }
  .level-card { flex-basis: 100%; }
  .fde-pagehead .btn { flex: 1 1 auto; }
  /* "Included with Editor" goes under the permission's name, in line with it. */
  .perm-row .note { flex: 1 1 100%; padding-left: 28px; }
}
