/* check-mark.css - the app check marks. One drawn check shape, never a typed
 * character, in three roles:
 *   .check-mark                  List tick: white check on bright green #00C434
 *                                (check-circle-green-bright.svg), for feature and
 *                                what's-included lists where the words carry the meaning.
 *   .check-mark--done            Done: mint #AAF3DF disc, darker mint edge, navy check
 *                                (check-circle-mint.svg), for a finished step, a signed
 *                                document, a saved setting, a rule met or access granted.
 *   .check-mark--selected        Selected: lime #84D828 disc with a near-black check,
 *                                for the card, tile or option someone has chosen.
 * Loaded by the landlord, renter, owner portal, application and public shells.
 *
 * Usage:  <span class="check-mark check-mark--done" aria-hidden="true"></span>
 * The mark sizes itself from the surrounding font-size; override with
 * font-size, never width/height.
 *
 * Page components that already draw a step circle or tick keep their own size:
 * the lists below paint them with the matching role and hide the old glyph.
 *
 * Public pages repaint .check-mark in their own colourway (public-checks.css).
 * Emails use /images/email-icons/check-circle.png.
 */

:root {
  --app-check-icon: url("/images/ui-symbols/check-circle-green-bright.svg");
  --app-check-done-icon: url("/images/ui-symbols/check-circle-mint.svg");
  /* The disc fills 75% of the SVG box; 133% makes it fill the mark's box. */
  --app-check-fill: 133%;
  --check-mark-bg: #84D828;   /* the Selected disc; public embeds paint their own disc with it */
  --check-mark-fg: #FFFFFF;
  --check-mark-selected-fg: #1B1C1A;
}

.check-mark {
  display: inline-block;
  flex: none;
  width: 1.15em;
  height: 1.15em;
  border-radius: 999px;
  background: var(--app-check-icon) center / var(--app-check-fill) no-repeat;
  line-height: 1;
  vertical-align: -0.2em;
}

/* Larger mark. */
.check-mark--lg { font-size: 1.6em; }

/* Done. --aa is the older name for the same mark. */
.check-mark:is(.check-mark--done, .check-mark--aa) { background-image: var(--app-check-done-icon); }

/* Selected: a lime disc with a drawn near-black check. */
.check-mark--selected { display: inline-grid; place-items: center; background: var(--check-mark-bg); color: var(--check-mark-selected-fg); }
.check-mark--selected::before {
  content: "";
  display: block;
  width: 0.5em;
  height: 0.26em;
  border-left: 0.13em solid currentColor;
  border-bottom: 0.13em solid currentColor;
  transform: translateY(-0.06em) rotate(-45deg);
}

/* Step circles and completion marks drawn by page components take the Done
 * mark at their own size; the number or typed glyph inside is hidden. */
