/* The diagnostic's last screen: a paper check mark folds itself — the faceted disc opens, the
   short arm drops into place, then the long arm, its brass corner last — and the way to book a
   meeting follows. The animation runs when the section gets .is-in (DiagnosticFlow). */

.diag__done {
  display: grid;
  justify-items: center;
  gap: var(--space-5);
  max-width: 40rem;
  padding-block: var(--space-7);
  text-align: center;
}

.diag__done-title {
  font-family: var(--font-display);
  font-size: var(--type-title);
  font-weight: 400;
  line-height: 1;
}

.diag__done-title:focus {
  outline: none;
}

.diag__done-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--space-3) var(--space-5);
  margin-top: var(--space-4);
}

.paper-check {
  width: 9rem;
  height: 9rem;
  overflow: visible;
  filter: drop-shadow(0 18px 18px color-mix(in srgb, var(--shadow-ink) 16%, transparent));
}

.paper-check__facet--a { fill: var(--paper-050); }
.paper-check__facet--b { fill: var(--paper-200); }
.paper-check__light { fill: var(--fern-500); }
.paper-check__dark { fill: var(--fern-700); }
.paper-check__ear { fill: var(--brass-400); }

.paper-check__disc,
.paper-check__arm {
  transform-box: view-box;
}

.paper-check__disc {
  transform-origin: 80px 80px;
}

.paper-check__arm--short {
  transform-origin: 40px 80px;
}

.paper-check__arm--long {
  transform-origin: 66px 106px;
}

@media (prefers-reduced-motion: no-preference) {
  .diag__done.is-in .paper-check__disc {
    animation: check-disc 0.6s var(--ease-fold) both;
  }

  .diag__done.is-in .paper-check__arm--short {
    animation: check-arm 0.42s var(--ease-fold) 0.35s both;
  }

  .diag__done.is-in .paper-check__arm--long {
    animation: check-arm 0.5s var(--ease-fold) 0.6s both;
  }

  .diag__done.is-in > :not(.paper-check) {
    animation: done-rise 0.6s var(--ease-fold) 0.85s both;
  }

  .diag__done.is-in > .diag__done-actions {
    animation-delay: 1s;
  }
}

@keyframes check-disc {
  from {
    opacity: 0;
    transform: rotate(-90deg) scale(0.4);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes check-arm {
  from {
    opacity: 0;
    transform: rotate(-35deg) scale(0);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes done-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}
