/* Public form pages — open forms (DAS-350) and no-auth/email links (DAS-136).
   Self-contained: these pages do NOT load the SPA stylesheets. The brand
   (font, colours, card) is static/css/mats-theme.css, loaded first. */
.pf-shell { max-width: 760px; margin: 0 auto; padding: 32px 20px 64px; }
.pf-header { display: flex; align-items: center; margin-bottom: 28px; }
.pf-footer { margin-top: 20px; color: var(--mats-600); font-size: 13px; text-align: center; }

h1.pf-title {
    font-size: 2.1rem; font-weight: 400; line-height: 1.15; letter-spacing: -0.04rem;
    color: var(--mats-900); margin: 0 0 14px; text-wrap: balance;
}
.pf-instructions { color: var(--mats-800); margin: 0 0 28px; white-space: pre-wrap; }
/* A section's title (open-form.js renders it as an h2.pf-q). */
h2.pf-q {
    font-size: 1.45rem; font-weight: 400; letter-spacing: -0.02rem; line-height: 1.25;
    color: var(--mats-900); margin: 40px 0 18px; padding-top: 28px;
    border-top: 1px solid var(--mats-300);
}
h2.pf-q + .pf-instructions { margin-top: -8px; color: var(--mats-600); }
/* The form's own instructions, as a banner nobody scrolls past. */
.pf-banner {
    background: var(--mats-red-50); border-left: 4px solid var(--mats-red-600);
    border-radius: 6px; padding: 14px 18px; color: var(--mats-900);
}
.pf-field { margin-bottom: 26px; }
/* A conditional heading: a question asked above this one (the EOI's point of
   contact, over Full name / Email address). */
.pf-fheading { font-weight: 600; font-size: 1.05rem; color: var(--mats-900); margin: 0 0 14px; }
.pf-field > label.pf-q { display: block; font-weight: 600; color: var(--mats-900); margin-bottom: 8px; }
/* A question's help text, as its author wrote it (line breaks kept). */
.pf-fnote { color: var(--mats-600); font-size: 0.92rem; margin: -4px 0 10px; white-space: pre-wrap; }
/* Help text drawn from Markdown (ReviewMd.md): its own paragraphs and lists
   carry the spacing, so no pre-wrap — and lists sit tight. */
.pf-md { white-space: normal; }
.pf-md > p { margin: 0 0 0.6em; }
.pf-md > ul, .pf-md > ol { margin: 0 0 0.6em; padding-left: 1.4em; }
.pf-md li { margin: 0.15em 0; }
.pf-md > :last-child { margin-bottom: 0; }
/* The question's own star — and a lone tick row's, whose text IS the question
   (checkbox_single) — never each option of a required group. */
.pf-required > label.pf-q::after,
.pf-required > label.pf-opt:only-of-type::after { content: " *"; color: var(--mats-red-500); }
.pf-recipients { font-size: 12px; color: var(--mats-600); margin: 2px 0 8px; }

.pf-input, .pf-select, textarea.pf-input {
    width: 100%;
    min-height: 2.9rem;
    padding: 10px 14px;
    border: 1px solid var(--mats-300);
    border-radius: 6px;
    font: inherit;
    color: var(--mats-900);
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.pf-input:hover, .pf-select:hover { border-color: var(--mats-500); }
.pf-input:focus, .pf-select:focus {
    outline: none; border-color: var(--mats-red-600); box-shadow: var(--mats-focus);
}
textarea.pf-input { min-height: 120px; resize: vertical; }

.pf-opt { display: flex; align-items: flex-start; gap: 10px; margin: 8px 0; cursor: pointer; }
.pf-opt input { margin-top: 5px; width: 16px; height: 16px; flex: none; }
.pf-scale { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-scale label {
    display: inline-flex; flex-direction: column; align-items: center;
    border: 1px solid var(--mats-300); border-radius: 6px; padding: 8px 12px; cursor: pointer;
    min-width: 46px; background: #fff;
}
.pf-scale label:hover { border-color: var(--mats-500); }
.pf-scale label:has(input:checked) { border-color: var(--mats-red-600); background: var(--mats-red-50); }
.pf-scale input { margin: 0 0 4px; }
.pf-scale-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--mats-600); margin-top: 4px; }
/* Ranking rows (`rank`, `rank_all`) and the rate-each people picker
   (`fellow_rating`) — one row per item, its controls on the right. */
