/*
 * Members area (/members). Loaded only by views/members/*, which have their
 * own slim header and footer and don't load the site's Bootstrap build.
 *
 * Set in Public Sans, the U.S. government's typeface (OFL, served from
 * /fonts/public-sans so no third-party font request is made). The one loud
 * element is the "Show staff" placard; everything else stays quiet.
 */

@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/public-sans/PublicSans-latin-var.woff2") format("woff2");
}

.members {
  --m-navy: #0d2456;
  --m-gold: #dac23c;
  --m-text: #1b2333;
  --m-muted: #566074;
  --m-paper: #f2f4f8;
  --m-rule: #d7dce6;
  --m-ok: #17603f;
  --m-ok-bg: #e7f4ec;
  --m-warn: #8a4b00;
  --m-warn-bg: #fdf1dc;
  --m-bad: #9e1c1c;
  --m-bad-bg: #fbe9e9;
  margin: 0;
  background: var(--m-paper);
  font-family: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--m-text);
  -webkit-font-smoothing: antialiased;
}

.members *,
.members *::before,
.members *::after {
  box-sizing: border-box;
}

.members img {
  max-width: 100%;
}

/* Slim header: the seal, the name, and a way to get help. */

.m-header {
  background: var(--m-navy);
}

.m-header__inner {
  max-width: 680px;
  min-height: 56px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.m-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
}

.m-brand img {
  width: 34px;
  height: 34px;
}

.m-header__link {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.m-brand:hover,
.m-header__link:hover {
  color: #fff;
  text-decoration: underline;
}

.m-header :focus-visible {
  outline: 3px solid var(--m-gold);
  outline-offset: 3px;
}

/* One line of links instead of the site footer. */

.m-footer {
  background: #fff;
  border-top: 1px solid var(--m-rule);
}

.m-footer__inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 18px 16px 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 14px;
}

.m-footer a {
  color: var(--m-muted);
}

.m-footer a:focus-visible {
  outline: 3px solid var(--m-navy);
  outline-offset: 2px;
}

.m-main {
  max-width: 680px;
  margin: 0 auto;
  padding: 28px 16px 72px;
  font-size: 17px;
  line-height: 1.55;
}

.m-main h1 {
  font-size: 30px;
  line-height: 1.15;
  font-weight: 750;
  letter-spacing: -0.01em;
  color: var(--m-navy);
  margin: 0 0 10px;
}

.m-main h2 {
  font-size: 20px;
  line-height: 1.25;
  font-weight: 700;
  color: var(--m-navy);
  margin: 36px 0 12px;
}

.m-main p {
  margin: 0 0 14px;
}

.m-main ul,
.m-main ol {
  padding-left: 22px;
  margin: 0 0 14px;
}

.m-main li,
.m-placard li {
  margin-bottom: 6px;
}

.m-main a {
  color: var(--m-navy);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.m-lede {
  font-size: 18px;
  color: var(--m-muted);
  max-width: 34em;
}

.m-small {
  font-size: 14px;
  color: var(--m-muted);
}

.m-main :focus-visible,
.m-tabs :focus-visible {
  outline: 3px solid var(--m-navy);
  outline-offset: 2px;
}

/* Account tabs, under the header. The gold underline is the vest stripe. */

.m-tabs {
  background: #fff;
  border-bottom: 1px solid var(--m-rule);
}

.m-tabs__inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 8px;
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
}

.m-tab {
  flex: 0 0 auto;
  padding: 14px 8px 11px;
  font-size: 15px;
  font-weight: 600;
  color: var(--m-muted);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}

.m-tab:hover {
  color: var(--m-navy);
  text-decoration: none;
}

.m-tab.is-active {
  color: var(--m-navy);
  border-bottom-color: var(--m-gold);
}

/* Buttons and forms */

.m-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 20px;
  border: 2px solid var(--m-navy);
  border-radius: 6px;
  background: var(--m-navy);
  color: #fff;
  font: inherit;
  font-weight: 650;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
}

.m-main a.m-btn {
  color: #fff;
  text-decoration: none;
}

.m-btn:hover {
  background: #142f6b;
}

.m-btn--quiet,
.m-main a.m-btn--quiet {
  background: #fff;
  color: var(--m-navy);
}

.m-btn--quiet:hover {
  background: #eef1f7;
}

.m-btn--danger {
  background: #fff;
  border-color: var(--m-bad);
  color: var(--m-bad);
}

.m-btn--danger:hover {
  background: var(--m-bad-bg);
}

