/* One stylesheet for the donor pages and the staff screens. The bank's main
   colour comes in as --bank (templates/base.html). */
:root {
  --bank: #2f6fbd;
  --ink: #2c2f33;
  --muted: #5f6770;
  --line: #dde1e6;
  --page: #f5f6f7;
  --card: #ffffff;
  --bad: #b3261e;
  --good: #1b7a45;
}
* { box-sizing: border-box; }
html { font-size: 100%; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ink); background: var(--page); line-height: 1.55; }
a { color: var(--bank); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .6rem; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; margin-top: 1.4rem; padding-bottom: .3rem; border-bottom: 2px solid var(--ink); }
h4 { font-size: 1.05rem; font-weight: 500; margin-top: 1.4rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.setup-banner { background: #5b4300; color: #fff; text-align: center; padding: .5rem 1rem; font-size: .95rem; }
.layout { display: flex; min-height: 100vh; }
.sidebar { flex: 0 0 15rem; background: var(--card); border-right: 1px solid var(--line); padding: 1.5rem 1rem; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { margin: 0; }
.sidebar a { display: block; padding: .55rem .75rem; border-radius: .4rem; color: var(--ink); text-decoration: none; }
.sidebar a:hover, .sidebar a[aria-current] { background: var(--page); }
.sidebar-title { font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 0 0 .5rem .75rem; }
.steps li { padding: .55rem .75rem; }
.steps .tick { margin-right: .5rem; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: var(--card); padding: .75rem 1.5rem; position: sticky; top: 0; z-index: 5; border-bottom: 1px solid var(--line); }
.brand { font-size: 1.15rem; font-weight: 600; color: var(--ink); text-decoration: none; }
.brand img { display: block; max-height: 3.5rem; max-width: 17rem; }
.topbar-links { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; justify-content: flex-end; }
.topbar-links a, .link { color: var(--muted); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; padding: 0; }
.topbar-links a:hover, .link:hover { text-decoration: underline; }
.who { color: var(--muted); font-size: .9rem; }
.band { height: 6rem; background: linear-gradient(90deg, color-mix(in srgb, var(--bank) 60%, #fff), color-mix(in srgb, var(--bank) 25%, #fff)); }
.plain .band { height: 3rem; }
.content { width: 100%; max-width: 62rem; margin: -4rem auto 3rem; padding: 0 1rem; }
.plain .content { margin-top: -1rem; }

.card { background: var(--card); border-radius: .5rem; box-shadow: 0 1px 4px rgb(0 0 0 / .08); margin-bottom: 2.5rem; scroll-margin-top: 5rem; }
.card > header { padding: 1.25rem 1.5rem .9rem; border-bottom: 1px solid var(--line); }
.card > header h1, .card > header h2 { margin: 0; color: #55595e; }
.form-section > header h2 { text-transform: uppercase; font-size: 1.25rem; }
.subtitle { margin: .2rem 0 0; font-size: 1.1rem; }
.card-body { padding: 1.25rem 1.5rem 1.5rem; }
.card.narrow { max-width: 30rem; margin-left: auto; margin-right: auto; padding: 1.5rem; }
.card.narrow.wide { max-width: 38rem; }
.page-title { background: var(--card); border-radius: .5rem; padding: 1rem 1.5rem; }

label, .label { display: block; font-weight: 500; margin: .9rem 0 .3rem; padding: 0; }
/* A legend's top margin doesn't push it down, so it gets padding instead. */
legend { display: block; font-weight: 500; margin: 0; padding: .9rem 0 .3rem; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=number], input[type=password], input[type=search], textarea, select {
  width: 100%; font: inherit; color: inherit; padding: .5rem .65rem; border: 1px solid #9aa1a9; border-radius: .3rem; background: #fff;
}
input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible, canvas:focus-visible { outline: 3px solid color-mix(in srgb, var(--bank) 55%, #fff); outline-offset: 1px; }
.row { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 1.25rem; align-items: start; }
.field { grid-column: span 12; min-width: 0; }
.span-1 { grid-column: span 2; } .span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; } .span-8 { grid-column: span 8; } .span-9 { grid-column: span 9; }
.choices, .checks { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; }
.checks { flex-direction: column; padding-left: 1.5rem; }
.choices label, .checks label, .check { display: flex; align-items: center; gap: .45rem; font-weight: 400; margin: .2rem 0; }
.check { margin: .8rem 0; }
.check.locked { color: var(--muted); }
input[type=radio], input[type=checkbox] { width: 1.1rem; height: 1.1rem; accent-color: var(--bank); flex: none; }
.req { color: var(--bad); }
.help { color: var(--muted); font-size: .9rem; margin: .3rem 0 0; }
.detail { font-style: italic; margin: 0 0 .5rem; }
/* A web address written out in a form's wording wraps on a narrow screen. */
.content p a, .content li a { overflow-wrap: anywhere; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.error { color: var(--bad); margin: .3rem 0 0; font-weight: 500; }
.has-error > input, .has-error > textarea { border-color: var(--bad); }
.followups, .group-body { padding-left: 1.5rem; }
.followups { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 1.25rem; align-items: start; }
.group.numbered { border: 1px solid var(--line); border-radius: .3rem; padding: .25rem 1rem 1rem; margin-top: -1px; }
.group.numbered .group-label .number { display: inline-block; width: 2rem; }
.group.numbered .group-body { padding-left: 2rem; }
.group { border-top: 1px solid var(--line); margin-top: 1rem; }
.group-label { margin: .9rem 0 0; font-weight: 500; }
.question { display: grid; grid-template-columns: 2rem 1fr; border: 1px solid var(--line); border-radius: .3rem; padding: .25rem 1rem 1rem; margin-top: -1px; }
.question .number { padding-top: .9rem; }
.note { background: color-mix(in srgb, var(--bank) 12%, #fff); border: 1px solid color-mix(in srgb, var(--bank) 45%, #fff); border-radius: .4rem; padding: .9rem 1.1rem; }
.display { margin: 1rem 0; }
.display-label { text-decoration: underline; }
.signature canvas { display: block; width: 100%; max-width: 26rem; height: auto; aspect-ratio: 600 / 160; background: #eeeeee; border: 1px solid #9aa1a9; border-radius: .3rem; touch-action: none; cursor: crosshair; }
.signature .button { margin-top: .5rem; }
.provider { width: 100%; border-collapse: collapse; }
.provider td { padding: .45rem .5rem .45rem 0; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--muted); }
.provider.lined { max-width: 34rem; margin: .5rem 0 1rem; }
.provider.lined th, .provider.lined td { border: 1px solid var(--line); padding: .45rem .6rem; text-align: left; color: var(--muted); font-weight: 500; }
.provider.lined td + td { width: 35%; }
.provider-lines { display: flex; flex-wrap: wrap; gap: .5rem 2rem; margin: 1.5rem 0 1rem; color: var(--muted); }
.provider-line { display: flex; align-items: flex-end; gap: .5rem; flex: 1 1 14rem; }
.provider-line .blank { flex: 1; min-width: 6rem; border-bottom: 1px solid var(--muted); }
.inline-choice { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .15rem .6rem; margin: 0 .25rem; vertical-align: baseline; }
.inline-choice label { display: inline-flex; align-items: center; gap: .3rem; margin: 0; font-weight: 400; }
.inline-text input { display: inline-block; width: 20rem; max-width: 100%; margin: .15rem .35rem; }
.sentence { margin: 1rem 0; line-height: 2; }
.inline-choice.has-error { outline: 2px solid var(--bad); outline-offset: 3px; border-radius: .2rem; }
ol, ul { padding-left: 1.6rem; }
.form-section li, .next-steps li { margin-bottom: .6rem; }

.button { display: inline-flex; align-items: center; gap: .5rem; font: inherit; font-weight: 600; font-size: .9rem; color: #fff; background: var(--bank); border: 1px solid var(--bank); border-radius: .3rem; padding: .5rem 1rem; text-decoration: none; cursor: pointer; }
.button:hover { filter: brightness(.92); }
.button.quiet { background: #eef1f5; color: #1f3d6b; border-color: #d6dbe2; }
.button.small { font-size: .82rem; padding: .3rem .65rem; }
.button.current { box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px var(--bank); }
.topbar .button { color: #fff; }
.count { background: #fff; color: var(--ink); border-radius: .25rem; padding: 0 .4rem; font-size: .8rem; }
.submit-row { display: flex; gap: .75rem; justify-content: flex-end; margin: 1.5rem 0; }
.narrow form > .button { margin-top: 1.25rem; }

.messages { margin-bottom: 1rem; }
.message { background: var(--card); border-left: 4px solid var(--bank); border-radius: .3rem; padding: .7rem 1rem; margin: 0 0 .6rem; box-shadow: 0 1px 4px rgb(0 0 0 / .08); }
.message.error { border-left-color: var(--bad); color: var(--bad); font-weight: 500; }
.message.success { border-left-color: var(--good); }

.stage-buttons { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1rem; }
.search { display: flex; gap: .5rem; margin-bottom: 1rem; }
.search input { flex: 1; }
.table-wrap { overflow-x: auto; }
.list { width: 100%; border-collapse: collapse; }
.list th { text-align: left; padding: .7rem 1rem; }
.list td { padding: 1rem; border-top: 1px solid var(--line); vertical-align: middle; }
.yes { color: var(--good); font-weight: 700; } .no { color: var(--bad); font-weight: 700; }
.total { color: var(--muted); margin: 1.25rem 0 0; }
.pages { display: flex; gap: 1rem; align-items: center; }
.inline { display: flex; gap: .4rem; flex-wrap: wrap; }

.downloads { display: flex; flex-direction: column; align-items: flex-start; gap: .6rem; padding-bottom: 1.25rem; border-bottom: 3px solid var(--line); }
.checklist { list-style: none; margin: 0 0 1rem; padding: 0; border-radius: .4rem; overflow: hidden; }
.checklist li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .85rem 1rem; border-bottom: 1px solid var(--line); }
.checklist label { display: flex; align-items: center; gap: .75rem; margin: 0; font-weight: 400; }
.checklist .ticked { background: #d8eee2; color: #14613a; }
.checklist .locked label { opacity: .65; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: 1.5rem; }
.spacer { flex: 1; }
.progress { height: 1.1rem; background: #ececec; margin-bottom: 1.5rem; }
.progress span { display: block; height: 100%; background: color-mix(in srgb, var(--bank) 60%, #fff); }
.next-steps { list-style: none; counter-reset: step; padding-left: 2rem; }
.next-steps li { counter-increment: step; }
.next-steps li::before { content: counter(step) ") "; }

/* Sign-in's second step, first-time setup and a person's own account
   (templates/accounts/). */
.lead { color: var(--muted); margin: 0 0 1rem; overflow-wrap: anywhere; }
.centre { text-align: center; }
.good { color: var(--good); }
.button.wide { width: 100%; justify-content: center; }
.button.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.button.quiet.danger { background: #fff; color: var(--bad); border-color: var(--bad); }
.link.underlined { color: var(--bank); text-decoration: underline; }
.or { display: flex; align-items: center; gap: .75rem; margin: 1.25rem 0 .9rem; color: var(--muted); font-size: .9rem; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.heading-sm { font-size: .9rem; font-weight: 700; color: var(--muted); margin: 1.5rem 0 .25rem; }
.alt { list-style: none; margin: 0; padding: 0; }
.alt li + li { border-top: 1px solid var(--line); }
.alt a, .alt button { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: .65rem 0; background: none; border: 0; font: inherit; font-weight: 600; text-align: left; color: var(--bank); text-decoration: none; cursor: pointer; }
.alt a::after, .alt button::after { content: "›"; font-size: 1.4rem; line-height: 1; color: var(--muted); }
.alt a:hover, .alt button:hover { text-decoration: underline; }
.narrow .alt form > button { margin-top: 0; }
.below { text-align: center; font-size: .9rem; color: var(--muted); margin: -1.25rem 0 2rem; }
.setup-steps { list-style: none; display: flex; justify-content: center; gap: 1.25rem; padding: 0; margin: 0 0 1rem; font-size: .9rem; color: var(--muted); }
.setup-steps li { display: flex; align-items: center; gap: .4rem; }
.step-no { width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 2px solid var(--muted); display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; background: var(--card); }
.setup-steps .done { color: var(--good); }
.setup-steps .done .step-no { background: var(--good); border-color: var(--good); color: #fff; }
.setup-steps .current { color: var(--ink); font-weight: 700; }
.setup-steps .current .step-no { border-color: var(--bank); color: var(--bank); }
.qr { text-align: center; margin: 1rem 0; }
.qr svg { max-width: 100%; height: auto; }
.secret { word-break: break-all; }
.codes { columns: 2; column-gap: 2rem; margin: 1rem 0; padding-left: 2rem; }
.codes li { margin: 0 0 .5rem; break-inside: avoid; }
.codes code { font-size: 1.05rem; letter-spacing: .05em; }
.code-acts { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .75rem; }
.codes ~ .button { margin-top: 1rem; }
.devices ~ h2 { margin-top: 1.5rem; }
.crumbs { margin: 0 0 .75rem; font-size: .9rem; }
.plain .crumbs { padding-top: 1.75rem; }
.account-head { margin-bottom: 1rem; }
.plain .account-head { margin-top: 1.75rem; }
.account-head h1 { margin: 0; }
.account-note { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.note.warn { background: #fff6e0; border-color: #e3b341; }
.account-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.account-row.last, .account-row:last-child { border-bottom: 0; }
details.account-row { display: block; }
details.account-row > summary { display: flex; justify-content: space-between; align-items: center; gap: 1rem; cursor: pointer; list-style: none; }
details.account-row > summary::-webkit-details-marker { display: none; }
.row-main { display: flex; flex-direction: column; min-width: 0; }
.row-title { font-weight: 600; }
.row-main .help { margin: 0; }
.change-password { max-width: 26rem; padding: .5rem 0 0; }
.password-box { display: flex; gap: .75rem; align-items: center; }
.password-box input { flex: 1; }
.chip { display: inline-block; font-size: .75rem; font-weight: 600; border-radius: 1rem; padding: .05rem .55rem; vertical-align: middle; }
.chip.ok { background: #d8eee2; color: #14613a; }
.chip.warn { background: #fff6e0; color: #6b4a00; }
.devices { list-style: none; margin: 0 0 1rem; padding: 0; }
.devices > li { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.device-main { display: flex; flex-direction: column; }
.device-main .help { margin: 0; }
.device-acts { display: flex; gap: .5rem; align-items: flex-start; flex-wrap: wrap; }
details.mini > summary { list-style: none; cursor: pointer; }
details.mini > summary::-webkit-details-marker { display: none; }
.rename { display: flex; gap: .5rem; margin-top: .5rem; }
.confirm-remove { max-width: 22rem; margin-top: .5rem; }
details.more { margin-top: .75rem; }
details.more summary { cursor: pointer; color: var(--bank); }

/* The bank's audit log (audit/views.py) and Reset sign-in on the Admins page */
.log-filters { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; margin: 0 0 1rem; }
.log-filters label { display: block; font-size: .85rem; font-weight: 600; margin: 0 0 .2rem; }
.log-filters select { min-width: 11rem; }
.log-filters .download { margin-left: auto; }
table.audit td { vertical-align: top; }
table.audit .time { white-space: nowrap; }
table.audit .day th { background: #eef1f5; text-align: left; font-size: .85rem; }
table.audit .sub { display: block; color: var(--muted); font-size: .85rem; }
table.audit tr.failed td { background: #fdf1f0; }
.chip.us { background: #e4ebf7; color: #1f3d6b; }
details.reset-sign-in { margin-top: .4rem; }
.reset-body { max-width: 24rem; margin-top: .5rem; font-size: .9rem; }
.reset-body p { margin: 0 0 .5rem; }

@media (max-width: 52rem) {
  /* The audit log reads down the page on a phone: time, who, what, donor. */
  table.audit thead { display: none; }
  table.audit, table.audit tbody, table.audit tr, table.audit td, table.audit .day th { display: block; }
  table.audit tr { padding: .5rem 0; border-bottom: 1px solid var(--line); }
  table.audit tr.day { padding: 0; border: 0; }
  table.audit td { border: 0; padding: .1rem .5rem; }
  table.audit td.time { color: var(--muted); font-size: .85rem; }
  table.audit td.none { display: none; }
  .layout { flex-direction: column; }
  .sidebar { flex: none; border-right: 0; border-bottom: 1px solid var(--line); padding: .75rem 1rem; }
  .sidebar ul { display: flex; flex-wrap: wrap; gap: 0 .25rem; }
  .sidebar a, .steps li { padding: .3rem .6rem; }
  .topbar { padding: .6rem 1rem; }
  .band { height: 3rem; }
  .content { margin-top: -1.5rem; }
  .row { grid-template-columns: 1fr; }
  .row > .field { grid-column: 1 / -1; }
  .card-body, .card > header { padding-left: 1rem; padding-right: 1rem; }
  .followups, .group-body { padding-left: .75rem; }
  .search { flex-wrap: wrap; }
}