html body:not([data-public-site]) :is(
  #property-setup-workspace .setup-step.is-complete > .setup-step-number,
  #property-setup-workspace #aw-workspace-sidebar .setup-step.is-complete > .setup-step-number,
  .lc-mo-step.is-done .lc-mo-num,
  .lj-strip .is-done a > span,
  .ls-setup .ls-completed-check,
  .is-done > .ow-step-box, .is-done > summary > .ow-step-box, .ow-setup-steps li.is-done .ow-step-box,
  .ow-leasing-page .is-done > .ow-step-box, .ow-leasing-page .is-done > summary > .ow-step-box,
  .pay-left .is-done .pay-left-mark,
  .is-done > .pay-steps-mark,
  .ow-wo-public .wo-steps .is-done .wo-step-dot,
  .marketing-completed-check,
  #rw-workspace .ap-track li.is-done .ap-track-n,
  .cr-complete-check,
  .cr-room-mark.is-done,
  .cr-ready-check,
  body.ow.ow-condition-view #ow-main .cr-view-check,
  .dv-steps .is-done .dv-n,
  .is-done > .invite-success-number,
  .ow-payments-hub .pay-setup-checklist li > .pay-setup-state.is-complete,
  body.ow #pw-workspace .pay-setup-checklist .pay-setup-list .pay-setup-state.is-complete,
  .ow-lease-preparation .lp-progress.is-complete li > span:first-child,
  .cr-demo-saved,
  .step.done .stepnum,
  .application-milestone.is-complete .milestone-number,
  .review-overview-icon.is-done,
  #ac-money-flow .is-done .ac-flow-marker,
  .cr-wizard-steps .is-complete i,
  .mn-page .mn-pay-track .is-done .mn-pay-dot,
  .ow .ow-payment-progress .is-done:not(.is-danger) .ow-tracker-dot,
  body.ow .ow-wizard .is-done .listing-step-marker,
  #auth-online .pw-checks li.is-met .pw-mark,
  .ow-lease-audit .pt-result .pt-glyph.ok,
  .pt-glyph.ok
) {
  background: var(--app-check-done-icon) center / var(--app-check-fill) no-repeat;
  background-origin: border-box;
  border-color: transparent;
  border-radius: 50%;
  box-shadow: none;
  color: transparent;
}
html body:not([data-public-site]) :is(.cr-ready-check > svg) { visibility: hidden; }
html body:not([data-public-site]) :is(#auth-online .pw-checks li.is-met .pw-mark, .ow-lease-audit .pt-result .pt-glyph.ok, .pt-glyph.ok)::before { content: ""; }

/* Marks drawn as a pseudo-element take the Done mark at their own size. */
html body:not([data-public-site]) :is(.users-access-mark.is-yes)::before {
  content: "";
  background: var(--app-check-done-icon) center / var(--app-check-fill) no-repeat;
}
html body:not([data-public-site]) .ow-listing-launch .scene-site::after {
  content: "";
  background: var(--app-check-done-icon) center / var(--app-check-fill) no-repeat;
}

/* Done marks beside text, in place of a typed check. */
html body:not([data-public-site]) :is(
  .in-drop.has-file .in-drop-hint,
  .in-proof-form .to-field > .in-from,
  .in-check-state[data-tone="ok"]
)::before {
  content: "";
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  margin-right: 0.3em;
  vertical-align: -0.2em;
  border-radius: 50%;
  background: var(--app-check-done-icon) center / var(--app-check-fill) no-repeat;
}
html body:not([data-public-site]) .ow-cr-rooms li.is-done a::after {
  content: "";
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  margin-left: 0.3em;
  vertical-align: -0.2em;
  border-radius: 50%;
  background: var(--app-check-done-icon) center / var(--app-check-fill) no-repeat;
}
html body:not([data-public-site]) :is(.pay-steps-check, .cr-demo-reviewed > span:first-child, .ruf-feedback[data-upload-state="success"] .ruf-symbol) {
  display: inline-block;
  flex: none;
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.2em;
  border-radius: 50%;
  background: var(--app-check-done-icon) center / var(--app-check-fill) no-repeat;
  color: transparent;
  overflow: hidden;
}

/* Selected marks drawn by page components: a lime disc with a drawn check. */
html body:not([data-public-site]) :is(
  .ow.ow-property-type-page.ow-property-flow-clarity .ow-main .type-page .ow-type-tick,
  #property-setup-workspace .type-page .ow-type-card .ow-type-tick,
  body.ow .ow-theme-ball span
) {
  background: var(--check-mark-bg);
  border-radius: 50%;
  color: transparent;
}
html body:not([data-public-site]) :is(body.ow .ow-theme-ball span) { display: grid; place-items: center; width: 24px; height: 24px; font-size: 0; --check-mark-tick: 11px; }
html body:not([data-public-site]) :is(
  .ow.ow-property-type-page.ow-property-flow-clarity .ow-main .type-page .ow-type-tick,
  #property-setup-workspace .type-page .ow-type-card .ow-type-tick,
  body.ow .ow-theme-ball span
)::before {
  content: "";
  display: block;
  width: var(--check-mark-tick, 9px);
  height: calc(var(--check-mark-tick, 9px) / 2);
  border-left: calc(var(--check-mark-tick, 9px) / 4) solid var(--check-mark-selected-fg);
  border-bottom: calc(var(--check-mark-tick, 9px) / 4) solid var(--check-mark-selected-fg);
  transform: translateY(-1px) rotate(-45deg);
}
/* The chosen answer on a two-way switch: the disc and its check are the
 * button's two pseudo-elements, laid one over the other before the label. */
html body:not([data-public-site]) :is(body.settings-application #aw-workspace-panel .ow-ask button.is-on)::before {
  content: "";
  order: -2;
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--check-mark-bg);
}
html body:not([data-public-site]) :is(body.settings-application #aw-workspace-panel .ow-ask button.is-on)::after {
  content: "";
  order: -1;
  flex: none;
  box-sizing: border-box;
  width: 9px;
  height: 5px;
  margin: 0 3.5px 0 -18.5px;
  border-left: 2px solid var(--check-mark-selected-fg);
  border-bottom: 2px solid var(--check-mark-selected-fg);
  transform: translateY(-1px) rotate(-45deg);
}

/* List ticks drawn by page components take the same bright tick at their own size. */
body :is(.slc-scrim .in-checks-list, .ow-check-list, #recommendation-form .ow-check-list, .ow-promises, .flow-plan-card) li::before {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-top: 0.2em;
  background: var(--app-check-icon) center / var(--app-check-fill) no-repeat;
  color: transparent;
}
body :is(.pt-checks, .listing-security-notice .ls-checks) li::before {
  content: "";
  background: var(--app-check-icon) center / var(--app-check-fill) no-repeat;
  color: transparent;
}
/* Included marks in plan comparisons and the application start list. */
html body:not([data-public-site]) .ow-tick {
  background: var(--app-check-icon) center / var(--app-check-fill) no-repeat;
  color: transparent;
}
html body:not([data-public-site]) .app-start-card li::before {
  content: "";
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.2em;
  background: var(--app-check-icon) center / var(--app-check-fill) no-repeat;
}
/* Font Awesome ticks leading a list row (swapped to SVG by rentari-icons.css). */
body :is(.vw-right > .fa-check, .rn-point > .fa-check, .mu-plan-list > li > .fa-check, .mu-pkg .sc-i > .fa-circle-check) {
  --rentari-symbol: var(--app-check-icon);
  color: transparent;
}

@media (prefers-reduced-motion: no-preference) {
  .check-mark { transition: transform 0.15s ease; }
}