.m-btn--gold,
.m-main a.m-btn--gold {
  background: var(--m-gold);
  border-color: var(--m-gold);
  color: var(--m-navy);
}

.m-btn--gold:hover {
  background: #e6cf55;
}

.m-btn--small {
  min-height: 40px;
  padding: 6px 14px;
  font-size: 15px;
}

.m-btn--block {
  display: flex;
  width: 100%;
}

.m-form {
  margin: 20px 0;
}

.m-field {
  margin-bottom: 18px;
}

.m-field label,
.m-label {
  display: block;
  font-weight: 650;
  margin-bottom: 6px;
}

.m-field .m-hint {
  display: block;
  font-size: 14px;
  color: var(--m-muted);
  margin: -2px 0 6px;
}

.m-field input[type="email"],
.m-field input[type="text"],
.m-field input[type="date"],
.m-field input[type="file"],
.m-field select {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #aeb6c5;
  border-radius: 6px;
  background: #fff;
  font: inherit;
  font-size: 16px;
  color: var(--m-text);
}

.m-field input[type="file"] {
  padding: 10px;
}

.m-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.m-check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.m-check input {
  width: 22px;
  height: 22px;
  margin-top: 3px;
  flex: 0 0 auto;
}

/* Messages */

.m-alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin: 16px 0;
  border-left: 5px solid;
}

.m-alert--ok {
  background: var(--m-ok-bg);
  border-color: var(--m-ok);
}

.m-alert--error {
  background: var(--m-bad-bg);
  border-color: var(--m-bad);
}

.m-alert--info {
  background: #fff;
  border-color: var(--m-navy);
}

.m-note {
  background: #fff;
  border: 1px solid var(--m-rule);
  border-radius: 6px;
  padding: 14px 16px;
  margin: 16px 0;
  font-size: 16px;
}

/* Dashboard: the one panel that stands out is the way into the access screens. */

.m-help {
  display: block;
  margin: 22px 0 8px;
  padding: 20px 20px 18px;
  border-radius: 10px;
  border-left: 8px solid var(--m-gold);
  background: var(--m-navy);
  color: #fff;
  text-decoration: none;
}

.m-main a.m-help {
  color: #fff;
  text-decoration: none;
}

.m-help:hover {
  background: #142f6b;
}

.m-help:focus-visible {
  outline-color: var(--m-gold);
}

.m-help__title {
  display: block;
  font-size: 24px;
  font-weight: 750;
  line-height: 1.2;
}

.m-help__text {
  display: block;
  margin-top: 6px;
  color: #d5dcec;
}

.m-main .m-attention {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}

.m-main .m-attention li {
  margin: 0 0 8px;
}

/* A registered dog, laid out like the ID card it comes with. */

.m-dog {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 14px;
  align-items: start;
  background: #fff;
  border: 1px solid var(--m-rule);
  border-top: 4px solid var(--m-navy);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
}

.m-dog__photo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--m-paper);
  color: #9aa3b5;
  font-size: 28px;
}

.m-dog__name {
  font-size: 19px;
  font-weight: 700;
  color: var(--m-navy);
  margin: 0;
}

.m-dog__meta {
  font-size: 15px;
  color: var(--m-muted);
  margin: 2px 0 10px;
}

.m-dog__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Lists of rows: documents, places */

.m-main .m-rows {
  list-style: none;
  padding: 0;
  margin: 12px 0;
  background: #fff;
  border: 1px solid var(--m-rule);
  border-radius: 8px;
}

.m-main .m-rows > li {
  margin: 0;
  border-top: 1px solid var(--m-rule);
}

.m-main .m-rows > li:first-child {
  border-top: 0;
}

.m-doc {
  padding: 16px;
}

.m-doc__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.m-doc__kind {
  font-weight: 700;
  margin: 0;
}

.m-doc__meta {
  font-size: 15px;
  color: var(--m-muted);
  margin: 2px 0 12px;
}

.m-doc__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

/* Fallback only. With scripting on, the Edit panel is lifted into a modal
   (views/members/includes/panel-dialog.ejs) and the button stays put. Without
   it, the open panel takes its own full-width row rather than a third of one. */
.m-doc details[open] {
  flex-basis: 100%;
  order: 1;
}

.m-main summary.m-btn {
  display: inline-flex;
  list-style: none;
}

.m-main summary.m-btn::-webkit-details-marker {
  display: none;
}

.m-doc details[open] > .m-doc__panel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--m-rule);
}

.m-chip {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 650;
  padding: 3px 9px;
  border-radius: 99px;
  white-space: nowrap;
}