.pf-rank, .pf-prate { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.pf-rank-row, .pf-prate-row {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    border: 1px solid var(--mats-300); border-radius: 6px; padding: 6px 10px; background: #fff;
}
.pf-rank-row span, .pf-prate-name { flex: 1; min-width: 140px; }
button.pf-rank-btn {
    appearance: none; display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; padding: 0;
    border: 1px solid var(--mats-300); border-radius: 999px;
    background: #fff; color: inherit; cursor: pointer;
}
button.pf-rank-btn:hover:not(:disabled) { border-color: var(--mats-800); }
button.pf-rank-btn:disabled { opacity: 0.4; cursor: default; }
.pf-grid { width: 100%; border-collapse: collapse; }
.pf-grid th, .pf-grid td { border: 1px solid var(--mats-300); padding: 6px 8px; text-align: center; font-size: 13px; }
.pf-grid th { background: var(--mats-100); font-weight: 500; }
.pf-grid th.pf-rowhdr, .pf-grid td.pf-rowhdr { text-align: left; font-weight: 500; }
.pf-conf { font-size: 13px; color: var(--mats-600); margin-top: 6px; display: flex; gap: 6px; align-items: center; }

/* The site's buttons: pills, maroon primary, outlined secondary. */
button.pf-btn {
    appearance: none; border: 1px solid var(--mats-red-600); border-radius: 999px;
    min-height: 2.7rem; padding: 8px 22px;
    background: var(--mats-red-600); color: #fff; font: inherit; font-weight: 500;
    cursor: pointer; transition: background-color 0.2s, border-color 0.2s;
}
button.pf-btn:hover:not(:disabled) { background: var(--mats-red-700); border-color: var(--mats-red-700); }
button.pf-btn:focus-visible { outline: none; box-shadow: var(--mats-focus); }
button.pf-btn:disabled { opacity: 0.55; cursor: default; }
button.pf-btn.pf-secondary { background: #fff; color: var(--mats-800); border-color: var(--mats-800); }
button.pf-btn.pf-secondary:hover:not(:disabled) { background: var(--mats-200); border-color: var(--mats-200); }
button.pf-btn.pf-btn-small { min-height: 0; padding: 5px 14px; font-size: 13px; }
.pf-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

.pf-error { color: var(--mats-red-500); font-size: 14px; margin: 10px 0 0; }
.pf-note { color: var(--mats-600); font-size: 0.92rem; margin: 0 0 16px; }
.pf-loading { color: var(--mats-600); margin: 0; }
.pf-success { text-align: center; padding: 16px 0; }
.pf-success .pf-check { font-size: 40px; color: var(--mats-green); }
.pf-pw-row { display: flex; gap: 8px; }
.pf-pw-row .pf-input { flex: 1; }
.pf-worklist-row {
    display: flex; align-items: center; gap: 12px; width: 100%;
    text-align: left; background: #fff; border: 1px solid var(--mats-300);
    border-radius: 6px; padding: 12px 14px; margin-bottom: 8px; cursor: pointer;
    font: inherit; color: inherit;
}
.pf-worklist-row:hover { border-color: var(--mats-red-600); background: var(--mats-red-50); }
.pf-worklist-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.pf-worklist-name { font-weight: 600; }
.pf-worklist-sub { font-size: 12px; color: var(--mats-600); }
.pf-worklist-go { color: var(--mats-red-600); font-weight: 600; white-space: nowrap; }
/* The "Someone else…" fallback row: dashed border marks it as an add-affordance,
 * distinct from the concrete owed items above it. */
.pf-worklist-other { border-style: dashed; }
.pf-file-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.pf-file-row .pf-fnote { margin: 0; flex: 1; }
/* Open forms (DAS-350): the private edit link, and the field a check flagged. */
.pf-edit-link { width: 100%; font-family: ui-monospace, monospace; font-size: 13px; }
.pf-after-link { margin-top: 14px; overflow-wrap: anywhere; }
.pf-field.pf-missing { border-left: 3px solid var(--mats-red-500); padding-left: 12px; }
.pf-rehearsal {
    background: var(--mats-amber-bg); border: 1px solid var(--mats-amber-line); color: var(--mats-amber-ink);
    border-radius: 6px; padding: 8px 12px; margin-bottom: 20px; font-size: 13px;
}