.m-chip--expired {
  background: var(--m-bad-bg);
  color: var(--m-bad);
}

.m-chip--expiring {
  background: var(--m-warn-bg);
  color: var(--m-warn);
}

.m-chip--current {
  background: var(--m-ok-bg);
  color: var(--m-ok);
}

.m-place {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  min-height: 64px;
  font-size: 18px;
  font-weight: 650;
}

.m-main a.m-place {
  color: var(--m-navy);
  text-decoration: none;
}

.m-place:hover {
  background: #f7f8fb;
}

.m-place__icon {
  width: 28px;
  text-align: center;
  font-size: 20px;
  color: var(--m-navy);
}

.m-place__go {
  margin-left: auto;
  color: var(--m-muted);
  font-size: 14px;
}

.m-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.m-main .m-switch a {
  padding: 6px 14px;
  border: 1px solid var(--m-rule);
  border-radius: 99px;
  background: #fff;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.m-main .m-switch a[aria-current="true"] {
  background: var(--m-navy);
  border-color: var(--m-navy);
  color: #fff;
}

/* Access rights page */

.m-back {
  display: inline-block;
  font-size: 15px;
  margin-bottom: 14px;
}

.m-kind {
  font-size: 15px;
  font-weight: 650;
  color: var(--m-muted);
  margin: 0 0 18px;
}

.m-law {
  font-size: 18px;
}

/* Exactly two questions, so they're numbered large. */
.m-main .m-questions {
  list-style: none;
  counter-reset: q;
  padding: 0;
}

.m-main .m-questions li {
  counter-increment: q;
  position: relative;
  padding: 12px 14px 12px 54px;
  margin-bottom: 8px;
  background: #fff;
  border: 1px solid var(--m-rule);
  border-radius: 8px;
  font-weight: 600;
}

.m-questions li::before {
  content: counter(q);
  position: absolute;
  left: 14px;
  top: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--m-navy);
  color: #fff;
  font-size: 15px;
  line-height: 28px;
  text-align: center;
}

.m-script {
  border-left: 4px solid var(--m-gold);
  padding: 4px 0 4px 14px;
  margin: 0 0 12px;
  font-size: 18px;
}

.m-sources {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--m-rule);
  font-size: 14px;
  color: var(--m-muted);
}

.m-sources ul {
  padding-left: 18px;
}

/* The placard: a preview on the page, and full screen to hand to staff. */

.m-placard {
  position: relative;
  background: #fff;
  color: #000;
  border: 2px solid #000;
  border-top: 14px solid var(--m-gold);
  border-radius: 4px;
  padding: 20px 18px 16px;
}

.m-placard__heading {
  font-size: 22px;
  line-height: 1.2;
  font-weight: 800;
  color: #000;
  margin: 0 0 12px;
}

.m-placard ul {
  padding-left: 20px;
  margin: 0 0 12px;
}

.m-placard li {
  margin-bottom: 8px;
}

.m-placard__cite {
  font-size: 14px;
  font-weight: 600;
  border-top: 1px solid #000;
  padding-top: 8px;
  margin: 0;
}

.m-placard--full {
  position: fixed;
  inset: 0;
  z-index: 2000;
  margin: 0;
  border: 0;
  border-top: 18px solid var(--m-gold);
  border-radius: 0;
  overflow-y: auto;
  padding: 24px 22px 32px;
  font-size: 21px;
  line-height: 1.45;
}

.m-placard--full .m-placard__heading {
  font-size: 32px;
  margin-right: 90px;
}

.m-placard--full .m-placard__cite {
  font-size: 16px;
}

.m-placard__close {
  position: absolute;
  top: 14px;
  right: 14px;
  min-height: 48px;
  padding: 8px 16px;
  border: 2px solid #000;
  border-radius: 6px;
  background: #fff;
  color: #000;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
}

.m-placard[hidden] {
  display: none;
}

/* On phones the "Show staff" button stays within thumb reach. */
.m-showbar {
  position: sticky;
  bottom: 0;
  margin: 24px -16px 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(242, 244, 248, 0.96);
  border-top: 1px solid var(--m-rule);
}

body.m-no-scroll {
  overflow: hidden;
}

@media (min-width: 720px) {
  .m-main {
    padding-top: 40px;
  }

  .m-main h1 {
    font-size: 36px;
  }

  .m-tab {
    padding-left: 14px;
    padding-right: 14px;
  }

  .m-showbar {
    position: static;
    margin: 24px 0 0;
    padding: 0;
    background: none;
    border: 0;
  }
}

@media (max-width: 420px) {
  .m-field-row {
    grid-template-columns: 1fr;
  }
}

/* ESA letter renewal offer: shown wherever an ESA owner might look for it. */

.m-offer {
  margin: 22px 0 8px;
  padding: 20px;
  background: #fff;
  border: 2px solid var(--m-gold);
  border-radius: 10px;
}

.m-main .m-offer__title {
  margin: 0 0 6px;
  font-size: 22px;
}

.m-main .m-offer__price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 0 0 8px;
}

.m-offer__now {
  font-size: 34px;
  font-weight: 800;
  color: var(--m-navy);
  line-height: 1;
}

.m-offer__was {
  font-size: 18px;
  color: var(--m-muted);
}

.m-offer__tag {
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
  color: var(--m-ok);
  background: var(--m-ok-bg);
  padding: 3px 10px;
  border-radius: 99px;
}

.m-main .m-offer__text {
  font-size: 16px;
}

.m-main .m-offer__fine {
  margin: 10px 0 0;
}

.m-dog__name a {
  color: inherit;
  text-decoration: none;
}

.m-dog__name a:hover {
  text-decoration: underline;
}

/* What a replacement card will say, before paying for it. */

.m-reprint {
  margin: 14px 0 4px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--m-rule);
  border-top: 4px solid var(--m-navy);
  border-radius: 8px;
}

.m-main .m-reprint__label {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--m-muted);
}

.m-main .m-reprint__dog {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--m-navy);
}

.m-main .m-reprint__handler {
  margin: 0 0 8px;
  font-size: 17px;
}

/* Current photo above the change-photo form on a dog's page. */
.m-photo {
  margin: 0 0 1rem;
}
.m-photo__current {
  display: block;
  width: 160px;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--m-line, #dfe3e8);
  background: #f4f6f8;
}
.m-photo .m-small {
  margin: 0.5rem 0 0;
}

/* "Registering another dog?" promotion block on the dashboard. */
.m-offer {
  border: 1px solid var(--m-line, #dfe3e8);
  border-radius: 10px;
  padding: 1rem 1.15rem;
  background: #f8fafc;
}
.m-offer__lead {
  margin: 0 0 0.6rem;
}
.m-offer__code {
  margin: 0 0 0.6rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  background: #fff;
  border: 1px dashed var(--m-line, #dfe3e8);
  border-radius: 6px;
  padding: 0.55rem 0.8rem;
  display: inline-block;
}
.m-offer .m-small {
  margin: 0 0 0.9rem;
}
.m-offer p:last-child {
  margin-bottom: 0;
}

/* Square cropper shown after choosing a new card photo. */
.m-crop {
  margin: 0 0 1rem;
}
.m-crop .m-small {
  margin: 0 0 0.5rem;
}
.m-crop__stage {
  max-width: 320px;
}
.m-crop__stage img {
  display: block;
  max-width: 100%;
}

/* Confirmation dialog for anything that deletes something.
   views/members/includes/confirm-dialog.ejs */
.m-modal {
  width: min(26rem, calc(100vw - 2rem));
  padding: 0;
  border: 1px solid var(--m-rule);
  border-radius: 12px;
  background: #fff;
  color: var(--m-text);
}

.m-modal::backdrop {
  background: rgba(13, 36, 86, 0.45);
}

.m-modal__box {
  padding: 1.25rem;
}

.m-modal__title {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  line-height: 1.3;
  color: var(--m-navy);
}

.m-modal__text {
  margin: 0 0 1.25rem;
  color: var(--m-muted);
}

.m-modal__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* The delete button sits in the row with View and Edit, not under them. */
.m-doc__actions .m-confirm {
  display: inline-flex;
}

/* Wider box for a form lifted out of a disclosure panel.
   views/members/includes/panel-dialog.ejs */
.m-modal--wide {
  width: min(34rem, calc(100vw - 2rem));
}

.m-modal--wide .m-modal__box {
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
}

.m-modal__box form > .m-btn + .m-btn {
  margin-left: 8px;
}

/* Smart Tag pages (/t/<code>) */

.t-lost {
  background: var(--m-bad);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  border-radius: 8px;
  padding: 14px 16px;
  margin: 0 0 20px;
}

.t-hero {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 8px;
}

.t-hero h1 {
  margin: 0 0 4px;
}

.t-hero__photo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--m-paper);
  color: var(--m-navy);
  font-size: 36px;
}

.t-text {
  white-space: pre-line;
}

.t-actions .m-btn {
  margin-bottom: 10px;
}

.t-hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
